diff options
Diffstat (limited to 'plugin/clouddns/clouddns_test.go')
-rw-r--r-- | plugin/clouddns/clouddns_test.go | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/plugin/clouddns/clouddns_test.go b/plugin/clouddns/clouddns_test.go index dafd65bba..7d9db85f3 100644 --- a/plugin/clouddns/clouddns_test.go +++ b/plugin/clouddns/clouddns_test.go @@ -10,7 +10,7 @@ import ( "github.com/coredns/coredns/plugin/pkg/fall" "github.com/coredns/coredns/plugin/pkg/upstream" "github.com/coredns/coredns/plugin/test" - crequest "github.com/coredns/coredns/request" + "github.com/coredns/coredns/request" "github.com/miekg/dns" gcp "google.golang.org/api/dns/v1" @@ -138,7 +138,7 @@ func TestCloudDNS(t *testing.T) { r.Fall = fall.Zero r.Fall.SetZonesFromArgs([]string{"gov."}) r.Next = test.HandlerFunc(func(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) { - state := crequest.Request{W: w, Req: r} + state := request.Request{W: w, Req: r} qname := state.Name() m := new(dns.Msg) rcode := dns.RcodeServerFailure @@ -211,30 +211,24 @@ func TestCloudDNS(t *testing.T) { // 5. Explicit SOA query for example.org. { qname: "example.org", - qtype: dns.TypeSOA, - wantAnswer: []string{"org. 300 IN SOA ns-cloud-e1.googledomains.com. cloud-dns-hostmaster.google.com. 1 21600 300 259200 300"}, - }, - // 6. Explicit SOA query for example.org. - { - qname: "example.org", qtype: dns.TypeNS, wantNS: []string{"org. 300 IN SOA ns-cloud-c1.googledomains.com. cloud-dns-hostmaster.google.com. 1 21600 300 259200 300"}, }, - // 7. AAAA query for split-example.org must return NODATA. + // 6. AAAA query for split-example.org must return NODATA. { qname: "split-example.gov", qtype: dns.TypeAAAA, wantRetCode: dns.RcodeSuccess, wantNS: []string{"org. 300 IN SOA ns-cloud-c1.googledomains.com. cloud-dns-hostmaster.google.com. 1 21600 300 259200 300"}, }, - // 8. Zone not configured. + // 7. Zone not configured. { qname: "badexample.com", qtype: dns.TypeA, wantRetCode: dns.RcodeServerFailure, wantMsgRCode: dns.RcodeServerFailure, }, - // 9. No record found. Return SOA record. + // 8. No record found. Return SOA record. { qname: "bad.org", qtype: dns.TypeA, @@ -242,25 +236,25 @@ func TestCloudDNS(t *testing.T) { wantMsgRCode: dns.RcodeNameError, wantNS: []string{"org. 300 IN SOA ns-cloud-c1.googledomains.com. cloud-dns-hostmaster.google.com. 1 21600 300 259200 300"}, }, - // 10. No record found. Fallthrough. + // 9. No record found. Fallthrough. { qname: "example.gov", qtype: dns.TypeA, wantAnswer: []string{"example.gov. 300 IN A 2.4.6.8"}, }, - // 11. other-zone.example.org is stored in a different hosted zone. success + // 10. other-zone.example.org is stored in a different hosted zone. success { qname: "other-example.org", qtype: dns.TypeA, wantAnswer: []string{"other-example.org. 300 IN A 3.5.7.9"}, }, - // 12. split-example.org only has A record. Expect NODATA. + // 11. split-example.org only has A record. Expect NODATA. { qname: "split-example.org", qtype: dns.TypeAAAA, wantNS: []string{"org. 300 IN SOA ns-cloud-e1.googledomains.com. cloud-dns-hostmaster.google.com. 1 21600 300 259200 300"}, }, - // 13. *.www.example.org is a wildcard CNAME to www.example.org. + // 12. *.www.example.org is a wildcard CNAME to www.example.org. { qname: "a.www.example.org", qtype: dns.TypeA, |