TST: test case for actions and filters missing in a jail

pull/484/head
Daniel Black 2013-12-13 10:51:38 +00:00
parent 1407b955e6
commit e916fcdce4
2 changed files with 11 additions and 2 deletions

View File

@ -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())

View File

@ -15,6 +15,6 @@ action = joho[foo
enabled = true
action = brokenaction
[missingaction]
enabled = true
[missingbitsjail]
filter = catchallthebadies
action = thefunkychickendance