[oe-commits] [openembedded-core] 01/24: runtime/cases/logrotate: make test more reliable

git at git.openembedded.org git at git.openembedded.org
Wed Jun 19 12:16:21 UTC 2019

This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit d0a30c1c57edc9a724658e2ed312b34eed3af5a9
Author: Anuj Mittal <anuj.mittal at intel.com>
AuthorDate: Wed Jun 19 11:13:26 2019 +0800

    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]
    Signed-off-by: Anuj Mittal <anuj.mittal at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
 meta/lib/oeqa/runtime/cases/logrotate.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/runtime/cases/logrotate.py b/meta/lib/oeqa/runtime/cases/logrotate.py
index 8358793..bfa57c5 100644
--- a/meta/lib/oeqa/runtime/cases/logrotate.py
+++ b/meta/lib/oeqa/runtime/cases/logrotate.py
@@ -35,7 +35,9 @@ class LogrotateTest(OERuntimeTestCase):
     def test_2_logrotate(self):
-        status, output = self.target.run('logrotate -f /etc/logrotate.conf')
+        status, output = self.target.run('echo "create \n include /etc/logrotate.d" > /tmp/logrotate-test.conf')
+        status, output = self.target.run('logrotate -f /tmp/logrotate-test.conf')
         msg = ('logrotate service could not be reloaded. Status and output: '
                 '%s and %s' % (status, output))
         self.assertEqual(status, 0, msg = msg)

To stop receiving notification emails like this one, please contact
the administrator of this repository.

More information about the Openembedded-commits mailing list