mirror of https://github.com/fail2ban/fail2ban
TST: test case for actions and filters missing in a jail
parent
1407b955e6
commit
e916fcdce4
|
@ -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 New Issue