diff options
author | Anuj Mittal <anuj.mittal@intel.com> | 2019-06-19 11:13:26 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-06-19 22:13:39 +0100 |
commit | 4782ccbbde1ca859e7aa9f8699bd903e9582b585 (patch) | |
tree | aa09ce988732b96a26e17597c83fb41786c5a808 /meta/lib | |
parent | 63371ee4ecf1b2f873047a09a1e1264b288eab8b (diff) | |
download | poky-4782ccbbde1ca859e7aa9f8699bd903e9582b585.tar.gz |
runtime/cases/logrotate: make test more reliable
By default logrotate uses 'dateext' in logrotate.conf which results in a
date string being appended at the end of log name. In cases when a test
that installs configuration in logrotate.d is executed first (dnf for
example), it might result in errors when logrotate test is executed:
error: destination /var/log/dnf.librepo.log-20190528 already exists, skipping rotation
error: destination /var/log/dnf.rpm.log-20190528 already exists, skipping rotation
error: destination /var/log/hawkey.log-20190528 already exists, skipping rotation
Tweak the test to use it's own temporary configuration that doesn't
enable dateext.
Fixes [YOCTO #13363]
(From OE-Core rev: d0a30c1c57edc9a724658e2ed312b34eed3af5a9)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/runtime/cases/logrotate.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/lib/oeqa/runtime/cases/logrotate.py b/meta/lib/oeqa/runtime/cases/logrotate.py index 8358793a24..bfa57c534a 100644 --- a/meta/lib/oeqa/runtime/cases/logrotate.py +++ b/meta/lib/oeqa/runtime/cases/logrotate.py | |||
@@ -35,7 +35,9 @@ class LogrotateTest(OERuntimeTestCase): | |||
35 | 35 | ||
36 | @OETestDepends(['logrotate.LogrotateTest.test_1_logrotate_setup']) | 36 | @OETestDepends(['logrotate.LogrotateTest.test_1_logrotate_setup']) |
37 | def test_2_logrotate(self): | 37 | def test_2_logrotate(self): |
38 | status, output = self.target.run('logrotate -f /etc/logrotate.conf') | 38 | status, output = self.target.run('echo "create \n include /etc/logrotate.d" > /tmp/logrotate-test.conf') |
39 | status, output = self.target.run('logrotate -f /tmp/logrotate-test.conf') | ||
40 | |||
39 | msg = ('logrotate service could not be reloaded. Status and output: ' | 41 | msg = ('logrotate service could not be reloaded. Status and output: ' |
40 | '%s and %s' % (status, output)) | 42 | '%s and %s' % (status, output)) |
41 | self.assertEqual(status, 0, msg = msg) | 43 | self.assertEqual(status, 0, msg = msg) |