diff options
Diffstat (limited to 'plugin/file')
-rw-r--r-- | plugin/file/delegation_test.go | 22 | ||||
-rw-r--r-- | plugin/file/dname_test.go | 8 | ||||
-rw-r--r-- | plugin/file/dnssec_test.go | 18 | ||||
-rw-r--r-- | plugin/file/ent_test.go | 1 | ||||
-rw-r--r-- | plugin/file/file.go | 2 | ||||
-rw-r--r-- | plugin/file/glue_test.go | 5 | ||||
-rw-r--r-- | plugin/file/wildcard_test.go | 4 |
7 files changed, 14 insertions, 46 deletions
diff --git a/plugin/file/delegation_test.go b/plugin/file/delegation_test.go index 116b6b244..e51a600d7 100644 --- a/plugin/file/delegation_test.go +++ b/plugin/file/delegation_test.go @@ -73,8 +73,7 @@ var delegationTestCases = []test.Case{ var secureDelegationTestCases = []test.Case{ { - Qname: "a.delegated.example.org.", Qtype: dns.TypeTXT, - Do: true, + Qname: "a.delegated.example.org.", Qtype: dns.TypeTXT, Do: true, Ns: []dns.RR{ test.DS("delegated.example.org. 1800 IN DS 10056 5 1 EE72CABD1927759CDDA92A10DBF431504B9E1F13"), test.DS("delegated.example.org. 1800 IN DS 10056 5 2 E4B05F87725FA86D9A64F1E53C3D0E6250946599DFE639C45955B0ED416CDDFA"), @@ -83,14 +82,12 @@ var secureDelegationTestCases = []test.Case{ test.RRSIG("delegated.example.org. 1800 IN RRSIG DS 13 3 1800 20161129153240 20161030153240 49035 example.org. rlNNzcUmtbjLSl02ZzQGUbWX75yCUx0Mug1jHtKVqRq1hpPE2S3863tIWSlz+W9wz4o19OI4jbznKKqk+DGKog=="), }, Extra: []dns.RR{ - test.OPT(4096, true), test.A("a.delegated.example.org. 1800 IN A 139.162.196.78"), test.AAAA("a.delegated.example.org. 1800 IN AAAA 2a01:7e00::f03c:91ff:fef1:6735"), }, }, { - Qname: "delegated.example.org.", Qtype: dns.TypeNS, - Do: true, + Qname: "delegated.example.org.", Qtype: dns.TypeNS, Do: true, Ns: []dns.RR{ test.DS("delegated.example.org. 1800 IN DS 10056 5 1 EE72CABD1927759CDDA92A10DBF431504B9E1F13"), test.DS("delegated.example.org. 1800 IN DS 10056 5 2 E4B05F87725FA86D9A64F1E53C3D0E6250946599DFE639C45955B0ED416CDDFA"), @@ -99,14 +96,12 @@ var secureDelegationTestCases = []test.Case{ test.RRSIG("delegated.example.org. 1800 IN RRSIG DS 13 3 1800 20161129153240 20161030153240 49035 example.org. rlNNzcUmtbjLSl02ZzQGUbWX75yCUx0Mug1jHtKVqRq1hpPE2S3863tIWSlz+W9wz4o19OI4jbznKKqk+DGKog=="), }, Extra: []dns.RR{ - test.OPT(4096, true), test.A("a.delegated.example.org. 1800 IN A 139.162.196.78"), test.AAAA("a.delegated.example.org. 1800 IN AAAA 2a01:7e00::f03c:91ff:fef1:6735"), }, }, { - Qname: "foo.delegated.example.org.", Qtype: dns.TypeA, - Do: true, + Qname: "foo.delegated.example.org.", Qtype: dns.TypeA, Do: true, Ns: []dns.RR{ test.DS("delegated.example.org. 1800 IN DS 10056 5 1 EE72CABD1927759CDDA92A10DBF431504B9E1F13"), test.DS("delegated.example.org. 1800 IN DS 10056 5 2 E4B05F87725FA86D9A64F1E53C3D0E6250946599DFE639C45955B0ED416CDDFA"), @@ -115,14 +110,12 @@ var secureDelegationTestCases = []test.Case{ test.RRSIG("delegated.example.org. 1800 IN RRSIG DS 13 3 1800 20161129153240 20161030153240 49035 example.org. rlNNzcUmtbjLSl02ZzQGUbWX75yCUx0Mug1jHtKVqRq1hpPE2S3863tIWSlz+W9wz4o19OI4jbznKKqk+DGKog=="), }, Extra: []dns.RR{ - test.OPT(4096, true), test.A("a.delegated.example.org. 1800 IN A 139.162.196.78"), test.AAAA("a.delegated.example.org. 1800 IN AAAA 2a01:7e00::f03c:91ff:fef1:6735"), }, }, { - Qname: "foo.delegated.example.org.", Qtype: dns.TypeDS, - Do: true, + Qname: "foo.delegated.example.org.", Qtype: dns.TypeDS, Do: true, Ns: []dns.RR{ test.DS("delegated.example.org. 1800 IN DS 10056 5 1 EE72CABD1927759CDDA92A10DBF431504B9E1F13"), test.DS("delegated.example.org. 1800 IN DS 10056 5 2 E4B05F87725FA86D9A64F1E53C3D0E6250946599DFE639C45955B0ED416CDDFA"), @@ -131,14 +124,12 @@ var secureDelegationTestCases = []test.Case{ test.RRSIG("delegated.example.org. 1800 IN RRSIG DS 13 3 1800 20161129153240 20161030153240 49035 example.org. rlNNzcUmtbjLSl02ZzQGUbWX75yCUx0Mug1jHtKVqRq1hpPE2S3863tIWSlz+W9wz4o19OI4jbznKKqk+DGKog=="), }, Extra: []dns.RR{ - test.OPT(4096, true), test.A("a.delegated.example.org. 1800 IN A 139.162.196.78"), test.AAAA("a.delegated.example.org. 1800 IN AAAA 2a01:7e00::f03c:91ff:fef1:6735"), }, }, { - Qname: "delegated.example.org.", Qtype: dns.TypeDS, - Do: true, + Qname: "delegated.example.org.", Qtype: dns.TypeDS, Do: true, Answer: []dns.RR{ test.DS("delegated.example.org. 1800 IN DS 10056 5 1 EE72CABD1927759CDDA92A10DBF431504B9E1F13"), test.DS("delegated.example.org. 1800 IN DS 10056 5 2 E4B05F87725FA86D9A64F1E53C3D0E6250946599DFE639C45955B0ED416CDDFA"), @@ -149,9 +140,6 @@ var secureDelegationTestCases = []test.Case{ test.NS("example.org. 1800 IN NS b.iana-servers.net."), test.RRSIG("example.org. 1800 IN RRSIG NS 13 2 1800 20161129153240 20161030153240 49035 example.org. llrHoIuw="), }, - Extra: []dns.RR{ - test.OPT(4096, true), - }, }, } diff --git a/plugin/file/dname_test.go b/plugin/file/dname_test.go index 9dd2c2e24..85dc9d360 100644 --- a/plugin/file/dname_test.go +++ b/plugin/file/dname_test.go @@ -122,23 +122,19 @@ var dnameDnssecTestCases = []test.Case{ }, }, { - Qname: "dname.example.org.", Qtype: dns.TypeDNAME, - Do: true, + Qname: "dname.example.org.", Qtype: dns.TypeDNAME, Do: true, Answer: []dns.RR{ test.DNAME("dname.example.org. 1800 IN DNAME test.example.org."), test.RRSIG("dname.example.org. 1800 IN RRSIG DNAME 5 3 1800 20170702091734 20170602091734 54282 example.org. HvXtiBM="), }, - Extra: []dns.RR{test.OPT(4096, true)}, }, { - Qname: "a.dname.example.org.", Qtype: dns.TypeA, - Do: true, + Qname: "a.dname.example.org.", Qtype: dns.TypeA, Do: true, Answer: []dns.RR{ test.CNAME("a.dname.example.org. 1800 IN CNAME a.test.example.org."), test.DNAME("dname.example.org. 1800 IN DNAME test.example.org."), test.RRSIG("dname.example.org. 1800 IN RRSIG DNAME 5 3 1800 20170702091734 20170602091734 54282 example.org. HvXtiBM="), }, - Extra: []dns.RR{test.OPT(4096, true)}, }, } diff --git a/plugin/file/dnssec_test.go b/plugin/file/dnssec_test.go index 29cd9a61e..fee39a37a 100644 --- a/plugin/file/dnssec_test.go +++ b/plugin/file/dnssec_test.go @@ -11,6 +11,7 @@ import ( "github.com/miekg/dns" ) +// All OPT RR are added in server.go, so we don't specify them in the unit tests. var dnssecTestCases = []test.Case{ { Qname: "miek.nl.", Qtype: dns.TypeSOA, Do: true, @@ -18,8 +19,7 @@ var dnssecTestCases = []test.Case{ test.RRSIG("miek.nl. 1800 IN RRSIG SOA 8 2 1800 20160426031301 20160327031301 12051 miek.nl. FIrzy07acBbtyQczy1dc="), test.SOA("miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1282630057 14400 3600 604800 14400"), }, - Ns: auth, - Extra: []dns.RR{test.OPT(4096, true)}, + Ns: auth, }, { Qname: "miek.nl.", Qtype: dns.TypeAAAA, Do: true, @@ -27,8 +27,7 @@ var dnssecTestCases = []test.Case{ test.AAAA("miek.nl. 1800 IN AAAA 2a01:7e00::f03c:91ff:fef1:6735"), test.RRSIG("miek.nl. 1800 IN RRSIG AAAA 8 2 1800 20160426031301 20160327031301 12051 miek.nl. SsRT="), }, - Ns: auth, - Extra: []dns.RR{test.OPT(4096, true)}, + Ns: auth, }, { Qname: "miek.nl.", Qtype: dns.TypeNS, Do: true, @@ -39,7 +38,6 @@ var dnssecTestCases = []test.Case{ test.NS("miek.nl. 1800 IN NS omval.tednet.nl."), test.RRSIG("miek.nl. 1800 IN RRSIG NS 8 2 1800 20160426031301 20160327031301 12051 miek.nl. ZLtsQhwaz+lHfNpztFoR1Vxs="), }, - Extra: []dns.RR{test.OPT(4096, true)}, }, { Qname: "miek.nl.", Qtype: dns.TypeMX, Do: true, @@ -51,8 +49,7 @@ var dnssecTestCases = []test.Case{ test.MX("miek.nl. 1800 IN MX 5 alt2.aspmx.l.google.com."), test.RRSIG("miek.nl. 1800 IN RRSIG MX 8 2 1800 20160426031301 20160327031301 12051 miek.nl. kLqG+iOr="), }, - Ns: auth, - Extra: []dns.RR{test.OPT(4096, true)}, + Ns: auth, }, { Qname: "www.miek.nl.", Qtype: dns.TypeA, Do: true, @@ -63,9 +60,6 @@ var dnssecTestCases = []test.Case{ test.RRSIG("www.miek.nl. 1800 RRSIG CNAME 8 3 1800 20160426031301 20160327031301 12051 miek.nl. NVZmMJaypS+wDL2Lar4Zw1zF"), }, Ns: auth, - Extra: []dns.RR{ - test.OPT(4096, true), - }, }, { // NoData @@ -76,7 +70,6 @@ var dnssecTestCases = []test.Case{ test.RRSIG("miek.nl. 1800 IN RRSIG SOA 8 2 1800 20160426031301 20160327031301 12051 miek.nl. FIrzy07acBbtyQczy1dc="), test.SOA("miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1282630057 14400 3600 604800 14400"), }, - Extra: []dns.RR{test.OPT(4096, true)}, }, { Qname: "b.miek.nl.", Qtype: dns.TypeA, Do: true, @@ -89,7 +82,6 @@ var dnssecTestCases = []test.Case{ test.RRSIG("miek.nl. 1800 IN RRSIG SOA 8 2 1800 20160426031301 20160327031301 12051 miek.nl. FIrzy07acBbtyQczy1dc="), test.SOA("miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1282630057 14400 3600 604800 14400"), }, - Extra: []dns.RR{test.OPT(4096, true)}, }, { Qname: "b.blaat.miek.nl.", Qtype: dns.TypeA, Do: true, @@ -102,7 +94,6 @@ var dnssecTestCases = []test.Case{ test.RRSIG("miek.nl. 1800 IN RRSIG SOA 8 2 1800 20160426031301 20160327031301 12051 miek.nl. FIrzy07acBbtyQczy1dc="), test.SOA("miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1282630057 14400 3600 604800 14400"), }, - Extra: []dns.RR{test.OPT(4096, true)}, }, { Qname: "b.a.miek.nl.", Qtype: dns.TypeA, Do: true, @@ -114,7 +105,6 @@ var dnssecTestCases = []test.Case{ test.RRSIG("miek.nl. 1800 IN RRSIG SOA 8 2 1800 20160426031301 20160327031301 12051 miek.nl. FIrzy07acBbtyQczy1dc="), test.SOA("miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1282630057 14400 3600 604800 14400"), }, - Extra: []dns.RR{test.OPT(4096, true)}, }, } diff --git a/plugin/file/ent_test.go b/plugin/file/ent_test.go index 496d1a727..4ff95f330 100644 --- a/plugin/file/ent_test.go +++ b/plugin/file/ent_test.go @@ -26,7 +26,6 @@ var entTestCases = []test.Case{ test.RRSIG("miek.nl. 1800 IN RRSIG SOA 8 2 1800 20160502144311 20160402144311 12051 miek.nl. KegoBxA3Tbrhlc4cEdkRiteIkOfsq"), test.SOA("miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1282630057 14400 3600 604800 14400"), }, - Extra: []dns.RR{test.OPT(4096, true)}, }, } diff --git a/plugin/file/file.go b/plugin/file/file.go index f2294fa53..5c13042cb 100644 --- a/plugin/file/file.go +++ b/plugin/file/file.go @@ -98,8 +98,6 @@ func (f File) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i return dns.RcodeServerFailure, nil } - state.SizeAndDo(m) - m, _ = state.Scrub(m) w.WriteMsg(m) return dns.RcodeSuccess, nil } diff --git a/plugin/file/glue_test.go b/plugin/file/glue_test.go index 9cb71a993..e6f1e027f 100644 --- a/plugin/file/glue_test.go +++ b/plugin/file/glue_test.go @@ -11,8 +11,7 @@ import ( "github.com/miekg/dns" ) -// another personal zone (helps in testing as my secondary is NSD -// atoom = atom in English. +// another personal zone (helps in testing as my secondary is NSD, atoom = atom in English. var atoomTestCases = []test.Case{ { Qname: atoom, Qtype: dns.TypeNS, Do: true, @@ -23,7 +22,7 @@ var atoomTestCases = []test.Case{ test.RRSIG("atoom.net. 1800 IN RRSIG NS 8 2 1800 20170112031301 20161213031301 53289 atoom.net. DLe+G1 jlw="), }, Extra: []dns.RR{ - test.OPT(4096, true), + // test.OPT(4096, true), // added by server, not test in this unit test. test.A("linode.atoom.net. 1800 IN A 176.58.119.54"), test.AAAA("linode.atoom.net. 1800 IN AAAA 2a01:7e00::f03c:91ff:fe79:234c"), test.RRSIG("linode.atoom.net. 1800 IN RRSIG A 8 3 1800 20170112031301 20161213031301 53289 atoom.net. Z4Ka4OLDoyxj72CL vkI="), diff --git a/plugin/file/wildcard_test.go b/plugin/file/wildcard_test.go index 8f73d1543..314b699c6 100644 --- a/plugin/file/wildcard_test.go +++ b/plugin/file/wildcard_test.go @@ -11,6 +11,7 @@ import ( "github.com/miekg/dns" ) +// these examples don't have an additional opt RR set, because that's gets added by the server. var wildcardTestCases = []test.Case{ { Qname: "wild.dnssex.nl.", Qtype: dns.TypeTXT, @@ -36,7 +37,6 @@ var wildcardTestCases = []test.Case{ test.NSEC("a.dnssex.nl. 14400 IN NSEC www.dnssex.nl. A AAAA RRSIG NSEC"), test.RRSIG("a.dnssex.nl. 14400 IN RRSIG NSEC 8 3 14400 20160428190224 20160329190224 14460 dnssex.nl. S+UMs2ySgRaaRY"), }, dnssexAuth...), - Extra: []dns.RR{test.OPT(4096, true)}, }, { Qname: "a.wild.dnssex.nl.", Qtype: dns.TypeTXT, Do: true, @@ -48,7 +48,6 @@ var wildcardTestCases = []test.Case{ test.NSEC("a.dnssex.nl. 14400 IN NSEC www.dnssex.nl. A AAAA RRSIG NSEC"), test.RRSIG("a.dnssex.nl. 14400 IN RRSIG NSEC 8 3 14400 20160428190224 20160329190224 14460 dnssex.nl. S+UMs2ySgRaaRY"), }, dnssexAuth...), - Extra: []dns.RR{test.OPT(4096, true)}, }, // nodata responses { @@ -66,7 +65,6 @@ var wildcardTestCases = []test.Case{ test.RRSIG(`dnssex.nl. 1800 IN RRSIG SOA 8 2 1800 20160428190224 20160329190224 14460 dnssex.nl. CA/Y3m9hCOiKC/8ieSOv8SeP964Bq++lyH8BZJcTaabAsERs4xj5PRtcxicwQXZiF8fYUCpROlUS0YR8Cdw=`), test.SOA(`dnssex.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1459281744 14400 3600 604800 14400`), }, - Extra: []dns.RR{test.OPT(4096, true)}, }, } |