* [PATCH V2 0/1] oe_syslog.py: fix for syslog-ng
@ 2018-08-06 3:17 Chen Qi
2018-08-06 3:17 ` [PATCH 1/1] " Chen Qi
0 siblings, 1 reply; 2+ messages in thread
From: Chen Qi @ 2018-08-06 3:17 UTC (permalink / raw)
To: openembedded-core
Changes in V2:
* Run 'ps' only once, get rid of grep command and use python to check the existence of syslog daemon.
The following changes since commit da24071e92071ecbefe51314d82bf40f85172485:
bitbake: toaster/orm/management/commands/lsupdates.py: Use new layerindexlib module (2018-08-02 10:18:27 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib ChenQi/oe_syslog
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/oe_syslog
Chen Qi (1):
oe_syslog.py: fix for syslog-ng
meta/lib/oeqa/runtime/cases/oe_syslog.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 1/1] oe_syslog.py: fix for syslog-ng
2018-08-06 3:17 [PATCH V2 0/1] oe_syslog.py: fix for syslog-ng Chen Qi
@ 2018-08-06 3:17 ` Chen Qi
0 siblings, 0 replies; 2+ messages in thread
From: Chen Qi @ 2018-08-06 3:17 UTC (permalink / raw)
To: openembedded-core
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@windriver.com>
---
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):
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-06 3:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-06 3:17 [PATCH V2 0/1] oe_syslog.py: fix for syslog-ng Chen Qi
2018-08-06 3:17 ` [PATCH 1/1] " Chen Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox