mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-07-11 18:13:05 +00:00
TST: Sample test cases now handle ignoreregex and add recidive samples
This commit is contained in:
parent
e7b7815de3
commit
b5ffbced37
2 changed files with 8 additions and 0 deletions
6
testcases/files/logs/recidive
Normal file
6
testcases/files/logs/recidive
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# failJSON: { "time": "2006-02-13T15:52:30", "match": true , "host": "1.2.3.4" }
|
||||
2006-02-13 15:52:30,388 fail2ban.actions: WARNING [sendmail] Ban 1.2.3.4
|
||||
# failJSON: { "match": false }
|
||||
2006-02-13 16:07:31,183 fail2ban.actions: WARNING [sendmail] Unban 1.2.3.4
|
||||
# failJSON: { "match": false }
|
||||
2006-02-13 15:52:30,388 fail2ban.actions: WARNING [recidive] Ban 1.2.3.4
|
||||
|
|
@ -65,6 +65,8 @@ def testSampleRegexsFactory(name):
|
|||
for opt in filterConf.convert():
|
||||
if opt[2] == "addfailregex":
|
||||
self.filter.addFailRegex(opt[3])
|
||||
elif opt[2] == "addignoreregex":
|
||||
self.filter.addIgnoreRegex(opt[3])
|
||||
|
||||
if not self.filter.getFailRegex():
|
||||
# No fail regexs set: likely just common file for includes.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue