From 9f26da3cf854e48b7939c2a9baa0cb3ffbee5994 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Thu, 11 Sep 2025 22:36:07 +0800 Subject: [PATCH] clientreadertestcase.py: set correct config dir for testReadStockJailFilterComplete In test case testReadStockJailFilterComplete, set configuration directory to CONFIG_DIR (/etc/fail2ban/filter.d on the target) instead of the hardcoded "config" directory. Otherwise, the config files will not be found during runtime testing. Signed-off-by: Yi Zhao --- fail2ban/tests/clientreadertestcase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fail2ban/tests/clientreadertestcase.py b/fail2ban/tests/clientreadertestcase.py index e6a2806c..b8ebbbc7 100644 --- a/fail2ban/tests/clientreadertestcase.py +++ b/fail2ban/tests/clientreadertestcase.py @@ -878,7 +878,7 @@ class JailsReaderTest(LogCaptureTestCase): self.assertTrue(jails.getOptions()) # reads fine # grab all filter names filters = set(os.path.splitext(os.path.split(a)[1])[0] - for a in glob.glob(os.path.join('config', 'filter.d', '*.conf')) + for a in glob.glob(os.path.join(CONFIG_DIR, 'filter.d', '*.conf')) if not (a.endswith('common.conf') or a.endswith('-aggressive.conf'))) # get filters of all jails (filter names without options inside filter[...]) filters_jail = set(