From 6eb67899a52414b71305ef7d751dfbd9faee64fa Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 16 Apr 2014 08:43:54 -0400 Subject: [PATCH] BF: overcome problem with failed *_movefile test if file gets properly closed Discussion is in the comments on 7260403fdd41b74335a0a71579df3df5cae6c6ba 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 --- testcases/filtertestcase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testcases/filtertestcase.py b/testcases/filtertestcase.py index e5e5f4f8..58162201 100644 --- a/testcases/filtertestcase.py +++ b/testcases/filtertestcase.py @@ -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)