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
Yaroslav Halchenko 2014-04-16 08:43:54 -04:00
parent dfc7dd6dc9
commit 6eb67899a5
1 changed files with 1 additions and 1 deletions

View File

@ -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)