diff options
author | Daniel Salzman <daniel.salzman@nic.cz> | 2024-07-28 20:36:18 +0200 |
---|---|---|
committer | Daniel Salzman <daniel.salzman@nic.cz> | 2024-08-11 21:19:40 +0200 |
commit | 0df70dbdf9368b71a1e9c852c59528f5c47b046f (patch) | |
tree | d1b8b785f210ba9843d632b054fe7a8c7ff2e39b | |
parent | knot: fixing some undefined-behaviour errors (diff) | |
download | knot-0df70dbdf9368b71a1e9c852c59528f5c47b046f.tar.xz knot-0df70dbdf9368b71a1e9c852c59528f5c47b046f.zip |
tests-extra: enable logging in module/rrl
-rw-r--r-- | tests-extra/tests/modules/rrl/test.py | 3 | ||||
-rw-r--r-- | 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 |