mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-03-11 08:55:31 +00:00
TST: test case for actions and filters missing in a jail
This commit is contained in:
parent
1407b955e6
commit
e916fcdce4
2 changed files with 11 additions and 2 deletions
|
|
@ -117,6 +117,15 @@ class JailReaderTest(LogCaptureTestCase):
|
|||
self.assertTrue(self._is_logged('No filter set for jail emptyaction'))
|
||||
self.assertTrue(self._is_logged('No actions were defined for emptyaction'))
|
||||
|
||||
def testJailActionFilterMissing(self):
|
||||
jail = JailReader('missingbitsjail', basedir=os.path.join('testcases','config'))
|
||||
self.assertTrue(jail.read())
|
||||
self.assertFalse(jail.getOptions())
|
||||
self.assertTrue(jail.isEnabled())
|
||||
#print self._log.getvalue()
|
||||
self.assertTrue(self._is_logged("Found no accessible config files for 'filter.d/catchallthebadies' under testcases/config"))
|
||||
self.assertTrue(self._is_logged('Unable to read the filter'))
|
||||
|
||||
def testJailActionBrokenDef(self):
|
||||
jail = JailReader('brokenactiondef', basedir=os.path.join('testcases','config'))
|
||||
self.assertTrue(jail.read())
|
||||
|
|
|
|||
|
|
@ -15,6 +15,6 @@ action = joho[foo
|
|||
enabled = true
|
||||
action = brokenaction
|
||||
|
||||
[missingaction]
|
||||
enabled = true
|
||||
[missingbitsjail]
|
||||
filter = catchallthebadies
|
||||
action = thefunkychickendance
|
||||
|
|
|
|||
Loading…
Reference in a new issue