From: Otto Moerbeek Date: Tue, 8 Jul 2025 10:03:00 +0000 (+0200) Subject: Add test X-Git-Tag: rec-5.3.0-alpha2~2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3733ca44c1f8a6fb8ac356b21ad5101cb3dc6d70;p=thirdparty%2Fpdns.git Add test --- diff --git a/regression-tests.recursor-dnssec/test_Lua.py b/regression-tests.recursor-dnssec/test_Lua.py index 436a25f519..4079944907 100644 --- a/regression-tests.recursor-dnssec/test_Lua.py +++ b/regression-tests.recursor-dnssec/test_Lua.py @@ -317,11 +317,14 @@ quiet=no dq.rcode = -3 -- "kill" return true end + if dq.remoteaddr:equal(newCA("%s.23")) and dq.qname == newDN("preout.luahooks.example.") and dq.qtype == pdns.TXT then + dq.isTcp = true + end return false end - """ % (os.environ['PREFIX'], os.environ['PREFIX'], os.environ['PREFIX']) + """ % (os.environ['PREFIX'], os.environ['PREFIX'], os.environ['PREFIX'], os.environ['PREFIX']) @classmethod def startResponders(cls): @@ -414,6 +417,14 @@ quiet=no res = sender(query) self.assertRcodeEqual(res, dns.rcode.NOERROR) + def testPreOutInterceptedToTCPQuery(self): + query = dns.message.make_query('preout.luahooks.example.', 'TXT', 'IN') + + for method in ("sendUDPQuery", "sendTCPQuery"): + sender = getattr(self, method) + res = sender(query) + self.assertRcodeEqual(res, dns.rcode.SERVFAIL) # crude, responder does not do TCP + class LuaHooksRecursorDistributesTest(LuaHooksRecursorTest): _confdir = 'LuaHooksRecursorDistributes' _config_template = """