1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
Upstream: no
Reason: several tests segfault on s390x, so we skip them for now
Url: https://github.com/fail2ban/fail2ban/issues/2708
diff --git a/fail2ban/tests/databasetestcase.py b/fail2ban/tests/databasetestcase.py
index 95bd9f9..cc89a37 100644
--- a/fail2ban/tests/databasetestcase.py
+++ b/fail2ban/tests/databasetestcase.py
@@ -43,6 +43,7 @@ from .utils import LogCaptureTestCase, logSys as DefLogSys
TEST_FILES_DIR = os.path.join(os.path.dirname(__file__), "files")
+import platform
# because of tests performance use memory instead of file:
def getFail2BanDb(filename):
@@ -272,6 +273,7 @@ class DatabaseTest(LogCaptureTestCase):
self.assertTrue(
isinstance(tickets[0], FailTicket))
+ @unittest.skipIf(platform.machine() == 's390x', 'segfault')
def testAddBanInvalidEncoded(self):
self.testAddJail()
# invalid + valid, invalid + valid unicode, invalid + valid dual converted (like in filter:readline by fallback) ...
@@ -425,6 +427,7 @@ class DatabaseTest(LogCaptureTestCase):
self.assertEqual(ticket.getAttempt(), len(failures))
self.assertEqual(len(ticket.getMatches()), 0)
+ @unittest.skipIf(platform.machine() == 's390x', 'segfault')
def testGetBansMerged(self):
self.testAddJail()
diff --git a/fail2ban/tests/fail2banclienttestcase.py b/fail2ban/tests/fail2banclienttestcase.py
index 7ebda8c..67e38c8 100644
--- a/fail2ban/tests/fail2banclienttestcase.py
+++ b/fail2ban/tests/fail2banclienttestcase.py
@@ -47,6 +47,7 @@ from .utils import LogCaptureTestCase, logSys as DefLogSys, with_tmpdir, shutil,
STOCK, CONFIG_DIR as STOCK_CONF_DIR, TEST_NOW, tearDownMyTime
from ..helpers import getLogger
+import platform
# Gets the instance of the logger.
logSys = getLogger(__name__)
@@ -819,6 +820,7 @@ class Fail2banServerTest(Fail2banClientServerBase):
self.assertTrue(_kill_srv(tmp))
self.assertLogged("cleanup: no pidfile for")
+ @unittest.skipIf(platform.machine() == 's390x', 'segfault')
@with_foreground_server_thread(startextra={'db': 'auto'})
def testServerReloadTest(self, tmp, startparams):
# Very complicated test-case, that expected running server (foreground in thread).
@@ -1379,6 +1381,8 @@ class Fail2banServerTest(Fail2banClientServerBase):
'enabled = true',
)
})
+
+ @unittest.skipIf(platform.machine() == 's390x', 'segfault')
def testServerJails_Sendmail(self, tmp, startparams):
cfg = pjoin(tmp, "config")
lgfn = '%(tmp)s/test.log' % {'tmp': tmp}
diff --git a/fail2ban/tests/observertestcase.py b/fail2ban/tests/observertestcase.py
index ed52028..29afe59 100644
--- a/fail2ban/tests/observertestcase.py
+++ b/fail2ban/tests/observertestcase.py
@@ -41,6 +41,7 @@ from .dummyjail import DummyJail
from .databasetestcase import getFail2BanDb, Fail2BanDb
+import platform
class BanTimeIncr(LogCaptureTestCase):
@@ -214,7 +215,7 @@ class BanTimeIncrDB(LogCaptureTestCase):
#print("!!!!!!!!! banTime: %s, %s, incr: %s " % (banTime, ticket.getBanCount(), incrTime))
return incrTime
-
+ @unittest.skipIf(platform.machine() == 's390x', 'segfault')
def testBanTimeIncr(self):
if Fail2BanDb is None: # pragma: no cover
return
|