public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] oeqa/runtime/syslog.py: Improve test_syslog_logger on systemd
@ 2016-08-11 20:18 Aníbal Limón
  0 siblings, 0 replies; only message in thread
From: Aníbal Limón @ 2016-08-11 20:18 UTC (permalink / raw)
  To: openembedded-core

When an image uses systemd journald acts as a main syslog daemon using
/dev/log.

The test_syslog_logger try to log a predifined message into the syslog
using logger and then search using grep in /var/log/messages if this
fails for some reason (file rotated) now search the predifined message
into the journal.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
 meta/lib/oeqa/runtime/syslog.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/runtime/syslog.py b/meta/lib/oeqa/runtime/syslog.py
index cce3c22..8f55032 100644
--- a/meta/lib/oeqa/runtime/syslog.py
+++ b/meta/lib/oeqa/runtime/syslog.py
@@ -22,8 +22,11 @@ class SyslogTestConfig(oeRuntimeTest):
         self.assertEqual(status, 0, msg="Can't log into syslog. Output: %s " % output)
 
         (status, output) = self.target.run('grep foobar /var/log/messages')
-        if status != 0 and not oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", "") == "systemd":
-            (status, output) = self.target.run('logread | grep foobar')
+        if status != 0:
+            if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", "") == "systemd":
+                (status, output) = self.target.run('journalctl -o cat | grep foobar')
+            else:
+                (status, output) = self.target.run('logread | grep foobar')
         self.assertEqual(status, 0, msg="Test log string not found in /var/log/messages or logread. Output: %s " % output)
 
     @testcase(1150)
-- 
2.1.4



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

only message in thread, other threads:[~2016-08-11 20:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-11 20:18 [PATCH] oeqa/runtime/syslog.py: Improve test_syslog_logger on systemd Aníbal Limón

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox