mirror of https://github.com/fail2ban/fail2ban
BF: in 0.9 it is allowed to have multiple same actions with different names -- so use action_name
+ address RF action._ActionReader__cInfo -> action._initOptspull/272/head
parent
ea6f3bedb0
commit
9f9e9a33c6
|
@ -295,13 +295,13 @@ class JailsReaderTest(unittest.TestCase):
|
||||||
# Test for presence of blocktype (in relation to gh-232)
|
# Test for presence of blocktype (in relation to gh-232)
|
||||||
for action in actions:
|
for action in actions:
|
||||||
commands = action.convert()
|
commands = action.convert()
|
||||||
file_ = action.getFile()
|
action_name = action.getName()
|
||||||
if '<blocktype>' in str(commands):
|
if '<blocktype>' in str(commands):
|
||||||
# Verify that it is among cInfo
|
# Verify that it is among cInfo
|
||||||
self.assertTrue('blocktype' in action._ActionReader__cInfo)
|
self.assertTrue('blocktype' in action._initOpts)
|
||||||
# Verify that we have a call to set it up
|
# Verify that we have a call to set it up
|
||||||
blocktype_present = False
|
blocktype_present = False
|
||||||
target_command = [ 'set', jail_name, 'setcinfo', file_, 'blocktype' ]
|
target_command = [ 'set', jail_name, 'setcinfo', action_name, 'blocktype' ]
|
||||||
for command in commands:
|
for command in commands:
|
||||||
if (len(command) > 5 and
|
if (len(command) > 5 and
|
||||||
command[:5] == target_command):
|
command[:5] == target_command):
|
||||||
|
|
Loading…
Reference in New Issue