[oe-commits] [openembedded-core] 14/20: oe_syslog.py: fix for syslog-ng

git at git.openembedded.org git at git.openembedded.org
Tue Aug 7 12:29:45 UTC 2018


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 405fc1f06e9f5e7a01ab12a042018eba3f56e842
Author: Chen Qi <Qi.Chen at windriver.com>
AuthorDate: Mon Aug 6 11:17:25 2018 +0800

    oe_syslog.py: fix for syslog-ng
    
    When using syslog-ng as the syslog provider, oe_syslog test case fails
    because it cannot find the syslog daemon. This is because it greps for
    'syslogd' but syslog-ng's daemon is 'syslog-ng'. So fix it to check both
    'syslogd' and 'syslog-ng'.
    
    Also, when the test case fails, what I get is:
    | AssertionError: 1 != 0 : No syslogd process; ps output:
    <empty here>
    
    This does not help user. The output is actually from the 'PS | GREP' command.
    And when the 'PS | GREP' command fails, the output is always empty. So also fix
    this problem. After the change, it looks like:
    | AssertionError: False is not true : No syslog daemon process; ps output:
    |   PID USER       VSZ STAT COMMAND
    |     1 root     16476 S    {systemd} /sbin/init
    |     2 root         0 SW   [kthreadd]
    |     3 root         0 IW   [kworker/0:0]
    ...
    
    Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oeqa/runtime/cases/oe_syslog.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/meta/lib/oeqa/runtime/cases/oe_syslog.py b/meta/lib/oeqa/runtime/cases/oe_syslog.py
index 935f10f..a92a1f2 100644
--- a/meta/lib/oeqa/runtime/cases/oe_syslog.py
+++ b/meta/lib/oeqa/runtime/cases/oe_syslog.py
@@ -10,10 +10,12 @@ class SyslogTest(OERuntimeTestCase):
     @OETestDepends(['ssh.SSHTest.test_ssh'])
     @OEHasPackage(["busybox-syslog", "sysklogd", "rsyslog", "syslog-ng"])
     def test_syslog_running(self):
-        cmd = '%s  | grep -i [s]yslogd' % self.tc.target_cmds['ps']
-        status, output = self.target.run(cmd)
-        msg = "No syslogd process; ps output: %s" % output
+        status, output = self.target.run(self.tc.target_cmds['ps'])
+        msg = "Failed to execute %s" % self.tc.target_cmds['ps']
         self.assertEqual(status, 0, msg=msg)
+        msg = "No syslog daemon process; %s output:\n%s" % (self.tc.target_cmds['ps'], output)
+        hasdaemon = "syslogd" in output or "syslog-ng" in output
+        self.assertTrue(hasdaemon, msg=msg)
 
 class SyslogTestConfig(OERuntimeTestCase):
 

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


More information about the Openembedded-commits mailing list