]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Two more DNS64 test cases: "timeout on AAAA" and "Lua handled things" 11849/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 19 Aug 2022 10:01:16 +0000 (12:01 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 19 Aug 2022 10:01:16 +0000 (12:01 +0200)
regression-tests.recursor-dnssec/recursortests.py
regression-tests.recursor-dnssec/test_DNS64.py

index 8907fcdfc6bdf477b92cd0c1c42d7efec3d88478..ecc8f9485cbde5ebcdad206f271034ea7ebb9dfd 100644 (file)
@@ -299,7 +299,9 @@ node1.undelegated.insecure.example.  3600 IN A    192.0.2.22
 delay1.example.                       3600 IN SOA  {soa}
 delay1.example.                       3600 IN NS n1.delay1.example.
 ns1.delay1.example.                   3600 IN A    {prefix}.16
+8.delay1.example.                     3600 IN A    192.0.2.100
 *.delay1.example.                     0    LUA TXT ";" "local socket=require('socket')" "socket.sleep(tonumber(qname:getRawLabels()[1])/10)" "return 'a'"
+*.delay1.example.                     0    LUA AAAA ";" "local socket=require('socket')" "socket.sleep(tonumber(qname:getRawLabels()[1])/10)" "return '1::2'"
         """,
         
         'delay2.example': """
index 281be08d988e743eb65dd70a92222700fa8c15c9..abf6fdb23ac20f726ab1a04693af5514869bbadc 100644 (file)
@@ -5,11 +5,6 @@ from recursortests import RecursorTest
 
 class DNS64RecursorTest(RecursorTest):
 
-    _auth_zones = {
-        '8': {'threads': 1,
-              'zones': ['ROOT']}
-    }
-
     _confdir = 'DNS64'
     _config_template = """
     auth-zones=example.dns64=configs/%s/example.dns64.zone
@@ -134,10 +129,20 @@ formerr 3600 IN A 192.0.2.43
             self.assertRcodeEqual(res, dns.rcode.NOERROR)
             self.assertRRsetInAnswer(res, expected)
 
-    # If the AAAA FormFails, we still should get a dns64 result
-    def testFormErrAAAA(self):
-        qname = 'formerr.example.dns64.'
-        expected = dns.rrset.from_text(qname, 0, dns.rdataclass.IN, 'AAAA', '64:ff9b::c000:22b')
+    # If the AAAA is handled by Lua code, we should not get a dns64 result
+    def testFormerr(self):
+        qname = 'formerr.example.dns64'
+
+        query = dns.message.make_query(qname, 'AAAA', want_dnssec=True)
+        for method in ("sendUDPQuery", "sendTCPQuery"):
+            sender = getattr(self, method)
+            res = sender(query)
+            self.assertRcodeEqual(res, dns.rcode.FORMERR)
+
+    # If the AAAA times out, we still should get a dns64 result
+    def testTimeout(self):
+        qname = '8.delay1.example.'
+        expected = dns.rrset.from_text(qname, 0, dns.rdataclass.IN, 'AAAA', '64:ff9b::c000:264')
 
         query = dns.message.make_query(qname, 'AAAA', want_dnssec=True)
         for method in ("sendUDPQuery", "sendTCPQuery"):