From: Pieter Lexis Date: Thu, 28 Apr 2016 13:34:59 +0000 (+0200) Subject: Add 2 wildcard CNAME tests X-Git-Tag: rec-4.0.0-alpha3~31^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52033c6ffbdf0450ae2552502a702376f2d8354d;p=pdns Add 2 wildcard CNAME tests --- diff --git a/regression-tests.recursor-dnssec/basicDNSSEC.py b/regression-tests.recursor-dnssec/basicDNSSEC.py index 8a9581033..729156913 100644 --- a/regression-tests.recursor-dnssec/basicDNSSEC.py +++ b/regression-tests.recursor-dnssec/basicDNSSEC.py @@ -89,3 +89,21 @@ class BasicDNSSEC(RecursorTest): self.assertRcodeEqual(res, dns.rcode.NOERROR) self.assertMatchingRRSIGInAnswer(res, expected) self.assertMessageIsAuthenticated(res) + + def testSecureCNAMEWildCardAnswer(self): + res = self.sendQuery('something.cnamewildcard.secure.example.', 'A') + expectedCNAME = dns.rrset.from_text('something.cnamewildcard.secure.example.', 0, dns.rdataclass.IN, 'CNAME', 'host1.secure.example.') + expectedA = dns.rrset.from_text('host1.secure.example.', 0, dns.rdataclass.IN, 'A', '192.0.2.2') + + self.assertRcodeEqual(res, dns.rcode.NOERROR) + self.assertMatchingRRSIGInAnswer(res, expectedCNAME) + self.assertMatchingRRSIGInAnswer(res, expectedA) + self.assertMessageIsAuthenticated(res) + + def testSecureCNAMEWildCardNXDOMAIN(self): + res = self.sendQuery('something.cnamewildcardnxdomain.secure.example.', 'A') + expectedCNAME = dns.rrset.from_text('something.cnamewildcardnxdomain.secure.example.', 0, dns.rdataclass.IN, 'CNAME', 'doesntexist.secure.example.') + + self.assertRcodeEqual(res, dns.rcode.NXDOMAIN) + self.assertMatchingRRSIGInAnswer(res, expectedCNAME) + self.assertMessageIsAuthenticated(res) diff --git a/regression-tests.recursor-dnssec/recursortests.py b/regression-tests.recursor-dnssec/recursortests.py index ffbdd180f..ea1767e14 100644 --- a/regression-tests.recursor-dnssec/recursortests.py +++ b/regression-tests.recursor-dnssec/recursortests.py @@ -100,6 +100,10 @@ host1.secure.example. 3600 IN A 192.0.2.2 host1.sub.secure.example. 3600 IN A 192.0.2.11 *.wildcard.secure.example. 3600 IN A 192.0.2.10 + +*.cnamewildcard.secure.example. 3600 IN CNAME host1.secure.example. + +*.cnamewildcardnxdomain.secure.example. 3600 IN CNAME doesntexist.secure.example. """, 'bogus.example': """ bogus.example. 3600 IN SOA {soa}