simple syntax change (wrong escape in string): no functional changes

pull/2048/head
sebres 2018-02-01 18:04:04 +01:00
parent 3a1c386958
commit 2c03f5ad28
2 changed files with 3 additions and 3 deletions

View File

@ -448,9 +448,9 @@ class FilterReaderTest(unittest.TestCase):
self.assertSortedEqual(c, output) self.assertSortedEqual(c, output)
def testFilterReaderSubstitionSection(self): 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( 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, filterReader = FilterReader('substition', "jailname", filterOpt,
share_config=TEST_FILES_DIR_SHARE_CFG, basedir=TEST_FILES_DIR) share_config=TEST_FILES_DIR_SHARE_CFG, basedir=TEST_FILES_DIR)
filterReader.read() filterReader.read()

View File

@ -292,7 +292,7 @@ class Fail2banRegexTest(LogCaptureTestCase):
def testRegexEpochPatterns(self): def testRegexEpochPatterns(self):
(opts, args, fail2banRegex) = _Fail2banRegex( (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" "[1516469849] 192.0.2.1 FAIL: failure\n"
"[1516469849551] 192.0.2.2 FAIL: failure\n" "[1516469849551] 192.0.2.2 FAIL: failure\n"
"[1516469849551000] 192.0.2.3 FAIL: failure\n" "[1516469849551000] 192.0.2.3 FAIL: failure\n"