commit
685dee2d09
@ -1,50 +0,0 @@
|
|||||||
From 3187de29336b4a01e4dcd20f98253e1db913ee7a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Yaroslav Halchenko <debian@onerussian.com>
|
|
||||||
Date: Sat, 12 Sep 2015 14:15:10 -0400
|
|
||||||
Subject: [PATCH] BF(TST): allow exception and False for executeCmd due to
|
|
||||||
inconsistent behavior across bash/dash
|
|
||||||
|
|
||||||
Temporary minimalistic fix to the test
|
|
||||||
---
|
|
||||||
fail2ban/tests/actiontestcase.py | 23 +++++++++++++++++------
|
|
||||||
1 file changed, 17 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/fail2ban/tests/actiontestcase.py b/fail2ban/tests/actiontestcase.py
|
|
||||||
index febbc61..73dee12 100644
|
|
||||||
--- a/fail2ban/tests/actiontestcase.py
|
|
||||||
+++ b/fail2ban/tests/actiontestcase.py
|
|
||||||
@@ -222,17 +222,28 @@ def getnastypid():
|
|
||||||
return int(f.read())
|
|
||||||
|
|
||||||
# First test if can kill the bastard
|
|
||||||
- self.assertRaises(
|
|
||||||
- RuntimeError, CommandAction.executeCmd, 'bash %s' % tmpFilename, timeout=.1)
|
|
||||||
+ try:
|
|
||||||
+ self.assertFalse(
|
|
||||||
+ CommandAction.executeCmd('bash %s' % tmpFilename, timeout=.1))
|
|
||||||
+ except RuntimeError:
|
|
||||||
+ # this one is expected behavior, see
|
|
||||||
+ # https://github.com/fail2ban/fail2ban/issues/1155#issuecomment-139799958
|
|
||||||
+ pass
|
|
||||||
# Verify that the proccess itself got killed
|
|
||||||
self.assertFalse(pid_exists(getnastypid())) # process should have been killed
|
|
||||||
self.assertTrue(self._is_logged('timed out'))
|
|
||||||
- self.assertTrue(self._is_logged('killed with SIGTERM'))
|
|
||||||
+ self.assertTrue(self._is_logged('Terminated'))
|
|
||||||
|
|
||||||
# A bit evolved case even though, previous test already tests killing children processes
|
|
||||||
- self.assertRaises(
|
|
||||||
- RuntimeError, CommandAction.executeCmd, 'out=`bash %s`; echo ALRIGHT' % tmpFilename,
|
|
||||||
- timeout=.2)
|
|
||||||
+ try:
|
|
||||||
+ self.assertFalse(
|
|
||||||
+ CommandAction.executeCmd('out=`bash %s`; echo ALRIGHT' % tmpFilename,
|
|
||||||
+ timeout=.2))
|
|
||||||
+ except RuntimeError:
|
|
||||||
+ # this one is expected behavior, see
|
|
||||||
+ # https://github.com/fail2ban/fail2ban/issues/1155#issuecomment-139799958
|
|
||||||
+ pass
|
|
||||||
+
|
|
||||||
# Verify that the proccess itself got killed
|
|
||||||
self.assertFalse(pid_exists(getnastypid()))
|
|
||||||
self.assertTrue(self._is_logged('timed out'))
|
|
@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/config/paths-fedora.conf b/config/paths-fedora.conf
|
||||||
|
index b3c978c..e91845a 100644
|
||||||
|
--- a/config/paths-fedora.conf
|
||||||
|
+++ b/config/paths-fedora.conf
|
||||||
|
@@ -34,7 +34,7 @@ apache_access_log = /var/log/httpd/*access_log
|
||||||
|
|
||||||
|
exim_main_log = /var/log/exim/main.log
|
||||||
|
|
||||||
|
-mysql_log = /var/lib/mysql/mysqld.log
|
||||||
|
+mysql_log = /var/log/mariadb/mariadb.log
|
||||||
|
|
||||||
|
roundcube_errors_log = /var/log/roundcubemail/errors
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
diff -up fail2ban-0.9.4/fail2ban/tests/clientreadertestcase.py.test fail2ban-0.9.4/fail2ban/tests/clientreadertestcase.py
|
||||||
|
--- fail2ban-0.9.4/fail2ban/tests/clientreadertestcase.py.test 2016-03-09 10:43:53.649645648 -0700
|
||||||
|
+++ fail2ban-0.9.4/fail2ban/tests/clientreadertestcase.py 2016-03-09 11:00:19.208546116 -0700
|
||||||
|
@@ -632,8 +632,6 @@ class JailsReaderTest(LogCaptureTestCase
|
||||||
|
|
||||||
|
# and we know even some of them by heart
|
||||||
|
for j in ['sshd', 'recidive']:
|
||||||
|
- # by default we have 'auto' backend ATM
|
||||||
|
- self.assertTrue(['add', j, 'auto'] in comm_commands)
|
||||||
|
# and warn on useDNS
|
||||||
|
self.assertTrue(['set', j, 'usedns', 'warn'] in comm_commands)
|
||||||
|
self.assertTrue(['start', j] in comm_commands)
|
Loading…
Reference in new issue