mirror of https://github.com/fail2ban/fail2ban
simple syntax change (wrong escape in string): no functional changes
parent
3a1c386958
commit
2c03f5ad28
|
@ -448,9 +448,9 @@ class FilterReaderTest(unittest.TestCase):
|
|||
self.assertSortedEqual(c, output)
|
||||
|
||||
def testFilterReaderSubstitionSection(self):
|
||||
output = [['set', 'jailname', 'addfailregex', '^\s*to=fail2ban@localhost fromip=<IP>\s*$']]
|
||||
output = [['set', 'jailname', 'addfailregex', '^\\s*to=fail2ban@localhost fromip=<IP>\\s*$']]
|
||||
filterName, filterOpt = extractOptions(
|
||||
'substition[failregex="^\s*<Definition/failregex>\s*$", honeypot="<default/honeypot>"]')
|
||||
'substition[failregex="^\\s*<Definition/failregex>\\s*$", honeypot="<default/honeypot>"]')
|
||||
filterReader = FilterReader('substition', "jailname", filterOpt,
|
||||
share_config=TEST_FILES_DIR_SHARE_CFG, basedir=TEST_FILES_DIR)
|
||||
filterReader.read()
|
||||
|
|
|
@ -292,7 +292,7 @@ class Fail2banRegexTest(LogCaptureTestCase):
|
|||
|
||||
def testRegexEpochPatterns(self):
|
||||
(opts, args, fail2banRegex) = _Fail2banRegex(
|
||||
"-r", "-d", "^\[{LEPOCH}\]\s+", "--maxlines", "5",
|
||||
"-r", "-d", r"^\[{LEPOCH}\]\s+", "--maxlines", "5",
|
||||
"[1516469849] 192.0.2.1 FAIL: failure\n"
|
||||
"[1516469849551] 192.0.2.2 FAIL: failure\n"
|
||||
"[1516469849551000] 192.0.2.3 FAIL: failure\n"
|
||||
|
|
Loading…
Reference in New Issue