From: Miod Vallat Date: Wed, 5 Mar 2025 07:20:56 +0000 (+0100) Subject: Simple test for lua-records-exec-limit X-Git-Tag: dnsdist-2.0.0-alpha1~43^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F15235%2Fhead;p=thirdparty%2Fpdns.git Simple test for lua-records-exec-limit --- 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)