]> granicus.if.org Git - pdns/commitdiff
Add 2 wildcard CNAME tests
authorPieter Lexis <pieter.lexis@powerdns.com>
Thu, 28 Apr 2016 13:34:59 +0000 (15:34 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Thu, 28 Apr 2016 13:34:59 +0000 (15:34 +0200)
regression-tests.recursor-dnssec/basicDNSSEC.py
regression-tests.recursor-dnssec/recursortests.py

index 8a958103320aa498ffaf77ffaf5b36d452ea74c7..72915691307d7e4728242deddc44241e983b9a81 100644 (file)
@@ -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)
index ffbdd180f308d2714266fc09bbf5e00e752ef32f..ea1767e14410c3bb5e708234a60f6981d78baf96 100644 (file)
@@ -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}