aboutsummaryrefslogtreecommitdiff
path: root/test/kubernetes_test.go
diff options
context:
space:
mode:
authorGravatar Chris O'Haver <cohaver@infoblox.com> 2017-02-07 16:22:43 -0500
committerGravatar John Belamaric <jbelamaric@infoblox.com> 2017-02-07 16:22:43 -0500
commit4b6860fc8189495a23c99543e6e7bee3733f58f9 (patch)
treeb9e9a717520e0c0f187a0d36c696f98bd4960f2c /test/kubernetes_test.go
parent89dc5720d03882f27313bb219abf79feaeaa30de (diff)
downloadcoredns-4b6860fc8189495a23c99543e6e7bee3733f58f9.tar.gz
coredns-4b6860fc8189495a23c99543e6e7bee3733f58f9.tar.zst
coredns-4b6860fc8189495a23c99543e6e7bee3733f58f9.zip
Fix k8s PTR when all namespaces exposed (#507)
* check for no namespace filter * integration test
Diffstat (limited to 'test/kubernetes_test.go')
-rw-r--r--test/kubernetes_test.go47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/kubernetes_test.go b/test/kubernetes_test.go
index 530051f0a..fd38c2e03 100644
--- a/test/kubernetes_test.go
+++ b/test/kubernetes_test.go
@@ -315,6 +315,42 @@ var dnsTestCasesPartialCidrReverseZone = []test.Case{
},
}
+var dnsTestCasesAllNSExposed = []test.Case{
+ {
+ Qname: "svc-1-a.test-1.svc.cluster.local.", Qtype: dns.TypeA,
+ Rcode: dns.RcodeSuccess,
+ Answer: []dns.RR{
+ test.A("svc-1-a.test-1.svc.cluster.local. 303 IN A 10.0.0.100"),
+ },
+ },
+ {
+ Qname: "svc-c.test-2.svc.cluster.local.", Qtype: dns.TypeA,
+ Rcode: dns.RcodeSuccess,
+ Answer: []dns.RR{
+ test.A("svc-c.test-1.svc.cluster.local. 303 IN A 10.0.0.120"),
+ },
+ },
+ {
+ Qname: "123.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
+ Rcode: dns.RcodeSuccess,
+ Answer: []dns.RR{},
+ },
+ {
+ Qname: "100.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
+ Rcode: dns.RcodeSuccess,
+ Answer: []dns.RR{
+ test.PTR("100.0.0.10.in-addr.arpa. 303 IN PTR svc-1-a.test-1.svc.cluster.local."),
+ },
+ },
+ {
+ Qname: "120.0.0.10.in-addr.arpa.", Qtype: dns.TypePTR,
+ Rcode: dns.RcodeSuccess,
+ Answer: []dns.RR{
+ test.PTR("120.0.0.10.in-addr.arpa. 303 IN PTR svc-c.test-2.svc.cluster.local."),
+ },
+ },
+}
+
func createTestServer(t *testing.T, corefile string) (*caddy.Instance, string) {
server, err := CoreDNSServer(corefile)
if err != nil {
@@ -424,3 +460,14 @@ func TestKubernetesIntegrationPartialCidrReverseZone(t *testing.T) {
`
doIntegrationTests(t, corefile, dnsTestCasesPartialCidrReverseZone)
}
+
+func TestKubernetesIntegrationAllNSExposed(t *testing.T) {
+ corefile :=
+ `.:0 {
+ kubernetes cluster.local {
+ endpoint http://localhost:8080
+ cidrs 10.0.0.0/24
+ }
+`
+ doIntegrationTests(t, corefile, dnsTestCasesAllNSExposed)
+}