From: Otto Moerbeek Date: Fri, 12 Aug 2022 08:28:37 +0000 (+0200) Subject: Transform a AAAA NoData result into a FormErr in Lua and see if dns64 is still applied X-Git-Tag: rec-4.8.0-alpha1~53^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=503c2e3fd08fce42ed6cadb30ff6c12efddc702a;p=thirdparty%2Fpdns.git Transform a AAAA NoData result into a FormErr in Lua and see if dns64 is still applied --- diff --git a/regression-tests.recursor-dnssec/test_DNS64.py b/regression-tests.recursor-dnssec/test_DNS64.py index 4fb601cb55..281be08d98 100644 --- a/regression-tests.recursor-dnssec/test_DNS64.py +++ b/regression-tests.recursor-dnssec/test_DNS64.py @@ -19,6 +19,16 @@ class DNS64RecursorTest(RecursorTest): dns64-prefix=64:ff9b::/96 """ % (_confdir, _confdir, _confdir) + _lua_dns_script_file = """ + function nodata(dq) + if dq.qtype == pdns.AAAA and dq.qname:equal("formerr.example.dns64") then + dq.rcode = pdns.FORMERR + return true + end + return false + end + """ + @classmethod def generateRecursorConfig(cls, confdir): authzonepath = os.path.join(confdir, 'example.dns64.zone') @@ -30,6 +40,7 @@ www 3600 IN TXT "does exist" aaaa 3600 IN AAAA 2001:db8::1 cname 3600 IN CNAME cname2.example.dns64. cname2 3600 IN CNAME www.example.dns64. +formerr 3600 IN A 192.0.2.43 """.format(soa=cls._SOA)) authzonepath = os.path.join(confdir, 'in-addr.arpa.zone') @@ -123,6 +134,18 @@ cname2 3600 IN CNAME www.example.dns64. 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') + + 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.NOERROR) + self.assertRRsetInAnswer(res, expected) + # there is a TXT record, we should get it def testExistingTXT(self): qname = 'www.example.dns64.'