* [PATCH 0/1] oe_syslog.py: fix for syslog-ng @ 2018-08-03 8:27 Chen Qi 2018-08-03 8:27 ` [PATCH 1/1] " Chen Qi 0 siblings, 1 reply; 4+ messages in thread From: Chen Qi @ 2018-08-03 8:27 UTC (permalink / raw) To: openembedded-core *** BLURB HERE *** 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 1.9.1 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] oe_syslog.py: fix for syslog-ng 2018-08-03 8:27 [PATCH 0/1] oe_syslog.py: fix for syslog-ng Chen Qi @ 2018-08-03 8:27 ` Chen Qi 2018-08-03 16:40 ` Richard Purdie 0 siblings, 1 reply; 4+ messages in thread From: Chen Qi @ 2018-08-03 8:27 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 the grep command to also consider 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 it to actually output the ps information. After the change, it looks like: | AssertionError: 1 != 0 : No syslogd process; ps -ef output: | UID PID PPID C STIME TTY TIME CMD | root 1 0 28 07:35 ? 00:00:19 /sbin/init | root 2 0 0 07:35 ? 00:00:00 [kthreadd] | root 3 2 0 07:35 ? 00:00:00 [kworker/0:0] ... Signed-off-by: Chen Qi <Qi.Chen@windriver.com> --- meta/lib/oeqa/runtime/cases/oe_syslog.py | 7 ++++--- 1 file changed, 4 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..23abae3 100644 --- a/meta/lib/oeqa/runtime/cases/oe_syslog.py +++ b/meta/lib/oeqa/runtime/cases/oe_syslog.py @@ -10,9 +10,10 @@ 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 + cmd = '%s | grep -iE "[s]yslogd|[s]yslog-ng"' % self.tc.target_cmds['ps'] + status, _ = self.target.run(cmd) + _, output = self.target.run(self.tc.target_cmds['ps']) + msg = "No syslogd process; %s output:\n%s" % (self.tc.target_cmds['ps'], output) self.assertEqual(status, 0, msg=msg) class SyslogTestConfig(OERuntimeTestCase): -- 1.9.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] oe_syslog.py: fix for syslog-ng 2018-08-03 8:27 ` [PATCH 1/1] " Chen Qi @ 2018-08-03 16:40 ` Richard Purdie 2018-08-06 1:44 ` ChenQi 0 siblings, 1 reply; 4+ messages in thread From: Richard Purdie @ 2018-08-03 16:40 UTC (permalink / raw) To: Chen Qi, openembedded-core On Fri, 2018-08-03 at 16:27 +0800, Chen Qi wrote: > 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 the grep > command > to also consider 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 it to actually output the ps information. After the change, it > looks like: > > AssertionError: 1 != 0 : No syslogd process; ps -ef output: > > UID PID PPID C STIME TTY TIME CMD > > root 1 0 28 07:35 ? 00:00:19 /sbin/init > > root 2 0 0 07:35 ? 00:00:00 [kthreadd] > > root 3 2 0 07:35 ? 00:00:00 [kworker/0:0] > > ... > > Signed-off-by: Chen Qi <Qi.Chen@windriver.com> > --- > meta/lib/oeqa/runtime/cases/oe_syslog.py | 7 ++++--- > 1 file changed, 4 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..23abae3 100644 > --- a/meta/lib/oeqa/runtime/cases/oe_syslog.py > +++ b/meta/lib/oeqa/runtime/cases/oe_syslog.py > @@ -10,9 +10,10 @@ 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 > + cmd = '%s | grep -iE "[s]yslogd|[s]yslog-ng"' % > self.tc.target_cmds['ps'] > + status, _ = self.target.run(cmd) > + _, output = self.target.run(self.tc.target_cmds['ps']) > + msg = "No syslogd process; %s output:\n%s" % > (self.tc.target_cmds['ps'], output) > self.assertEqual(status, 0, msg=msg) Rather than getting the output of "ps" again if the test failed (which may then be different), could we just get the output of ps and then test for the presence of syslog using python, sharing the output of ps if the match isn't found? Cheers, Richard ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] oe_syslog.py: fix for syslog-ng 2018-08-03 16:40 ` Richard Purdie @ 2018-08-06 1:44 ` ChenQi 0 siblings, 0 replies; 4+ messages in thread From: ChenQi @ 2018-08-06 1:44 UTC (permalink / raw) To: Richard Purdie, openembedded-core On 08/04/2018 12:40 AM, Richard Purdie wrote: > On Fri, 2018-08-03 at 16:27 +0800, Chen Qi wrote: >> 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 the grep >> command >> to also consider 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 it to actually output the ps information. After the change, it >> looks like: >>> AssertionError: 1 != 0 : No syslogd process; ps -ef output: >>> UID PID PPID C STIME TTY TIME CMD >>> root 1 0 28 07:35 ? 00:00:19 /sbin/init >>> root 2 0 0 07:35 ? 00:00:00 [kthreadd] >>> root 3 2 0 07:35 ? 00:00:00 [kworker/0:0] >> ... >> >> Signed-off-by: Chen Qi <Qi.Chen@windriver.com> >> --- >> meta/lib/oeqa/runtime/cases/oe_syslog.py | 7 ++++--- >> 1 file changed, 4 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..23abae3 100644 >> --- a/meta/lib/oeqa/runtime/cases/oe_syslog.py >> +++ b/meta/lib/oeqa/runtime/cases/oe_syslog.py >> @@ -10,9 +10,10 @@ 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 >> + cmd = '%s | grep -iE "[s]yslogd|[s]yslog-ng"' % >> self.tc.target_cmds['ps'] >> + status, _ = self.target.run(cmd) >> + _, output = self.target.run(self.tc.target_cmds['ps']) >> + msg = "No syslogd process; %s output:\n%s" % >> (self.tc.target_cmds['ps'], output) >> self.assertEqual(status, 0, msg=msg) > Rather than getting the output of "ps" again if the test failed (which > may then be different), could we just get the output of ps and then > test for the presence of syslog using python, sharing the output of ps > if the match isn't found? > > Cheers, > > Richard > Yes, it is better. I'll send out V2. Best Regards, Chen Qi ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-08-06 1:40 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-08-03 8:27 [PATCH 0/1] oe_syslog.py: fix for syslog-ng Chen Qi 2018-08-03 8:27 ` [PATCH 1/1] " Chen Qi 2018-08-03 16:40 ` Richard Purdie 2018-08-06 1:44 ` ChenQi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox