From a5e77c72b573a20b1beba31b4f33e747162ab7b9 Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Tue, 8 Jun 2021 17:48:12 -0400 Subject: [PATCH] tests: improve detection of readable systemd journal Look for system.journal in journal sub-directory. Add -readable to the find command. Bug: https://bugs.gentoo.org/794931 --- fail2ban/tests/filtertestcase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fail2ban/tests/filtertestcase.py b/fail2ban/tests/filtertestcase.py index 3cc17fb177..01a1b7d91b 100644 --- a/fail2ban/tests/filtertestcase.py +++ b/fail2ban/tests/filtertestcase.py @@ -1352,7 +1352,7 @@ def _getRuntimeJournal(self): # check one at at time until the first hit for systemd_var in 'system-runtime-logs', 'system-state-logs': tmp = Utils.executeCmd( - 'find "$(systemd-path %s)" -name system.journal' % systemd_var, + 'find "$(systemd-path %s)/journal" -name system.journal -readable' % systemd_var, timeout=10, shell=True, output=True ) self.assertTrue(tmp)