mirror of https://github.com/fail2ban/fail2ban
BF: overcome problem with failed *_movefile test if file gets properly closed
Discussion is in the comments on 7260403fdd
and fix consists of skipping first 3 lines while creating a "new" log file.
This should be sufficient to make fail2ban detect "log rotation" and thus
function properly
pull/694/head
parent
dfc7dd6dc9
commit
6eb67899a5
|
@ -559,7 +559,7 @@ def get_monitor_failures_testcase(Filter_):
|
|||
|
||||
# now create a new one to override old one
|
||||
_copy_lines_between_files(GetFailures.FILENAME_01, self.name + '.new',
|
||||
n=100).close()
|
||||
n=100, skip=3).close()
|
||||
os.rename(self.name + '.new', self.name)
|
||||
self.assert_correct_last_attempt(GetFailures.FAILURES_01)
|
||||
self.assertEqual(self.filter.failManager.getFailTotal(), 6)
|
||||
|
|
Loading…
Reference in New Issue