Running Tests
CoreDNS-GSLB features extensive unit and integration tests to ensure stability, proper protocol responses, and configuration parsing.
Running Unit Tests
To run the entire unit test suite:
To run a specific test case (e.g., TestGSLB_PickFailoverBackend):
Running Integration Tests
Integration tests validate end-to-end failover behavior, GeoIP features, and API configuration changes using real container environments. The integration test suite is split into two parts:
- Standalone Tests (standard features like GeoIP, Failover, API, and DNS discovery):
- Cluster Tests (shared health checks, locking, and Pub/Sub propagation):
To run both integration suites sequentially:
Troubleshooting Port Conflicts
If some ports (like 8080 for the REST API or 8053 for DNS) are already in use on your host, the Docker integration stack will throw binding errors.
You can override these default ports using environment variables:
Supported port environment variables:
COREDNS_PORT_API(default:8080)COREDNS_PORT_TCP(default:8053)COREDNS_PORT_UDP(default:8053)COREDNS_PORT_METRICS(default:9153)