Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Aníbal Limón" <anibal.limon@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 1/5] oeqa/runtime/syslog.py: Improve test_syslog_logger
Date: Wed, 27 Jul 2016 17:40:38 -0500	[thread overview]
Message-ID: <1469659242-12350-2-git-send-email-anibal.limon@linux.intel.com> (raw)
In-Reply-To: <1469659242-12350-1-git-send-email-anibal.limon@linux.intel.com>

Instead of make all the testing in a shell one liner, divide the
test into 3 operations to be able to know in what part is failing.

Parts,
	- Log message to syslog
	- Review if message exist in /var/log/messages
		- Review if message exist using logread

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

diff --git a/meta/lib/oeqa/runtime/syslog.py b/meta/lib/oeqa/runtime/syslog.py
index f7421ec..202a63f 100644
--- a/meta/lib/oeqa/runtime/syslog.py
+++ b/meta/lib/oeqa/runtime/syslog.py
@@ -18,8 +18,13 @@ class SyslogTestConfig(oeRuntimeTest):
     @testcase(1149)
     @skipUnlessPassed("test_syslog_running")
     def test_syslog_logger(self):
-        (status,output) = self.target.run('logger foobar && test -e /var/log/messages && grep foobar /var/log/messages || logread | grep foobar')
-        self.assertEqual(status, 0, msg="Test log string not found in /var/log/messages. Output: %s " % output)
+        (status, output) = self.target.run('logger foobar')
+        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:
+            (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)
     @skipUnlessPassed("test_syslog_running")
-- 
2.1.4



  reply	other threads:[~2016-07-27 22:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-27 22:40 [PATCH 0/5] Fixes for busybox-syslog with systemd Aníbal Limón
2016-07-27 22:40 ` Aníbal Limón [this message]
2016-07-27 22:40 ` [PATCH 2/5] busybox-syslog.default: When systemd is enabled don't use circular buffer Aníbal Limón
2016-07-27 22:40 ` [PATCH 3/5] classes/testimage: When image is systemd, enable debug log level Aníbal Limón
2016-07-27 22:40 ` [PATCH 4/5] oeqa/runtime/syslog: test_syslog_logger Don't try to use logread when systemd is enabled Aníbal Limón
2016-07-27 22:40 ` [PATCH 5/5] oeqa/utils/commands.py: Command class improve validations/decoding in output Aníbal Limón
2016-07-28  3:18   ` Leonardo Sandoval
2016-07-28 14:34     ` Aníbal Limón
2016-07-29  7:08 ` [PATCH 0/5] Fixes for busybox-syslog with systemd Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469659242-12350-2-git-send-email-anibal.limon@linux.intel.com \
    --to=anibal.limon@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox