From aede4829bb8145826b4059a9d07cdcfa347cb1f6 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Wed, 5 Mar 2025 08:20:56 +0100 Subject: [PATCH] Simple test for lua-records-exec-limit --- regression-tests.auth-py/test_LuaRecords.py | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/regression-tests.auth-py/test_LuaRecords.py b/regression-tests.auth-py/test_LuaRecords.py index 4da6b86f54..0f0292c99f 100644 --- a/regression-tests.auth-py/test_LuaRecords.py +++ b/regression-tests.auth-py/test_LuaRecords.py @@ -1345,6 +1345,30 @@ lua-health-checks-interval=5 self.assertAnyRRsetInAnswer(res, reachable_rrs) self.assertNoneRRsetInAnswer(res, unreachable_rrs) +class TestLuaRecordsExecLimit(BaseLuaTest): + # This configuration is similar to BaseLuaTest, but the exec limit is + # set to a very low value. + _config_template = """ +geoip-database-files=../modules/geoipbackend/regression-tests/GeoLiteCity.mmdb +edns-subnet-processing=yes +launch=bind geoip +any-to-tcp=no +enable-lua-records +lua-records-insert-whitespace=yes +lua-records-exec-limit=1 +""" + + def testA(self): + """ + Test A query against `any`, failing due to exec-limit + """ + name = 'any.example.org.' + + query = dns.message.make_query(name, 'A') + + res = self.sendUDPQuery(query) + self.assertRcodeEqual(res, dns.rcode.SERVFAIL) + if __name__ == '__main__': unittest.main() exit(0) -- 2.47.2