diff options
author | 2016-12-02 17:50:01 -0500 | |
---|---|---|
committer | 2016-12-02 22:50:01 +0000 | |
commit | 56d3b47d119188a9461f1a78ae4cb24ab6809697 (patch) | |
tree | f9e2d71fab71f97f9371b296fd04c7ccfd14fc05 /test/kubernetes_test.go | |
parent | 8faa8354b499d3cff18c2a283961580ead462b76 (diff) | |
download | coredns-56d3b47d119188a9461f1a78ae4cb24ab6809697.tar.gz coredns-56d3b47d119188a9461f1a78ae4cb24ab6809697.tar.zst coredns-56d3b47d119188a9461f1a78ae4cb24ab6809697.zip |
Add A lookup for headless services (#451)
Diffstat (limited to 'test/kubernetes_test.go')
-rw-r--r-- | test/kubernetes_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/kubernetes_test.go b/test/kubernetes_test.go index 68ec319cf..215b8191c 100644 --- a/test/kubernetes_test.go +++ b/test/kubernetes_test.go @@ -59,6 +59,8 @@ var dnsTestCases = []test.Case{ test.A("svc-1-a.test-1.svc.cluster.local. 303 IN A 10.0.0.100"), test.A("svc-1-b.test-1.svc.cluster.local. 303 IN A 10.0.0.110"), test.A("svc-c.test-1.svc.cluster.local. 303 IN A 10.0.0.115"), + test.A("headless-svc.test-1.svc.cluster.local. 303 IN A 172.17.0.5"), + test.A("headless-svc.test-1.svc.cluster.local. 303 IN A 172.17.0.6"), }, }, { @@ -68,6 +70,8 @@ var dnsTestCases = []test.Case{ test.A("svc-1-a.test-1.svc.cluster.local. 303 IN A 10.0.0.100"), test.A("svc-1-b.test-1.svc.cluster.local. 303 IN A 10.0.0.110"), test.A("svc-c.test-1.svc.cluster.local. 303 IN A 10.0.0.115"), + test.A("headless-svc.test-1.svc.cluster.local. 303 IN A 172.17.0.5"), + test.A("headless-svc.test-1.svc.cluster.local. 303 IN A 172.17.0.6"), }, }, { @@ -87,6 +91,16 @@ var dnsTestCases = []test.Case{ test.A("svc-1-a.test-1.svc.cluster.local. 303 IN A 10.0.0.100"), test.A("svc-1-b.test-1.svc.cluster.local. 303 IN A 10.0.0.110"), test.A("svc-c.test-1.svc.cluster.local. 303 IN A 10.0.0.115"), + test.A("headless-svc.test-1.svc.cluster.local. 303 IN A 172.17.0.5"), + test.A("headless-svc.test-1.svc.cluster.local. 303 IN A 172.17.0.6"), + }, + }, + { + Qname: "headless-svc.test-1.svc.cluster.local.", Qtype: dns.TypeA, + Rcode: dns.RcodeSuccess, + Answer: []dns.RR{ + test.A("headless-svc.test-1.svc.cluster.local. 303 IN A 172.17.0.5"), + test.A("headless-svc.test-1.svc.cluster.local. 303 IN A 172.17.0.6"), }, }, //TODO: Fix below to all use test.SRV not test.A! @@ -137,6 +151,8 @@ var dnsTestCases = []test.Case{ test.SRV("_https._tcp.svc-1-a.test-1.svc.cluster.local. 303 IN SRV 10 100 443 svc-1-a.test-1.svc.cluster.local."), test.SRV("_http._tcp.svc-1-b.test-1.svc.cluster.local. 303 IN SRV 10 100 80 svc-1-b.test-1.svc.cluster.local."), test.SRV("_c-port._udp.svc-c.test-1.svc.cluster.local. 303 IN SRV 10 100 1234 svc-c.test-1.svc.cluster.local."), + test.SRV("_c-port._udp.headless-svc.test-1.svc.cluster.local. 303 IN SRV 10 100 1234 headless-svc.test-1.svc.cluster.local."), + test.SRV("_c-port._udp.headless-svc.test-1.svc.cluster.local. 303 IN SRV 10 100 1234 headless-svc.test-1.svc.cluster.local."), }, }, { @@ -147,6 +163,8 @@ var dnsTestCases = []test.Case{ test.SRV("_https._tcp.svc-1-a.test-1.svc.cluster.local. 303 IN SRV 10 100 443 svc-1-a.test-1.svc.cluster.local."), test.SRV("_http._tcp.svc-1-b.test-1.svc.cluster.local. 303 IN SRV 10 100 80 svc-1-b.test-1.svc.cluster.local."), test.SRV("_c-port._udp.svc-c.test-1.svc.cluster.local. 303 IN SRV 10 100 1234 svc-c.test-1.svc.cluster.local."), + test.SRV("_c-port._udp.headless-svc.test-1.svc.cluster.local. 303 IN SRV 10 100 1234 headless-svc.test-1.svc.cluster.local."), + test.SRV("_c-port._udp.headless-svc.test-1.svc.cluster.local. 303 IN SRV 10 100 1234 headless-svc.test-1.svc.cluster.local."), }, }, { @@ -167,6 +185,8 @@ var dnsTestCases = []test.Case{ test.SRV("_https._tcp.svc-1-a.test-1.svc.cluster.local. 303 IN SRV 10 100 443 svc-1-a.test-1.svc.cluster.local."), test.SRV("_http._tcp.svc-1-b.test-1.svc.cluster.local. 303 IN SRV 10 100 80 svc-1-b.test-1.svc.cluster.local."), test.SRV("_c-port._udp.svc-c.test-1.svc.cluster.local. 303 IN SRV 10 100 1234 svc-c.test-1.svc.cluster.local."), + test.SRV("_c-port._udp.headless-svc.test-1.svc.cluster.local. 303 IN SRV 10 100 1234 headless-svc.test-1.svc.cluster.local."), + test.SRV("_c-port._udp.headless-svc.test-1.svc.cluster.local. 303 IN SRV 10 100 1234 headless-svc.test-1.svc.cluster.local."), }, }, { @@ -223,6 +243,7 @@ func TestKubernetesIntegration(t *testing.T) { time.Sleep(5 * time.Second) for _, tc := range dnsTestCases { + dnsClient := new(dns.Client) dnsMessage := new(dns.Msg) |