} if !test.Section(t, tc, test.Ns, resp.Ns) { t.Logf("%v\n", resp) } if !test.Section(t, tc, test.Extra, resp.Extra) { t.Logf("%v\n", resp) } } } // Note the key is encoded as DNS name, while in "reality" it is a etcd path. var servicesMulti = []*msg.Service{ {Host: "dev.server1", Port: 8080, Key: "a.server1.dev.region1.skydns.test."}, {Host: "dev.server1", Port: 8080, Key: "a.server1.dev.region1.miek.nl."}, {Host: "dev.server1", Port: 8080, Key: "a.server1.dev.region1.example.org."}, } var dnsTestCasesMulti = []test.Case{ { Qname: "a.server1.dev.region1.skydns.test.", Qtype: dns.TypeSRV, Answer: []dns.RR{test.SRV("a.server1.dev.region1.skydns.test. 300 SRV 10 100 8080 dev.server1.")}, }, { Qname: "a.server1.dev.region1.miek.nl.", Qtype: dns.TypeSRV, Answer: []dns.RR{test.SRV("a.server1.dev.region1.miek.nl. 300 SRV 10 100 8080 dev.server1.")}, }, { Qname: "a.server1.dev.region1.example.org.", Qtype: dns.TypeSRV, Rcode: dns.RcodeServerFailure, }, }
{Host: "10.0.0.1", Port: 8080, Key: "c.sub.region1.skydns.test."}, // Cname loop. {Host: "a.cname.skydns.test", Key: "b.cname.skydns.test."}, {Host: "b.cname.skydns.test", Key: "a.cname.skydns.test."}, // Nameservers. {Host: "10.0.0.2", Key: "a.ns.dns.skydns.test."}, {Host: "10.0.0.3", Key: "b.ns.dns.skydns.test."}, // Reverse. {Host: "reverse.example.com", Key: "1.0.0.10.in-addr.arpa."}, // 10.0.0.1 } var dnsTestCases = []test.Case{ // SRV Test { Qname: "a.server1.dev.region1.skydns.test.", Qtype: dns.TypeSRV, Answer: []dns.RR{test.SRV("a.server1.dev.region1.skydns.test. 300 SRV 10 100 8080 dev.server1.")}, }, // SRV Test (case test) { Qname: "a.SERVer1.dEv.region1.skydns.tEst.", Qtype: dns.TypeSRV, Answer: []dns.RR{test.SRV("a.SERVer1.dEv.region1.skydns.tEst. 300 SRV 10 100 8080 dev.server1.")}, }, // NXDOMAIN Test { Qname: "doesnotexist.skydns.test.", Qtype: dns.TypeA, Rcode: dns.RcodeNameError, Ns: []dns.RR{ test.SOA("skydns.test. 300 SOA ns.dns.skydns.test. hostmaster.skydns.test. 0 0 0 0 0"), }, }, // A Test
} var servicesCname = []*msg.Service{ {Host: "cname1.region2.skydns.test", Key: "a.server1.dev.region1.skydns.test."}, {Host: "cname2.region2.skydns.test", Key: "cname1.region2.skydns.test."}, {Host: "cname3.region2.skydns.test", Key: "cname2.region2.skydns.test."}, {Host: "cname4.region2.skydns.test", Key: "cname3.region2.skydns.test."}, {Host: "cname5.region2.skydns.test", Key: "cname4.region2.skydns.test."}, {Host: "cname6.region2.skydns.test", Key: "cname5.region2.skydns.test."}, {Host: "endpoint.region2.skydns.test", Key: "cname6.region2.skydns.test."}, {Host: "10.240.0.1", Key: "endpoint.region2.skydns.test."}, } var dnsTestCasesCname = []test.Case{ { Qname: "a.server1.dev.region1.skydns.test.", Qtype: dns.TypeSRV, Answer: []dns.RR{ test.SRV("a.server1.dev.region1.skydns.test. 300 IN SRV 10 100 0 cname1.region2.skydns.test."), }, Extra: []dns.RR{ test.CNAME("cname1.region2.skydns.test. 300 IN CNAME cname2.region2.skydns.test."), test.CNAME("cname2.region2.skydns.test. 300 IN CNAME cname3.region2.skydns.test."), test.CNAME("cname3.region2.skydns.test. 300 IN CNAME cname4.region2.skydns.test."), test.CNAME("cname4.region2.skydns.test. 300 IN CNAME cname5.region2.skydns.test."), test.CNAME("cname5.region2.skydns.test. 300 IN CNAME cname6.region2.skydns.test."), test.CNAME("cname6.region2.skydns.test. 300 IN CNAME endpoint.region2.skydns.test."), test.A("endpoint.region2.skydns.test. 300 IN A 10.240.0.1"), }, }, }