self.assertEqual(len(res.authority), 0)
class PolicyEventFilterOnFollowUpTest(RecursorTest):
- """Tests the interaction between RPZ and followup queries (dns64, folliwCNAME)
+ """Tests the interaction between RPZ and followup queries (dns64, followCNAME)
"""
_confdir = 'policyeventfilter-followup'
self.assertEqual(len(res.authority), 0)
self.assertResponseMatches(query, expected, res)
+class PolicyEventFilterOnFollowUpWithNativeDNS64Test(RecursorTest):
+ """Tests the interaction between followup queries and native dns64
+ """
+
+ _confdir = 'policyeventfilter-followup-dns64'
+ _config_template = """
+ dns64-prefix=1234::/96
+ """
+ _lua_config_file = """
+ """
+ _lua_dns_script_file = """
+ function preresolve(dq)
+ dq:addAnswer(pdns.CNAME, "cname.secure.example.")
+ dq.followupFunction="followCNAMERecords"
+ dq.rcode = pdns.NOERROR
+ return true
+ end
+
+ """
+
+ def testAAAA(self):
+ expected = [
+ dns.rrset.from_text('mx1.secure.example.', 15, dns.rdataclass.IN, 'CNAME', 'cname.secure.example.'),
+ dns.rrset.from_text('cname.secure.example.', 15, dns.rdataclass.IN, 'CNAME', ' host1.secure.example.'),
+ dns.rrset.from_text('host1.secure.example.', 15, dns.rdataclass.IN, 'AAAA', '1234::c000:202')
+ ]
+ query = dns.message.make_query('mx1.secure.example', 'AAAA')
+
+ for method in ("sendUDPQuery", "sendTCPQuery"):
+ sender = getattr(self, method)
+ res = sender(query)
+ print(res)
+ self.assertRcodeEqual(res, dns.rcode.NOERROR)
+ self.assertEqual(len(res.answer), 3)
+ self.assertEqual(len(res.authority), 0)
+ self.assertResponseMatches(query, expected, res)
+
class LuaPostResolveFFITest(RecursorTest):
"""Tests postresolve_ffi interface"""