increase coverage (if python-systemd not available, so some tests may be skipped)

pull/1646/head^2
sebres 2019-04-26 13:29:19 +02:00
parent cd32f4a132
commit 3d80e881c5
1 changed files with 12 additions and 0 deletions

View File

@ -218,6 +218,18 @@ class Fail2banRegexTest(LogCaptureTestCase):
# test failure line and not-failure lines both presents:
self.assertLogged("[29116]: User root not allowed because account is locked",
"[29116]: Received disconnect from 1.2.3.4", all=True)
self.pruneLog()
# show real options:
(opts, args, fail2banRegex) = _Fail2banRegex(
"-l", "notice", # put down log-level, because of too many debug-messages
"-vv", "-c", CONFIG_DIR,
"Dec 31 11:59:59 [sshd] error: PAM: Authentication failure for kevin from 192.0.2.1",
"sshd[logtype=short]"
)
self.assertTrue(fail2banRegex.start(args))
# tet logtype is specified and set in real options:
self.assertLogged("Real filter options :", "'logtype': 'short'", all=True)
self.assertNotLogged("'logtype': 'file'", "'logtype': 'journal'", all=True)
def testFastSshd(self):
(opts, args, fail2banRegex) = _Fail2banRegex(