diff options
Diffstat (limited to 'middleware/kubernetes/handler_test.go')
-rw-r--r-- | middleware/kubernetes/handler_test.go | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/middleware/kubernetes/handler_test.go b/middleware/kubernetes/handler_test.go index b866ce78c..292ffdf3a 100644 --- a/middleware/kubernetes/handler_test.go +++ b/middleware/kubernetes/handler_test.go @@ -47,7 +47,7 @@ var dnsTestCases = map[string](test.Case){ }, "SRV Service Not udp/tcp": { Qname: "*._not-udp-or-tcp.svc1.testns.svc.cluster.local.", Qtype: dns.TypeSRV, - Rcode: dns.RcodeSuccess, + Rcode: dns.RcodeNameError, Ns: []dns.RR{ test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), }, @@ -91,16 +91,21 @@ var dnsTestCases = map[string](test.Case){ }, "AAAA Service (existing service)": { Qname: "svc1.testns.svc.cluster.local.", Qtype: dns.TypeAAAA, - Rcode: dns.RcodeSuccess, - Answer: []dns.RR{}, + Rcode: dns.RcodeSuccess, Ns: []dns.RR{ test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), }, }, "AAAA Service (non-existing service)": { Qname: "svc0.testns.svc.cluster.local.", Qtype: dns.TypeAAAA, - Rcode: dns.RcodeNameError, - Answer: []dns.RR{}, + Rcode: dns.RcodeNameError, + Ns: []dns.RR{ + test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), + }, + }, + "A Service (non-existing service)": { + Qname: "svc0.testns.svc.cluster.local.", Qtype: dns.TypeA, + Rcode: dns.RcodeNameError, Ns: []dns.RR{ test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), }, @@ -112,6 +117,20 @@ var dnsTestCases = map[string](test.Case){ test.TXT("dns-version.cluster.local 28800 IN TXT 1.0.1"), }, }, + "A Service (Headless) does not exist": { + Qname: "bogusendpoint.hdls1.testns.svc.cluster.local.", Qtype: dns.TypeA, + Rcode: dns.RcodeNameError, + Ns: []dns.RR{ + test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), + }, + }, + "A Service does not exist": { + Qname: "bogusendpoint.svc0.testns.svc.cluster.local.", Qtype: dns.TypeA, + Rcode: dns.RcodeNameError, + Ns: []dns.RR{ + test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"), + }, + }, } var podModeDisabledCases = map[string](test.Case){ |