mirror of https://github.com/fail2ban/fail2ban
test cases extended (now correct)
parent
cad09d2df3
commit
1439152121
|
@ -14,8 +14,8 @@ ver. 0.9.2 (2014/XX/XXX) - wanna-be-released
|
||||||
* $ typo in jail.conf. Thanks Skibbi. Debian bug #767255
|
* $ typo in jail.conf. Thanks Skibbi. Debian bug #767255
|
||||||
* grep'ing for IP in *mail-whois-lines.conf should now match also
|
* grep'ing for IP in *mail-whois-lines.conf should now match also
|
||||||
at the begginning and EOL. Thanks Dean Lee
|
at the begginning and EOL. Thanks Dean Lee
|
||||||
* failregex declared in jail was joined to single line (specifying of multiple
|
* failregex declared direct in jail was joined to single line (specifying of
|
||||||
expressions was not possible).
|
multiple expressions was not possible).
|
||||||
|
|
||||||
|
|
||||||
- New Features:
|
- New Features:
|
||||||
|
|
|
@ -50,6 +50,8 @@ class FilterReader(DefinitionInitConfigReader):
|
||||||
def convert(self):
|
def convert(self):
|
||||||
stream = list()
|
stream = list()
|
||||||
combinedopts = dict(list(self._opts.items()) + list(self._initOpts.items()))
|
combinedopts = dict(list(self._opts.items()) + list(self._initOpts.items()))
|
||||||
|
if not len(combinedopts):
|
||||||
|
return stream;
|
||||||
opts = CommandAction.substituteRecursiveTags(combinedopts)
|
opts = CommandAction.substituteRecursiveTags(combinedopts)
|
||||||
if not opts:
|
if not opts:
|
||||||
raise ValueError('recursive tag definitions unable to be resolved')
|
raise ValueError('recursive tag definitions unable to be resolved')
|
||||||
|
|
|
@ -425,6 +425,17 @@ class JailsReaderTest(LogCaptureTestCase):
|
||||||
self.maxDiff = None
|
self.maxDiff = None
|
||||||
self.assertEqual(sorted(comm_commands),
|
self.assertEqual(sorted(comm_commands),
|
||||||
sorted([['add', 'emptyaction', 'auto'],
|
sorted([['add', 'emptyaction', 'auto'],
|
||||||
|
['add', 'test1addfailregex', 'auto'],
|
||||||
|
['set', 'test1addfailregex', 'addfailregex', 'failure 1 <HOST>'],
|
||||||
|
['set', 'test1addfailregex', 'addfailregex', 'failure 2 <HOST>'],
|
||||||
|
['set', 'test1addfailregex', 'addignoreregex', 'ignore 1 <HOST>'],
|
||||||
|
['set', 'test1addfailregex', 'addignoreregex', 'ignore 2 <HOST>'],
|
||||||
|
['set', 'test1addfailregex', 'addfailregex', '<IP>'],
|
||||||
|
['start', 'test1addfailregex'],
|
||||||
|
['add', 'test2failregex', 'auto'],
|
||||||
|
['set', 'test2failregex', 'addfailregex', 'failure 1 <IP>'],
|
||||||
|
['set', 'test2failregex', 'addfailregex', 'failure 2 <IP>'],
|
||||||
|
['start', 'test2failregex'],
|
||||||
['add', 'missinglogfiles', 'auto'],
|
['add', 'missinglogfiles', 'auto'],
|
||||||
['set', 'missinglogfiles', 'addfailregex', '<IP>'],
|
['set', 'missinglogfiles', 'addfailregex', '<IP>'],
|
||||||
['add', 'brokenaction', 'auto'],
|
['add', 'brokenaction', 'auto'],
|
||||||
|
|
|
@ -13,6 +13,20 @@ failregex = <IP>
|
||||||
ignoreregex =
|
ignoreregex =
|
||||||
ignoreip =
|
ignoreip =
|
||||||
|
|
||||||
|
[test1addfailregex]
|
||||||
|
enabled = true
|
||||||
|
filter = simple
|
||||||
|
addfailregex = failure 1 <HOST>
|
||||||
|
failure 2 <HOST>
|
||||||
|
addignoreregex = ignore 1 <HOST>
|
||||||
|
ignore 2 <HOST>
|
||||||
|
|
||||||
|
[test2failregex]
|
||||||
|
enabled = true
|
||||||
|
filter = simple
|
||||||
|
failregex = failure 1 <IP>
|
||||||
|
failure 2 <IP>
|
||||||
|
|
||||||
[missinglogfiles]
|
[missinglogfiles]
|
||||||
enabled = true
|
enabled = true
|
||||||
logpath = /weapons/of/mass/destruction
|
logpath = /weapons/of/mass/destruction
|
||||||
|
|
Loading…
Reference in New Issue