diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2018-08-06 11:17:25 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-08-08 10:51:59 +0100 |
commit | e77d45609a08d2c61964fbb092b1a21f11310f3b (patch) | |
tree | 2a9031a1334689a6fc67504874141a5e2ba74946 /meta/lib | |
parent | 24e9ed8beeb2a8070ace6eedde174944d05c9ad5 (diff) | |
download | poky-e77d45609a08d2c61964fbb092b1a21f11310f3b.tar.gz |
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]
...
(From OE-Core rev: b180fbd9d93db1c6351e183fbc08fc81cdc240c0)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/runtime/cases/oe_syslog.py | 8 |
1 files 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 935f10f0f3..a92a1f2bcb 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): | |||
10 | @OETestDepends(['ssh.SSHTest.test_ssh']) | 10 | @OETestDepends(['ssh.SSHTest.test_ssh']) |
11 | @OEHasPackage(["busybox-syslog", "sysklogd", "rsyslog", "syslog-ng"]) | 11 | @OEHasPackage(["busybox-syslog", "sysklogd", "rsyslog", "syslog-ng"]) |
12 | def test_syslog_running(self): | 12 | def test_syslog_running(self): |
13 | cmd = '%s | grep -i [s]yslogd' % self.tc.target_cmds['ps'] | 13 | status, output = self.target.run(self.tc.target_cmds['ps']) |
14 | status, output = self.target.run(cmd) | 14 | msg = "Failed to execute %s" % self.tc.target_cmds['ps'] |
15 | msg = "No syslogd process; ps output: %s" % output | ||
16 | self.assertEqual(status, 0, msg=msg) | 15 | self.assertEqual(status, 0, msg=msg) |
16 | msg = "No syslog daemon process; %s output:\n%s" % (self.tc.target_cmds['ps'], output) | ||
17 | hasdaemon = "syslogd" in output or "syslog-ng" in output | ||
18 | self.assertTrue(hasdaemon, msg=msg) | ||
17 | 19 | ||
18 | class SyslogTestConfig(OERuntimeTestCase): | 20 | class SyslogTestConfig(OERuntimeTestCase): |
19 | 21 | ||