Commit 00586554 authored by Titouan Soulard's avatar Titouan Soulard

rapid-cdn: fix failing test

logrotate test for the rapid-cdn SR have been failing for quite some
time because of a squid.log file created (and henceforth rotated) on
any slave instance of the CDN:

```
Traceback (most recent call last):
    self.assertEqual(
AssertionError: Items in the second set but not the first:
'squid.log_10.0.160.212.20240306.23h57m09s-20240307.00h00m02s.old.xz'
```

Since we do not want to test this file in that specific test, this
commit instead loosely check the content of the rotated files
directory.
In other words, the test now checks for the presence of the two
files to be tested, but avoid failing if other files exist.

This goes in line with the two following lines of that same test,
loosely checking for file absence instead of an empty directory.

/cc @tomo @luke
/approved-by @luke
/reviewed-on !1541
parent de5e381d
Pipeline #33399 failed with stage
in 0 seconds
......@@ -2095,9 +2095,8 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin, AtsMixin):
self.assertEqual(0, result)
self.assertEqual(
set(['log-old.old.xz', 'log-older.old.xz']),
set(os.listdir(ats_logrotate_dir)))
self.assertTrue(old_file_name + '.xz' in os.listdir(ats_logrotate_dir))
self.assertTrue(older_file_name + '.xz' in os.listdir(ats_logrotate_dir))
self.assertFalse(old_file_name + '.xz' in os.listdir(ats_log_dir))
self.assertFalse(older_file_name + '.xz' in os.listdir(ats_log_dir))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment