mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-31 10:13:14 -04:00 
			
		
		
		
	middleware/file: include nsset in replies
This is required so that a resolver can upade the referral NSset with the NSset at the child. Update tests as well.
This commit is contained in:
		| @@ -18,12 +18,14 @@ var wildcardTestCases = []test.Case{ | ||||
| 		Answer: []dns.RR{ | ||||
| 			test.TXT(`wild.dnssex.nl.	1800	IN	TXT	"Doing It Safe Is Better"`), | ||||
| 		}, | ||||
| 		Ns: dnssexAuth[:len(dnssexAuth)-1], // remove RRSIG on the end | ||||
| 	}, | ||||
| 	{ | ||||
| 		Qname: "a.wild.dnssex.nl.", Qtype: dns.TypeTXT, | ||||
| 		Answer: []dns.RR{ | ||||
| 			test.TXT(`a.wild.dnssex.nl.	1800	IN	TXT	"Doing It Safe Is Better"`), | ||||
| 		}, | ||||
| 		Ns: dnssexAuth[:len(dnssexAuth)-1], // remove RRSIG on the end | ||||
| 	}, | ||||
| 	{ | ||||
| 		Qname: "wild.dnssex.nl.", Qtype: dns.TypeTXT, Do: true, | ||||
| @@ -31,10 +33,10 @@ var wildcardTestCases = []test.Case{ | ||||
| 			test.RRSIG("wild.dnssex.nl.	1800	IN	RRSIG	TXT 8 2 1800 20160428190224 20160329190224 14460 dnssex.nl. FUZSTyvZfeuuOpCm"), | ||||
| 			test.TXT(`wild.dnssex.nl.	1800	IN	TXT	"Doing It Safe Is Better"`), | ||||
| 		}, | ||||
| 		Ns: []dns.RR{ | ||||
| 		Ns: append([]dns.RR{ | ||||
| 			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)}, | ||||
| 	}, | ||||
| 	{ | ||||
| @@ -43,10 +45,10 @@ var wildcardTestCases = []test.Case{ | ||||
| 			test.RRSIG("a.wild.dnssex.nl.	1800	IN	RRSIG	TXT 8 2 1800 20160428190224 20160329190224 14460 dnssex.nl. FUZSTyvZfeuuOpCm"), | ||||
| 			test.TXT(`a.wild.dnssex.nl.	1800	IN	TXT	"Doing It Safe Is Better"`), | ||||
| 		}, | ||||
| 		Ns: []dns.RR{ | ||||
| 		Ns: append([]dns.RR{ | ||||
| 			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 | ||||
| @@ -61,14 +63,21 @@ var wildcardTestCases = []test.Case{ | ||||
| 		Ns: []dns.RR{ | ||||
| 			// TODO(miek): needs closest encloser proof as well? This is the wrong answer | ||||
| 			test.NSEC(`*.dnssex.nl.	14400	IN	NSEC	a.dnssex.nl. TXT RRSIG NSEC`), | ||||
| 			test.RRSIG(`*.dnssex.nl.	14400	IN	RRSIG	NSEC 8 2 14400 20160428190224 20160329190224 14460 dnssex.nl. os6INm6q2eXknD5z8TpfbK00uxVbQefMvHcR/RNX/kh0xXvzAaaDOV+Ge/Ko+2dXnKP+J1LYG9ffXNpdbaQy5ygzH5F041GJst4566GdG/jt7Z7vLHYxEBTpZfxo+PLsXQXH3VTemZyuWyDfqJzafXJVH1F0nDrcXmMlR6jlBHA=`), | ||||
| 			test.RRSIG(`dnssex.nl.	1800	IN	RRSIG	SOA 8 2 1800 20160428190224 20160329190224 14460 dnssex.nl. CA/Y3m9hCOiKC/8ieSOv8SeP964BUdG/8MC3WtKljUosK9Z9bBGrVizDjjqgq++lyH8BZJcTaabAsERs4xj5PRtcxicwQXZACX5VYjXHQeZmCyytFU5wq2gcXSmvUH86zZzftx3RGPvn1aOoTlcvoC3iF8fYUCpROlUS0YR8Cdw=`), | ||||
| 			test.RRSIG(`*.dnssex.nl.	14400	IN	RRSIG	NSEC 8 2 14400 20160428190224 20160329190224 14460 dnssex.nl. os6INm6q2eXknD5z8TaaDOV+Ge/Ko+2dXnKP+J1fqJzafXJVH1F0nDrcXmMlR6jlBHA=`), | ||||
| 			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)}, | ||||
| 	}, | ||||
| } | ||||
|  | ||||
| var dnssexAuth = []dns.RR{ | ||||
| 	test.NS("dnssex.nl.	1800	IN	NS	linode.atoom.net."), | ||||
| 	test.NS("dnssex.nl.	1800	IN	NS	ns-ext.nlnetlabs.nl."), | ||||
| 	test.NS("dnssex.nl.	1800	IN	NS	omval.tednet.nl."), | ||||
| 	test.RRSIG("dnssex.nl.	1800	IN	RRSIG	NS 8 2 1800 20160428190224 20160329190224 14460 dnssex.nl. dLIeEvP86jj5ndkcLzhgvWixTABjWAGRTGQsPsVDFXsGMf9TGGC9FEomgkCVeNC0="), | ||||
| } | ||||
|  | ||||
| func TestLookupWildcard(t *testing.T) { | ||||
| 	zone, err := Parse(strings.NewReader(dbDnssexNLSigned), testzone1, "stdin") | ||||
| 	if err != nil { | ||||
| @@ -115,12 +124,14 @@ var wildcardDoubleTestCases = []test.Case{ | ||||
| 		Answer: []dns.RR{ | ||||
| 			test.TXT(`wild.w.example.org. IN	TXT	"Wildcard"`), | ||||
| 		}, | ||||
| 		Ns: exampleAuth, | ||||
| 	}, | ||||
| 	{ | ||||
| 		Qname: "wild.c.example.org.", Qtype: dns.TypeTXT, | ||||
| 		Answer: []dns.RR{ | ||||
| 			test.TXT(`wild.c.example.org. IN	TXT	"c Wildcard"`), | ||||
| 		}, | ||||
| 		Ns: exampleAuth, | ||||
| 	}, | ||||
| 	{ | ||||
| 		Qname: "wild.d.example.org.", Qtype: dns.TypeTXT, | ||||
| @@ -128,15 +139,22 @@ var wildcardDoubleTestCases = []test.Case{ | ||||
| 			test.TXT(`alias.example.org. IN	TXT	"Wildcard CNAME expansion"`), | ||||
| 			test.CNAME(`wild.d.example.org. IN	CNAME	alias.example.org`), | ||||
| 		}, | ||||
| 		Ns: exampleAuth, | ||||
| 	}, | ||||
| 	{ | ||||
| 		Qname: "alias.example.org.", Qtype: dns.TypeTXT, | ||||
| 		Answer: []dns.RR{ | ||||
| 			test.TXT(`alias.example.org. IN	TXT	"Wildcard CNAME expansion"`), | ||||
| 		}, | ||||
| 		Ns: exampleAuth, | ||||
| 	}, | ||||
| } | ||||
|  | ||||
| var exampleAuth = []dns.RR{ | ||||
| 	test.NS("example.org.	3600	IN	NS	a.iana-servers.net."), | ||||
| 	test.NS("example.org.	3600	IN	NS	b.iana-servers.net."), | ||||
| } | ||||
|  | ||||
| func TestLookupDoubleWildcard(t *testing.T) { | ||||
| 	zone, err := Parse(strings.NewReader(exampleOrg), "example.org.", "stdin") | ||||
| 	if err != nil { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user