All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] oqea/runtime/oe_syslog: Improve test
@ 2022-02-04 17:54 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2022-02-04 17:54 UTC (permalink / raw)
  To: openembedded-core

We're seeing failures on the autobuilder where the log message isn't present in the
log. This could just be a race in the compound command but it is hard to say due
to the poor log output from the test.

Splittng the command into two sections should add more of a delay whilst ssh
reconnects and may well fix the issues but this change should also improve
the log output in the failure case too so if the failure isn't solved, we should
be better able to debug it.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/lib/oeqa/runtime/cases/oe_syslog.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/meta/lib/oeqa/runtime/cases/oe_syslog.py b/meta/lib/oeqa/runtime/cases/oe_syslog.py
index f3c2bedbaf9..150b70d9f03 100644
--- a/meta/lib/oeqa/runtime/cases/oe_syslog.py
+++ b/meta/lib/oeqa/runtime/cases/oe_syslog.py
@@ -121,11 +121,16 @@ class SyslogTestConfig(OERuntimeTestCase):
 
         self.test_syslog_restart()
 
-        cmd = 'logger foobar && grep foobar /var/log/test'
-        status,output = self.target.run(cmd)
-        msg = 'Test log string not found. Output: %s ' % output
+        cmd = 'logger foobar'
+        status, output = self.target.run(cmd)
+        msg = 'Logger command failed, %s. Output: %s ' % (status, output)
         self.assertEqual(status, 0, msg=msg)
 
+        cmd = 'cat /var/log/test'
+        status, output = self.target.run(cmd)
+        if "foobar" not in output or status:
+            self.fail("'foobar' not found in logfile, status %s, contents %s" % (status, output))
+
         cmd = "sed -i 's#LOGFILE=/var/log/test##' /etc/syslog-startup.conf"
         self.target.run(cmd)
         self.test_syslog_restart()
-- 
2.32.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-04 17:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-04 17:54 [PATCH] oqea/runtime/oe_syslog: Improve test Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.