mirror of https://github.com/fail2ban/fail2ban
extended test-cases (coverage)
parent
449c46aec4
commit
5e4fdb60c8
|
@ -211,7 +211,7 @@ class Fail2BanDb(object):
|
||||||
if newversion == Fail2BanDb.__version__:
|
if newversion == Fail2BanDb.__version__:
|
||||||
logSys.warning( "Database updated from '%i' to '%i'",
|
logSys.warning( "Database updated from '%i' to '%i'",
|
||||||
version, newversion)
|
version, newversion)
|
||||||
else:
|
else: # pragma: no cover
|
||||||
logSys.error( "Database update failed to achieve version '%i'"
|
logSys.error( "Database update failed to achieve version '%i'"
|
||||||
": updated from '%i' to '%i'",
|
": updated from '%i' to '%i'",
|
||||||
Fail2BanDb.__version__, version, newversion)
|
Fail2BanDb.__version__, version, newversion)
|
||||||
|
|
|
@ -353,6 +353,11 @@ class DatabaseTest(LogCaptureTestCase):
|
||||||
# be returned
|
# be returned
|
||||||
tickets = self.db.getBansMerged(bantime=-1)
|
tickets = self.db.getBansMerged(bantime=-1)
|
||||||
self.assertEqual(len(tickets), 2)
|
self.assertEqual(len(tickets), 2)
|
||||||
|
# getCurrentBans:
|
||||||
|
tickets = self.db.getCurrentBans(jail=self.jail)
|
||||||
|
self.assertEqual(len(tickets), 2)
|
||||||
|
ticket = self.db.getCurrentBans(jail=None, ip="127.0.0.1");
|
||||||
|
self.assertEqual(ticket.getIP(), "127.0.0.1")
|
||||||
|
|
||||||
def testActionWithDB(self):
|
def testActionWithDB(self):
|
||||||
# test action together with database functionality
|
# test action together with database functionality
|
||||||
|
|
Loading…
Reference in New Issue