From 0df70dbdf9368b71a1e9c852c59528f5c47b046f Mon Sep 17 00:00:00 2001 From: Daniel Salzman Date: Sun, 28 Jul 2024 20:36:18 +0200 Subject: tests-extra: enable logging in module/rrl --- tests-extra/tests/modules/rrl/test.py | 3 ++- tests-extra/tools/dnstest/module.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests-extra/tests/modules/rrl/test.py b/tests-extra/tests/modules/rrl/test.py index e33b1ac70..9321b278d 100644 --- a/tests-extra/tests/modules/rrl/test.py +++ b/tests-extra/tests/modules/rrl/test.py @@ -125,7 +125,8 @@ def reconfigure(server, zone, limit, slip, whitelist=None): """ server.clear_modules(None) server.clear_modules(zone) - server.add_module(zone, ModRRL(rate_limit=limit, instant_limit=limit, slip=slip, whitelist=whitelist)) + server.add_module(zone, ModRRL(rate_limit=limit, instant_limit=limit, slip=slip, + whitelist=whitelist, log_period=1500)) server.gen_confile() server.reload() diff --git a/tests-extra/tools/dnstest/module.py b/tests-extra/tools/dnstest/module.py index 8bd8194b9..4f900721d 100644 --- a/tests-extra/tools/dnstest/module.py +++ b/tests-extra/tools/dnstest/module.py @@ -117,13 +117,15 @@ class ModRRL(KnotModule): mod_name = "rrl" - def __init__(self, rate_limit, slip=None, table_size=None, whitelist=None, instant_limit=None): + def __init__(self, rate_limit, slip=None, table_size=None, whitelist=None, + instant_limit=None, log_period=0): super().__init__() self.rate_limit = rate_limit self.instant_limit = instant_limit if instant_limit else rate_limit self.slip = slip self.table_size = table_size self.whitelist = whitelist + self.log_period = log_period def get_conf(self, conf=None): if not conf: @@ -139,6 +141,8 @@ class ModRRL(KnotModule): conf.item_str("table-size", self.table_size) if self.whitelist: conf.item_str("whitelist", self.whitelist) + if self.log_period > 0: + conf.item_str("log-period", self.log_period) conf.end() return conf -- cgit v1.2.3