summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2016-07-27 17:40:38 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-01 11:47:13 +0100
commitb4ba36a9d7261f4d617b4029e81c5fd8503041f2 (patch)
treeaa07a6957c9c5f2c4627e1bb1d3c125c2c3929fd /meta/lib
parent8b3f6245493588ad713b3609305b806753302de8 (diff)
downloadpoky-b4ba36a9d7261f4d617b4029e81c5fd8503041f2.tar.gz
oeqa/runtime/syslog.py: Improve test_syslog_logger
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 (From OE-Core rev: f3fe3590e887ee311f23723103eca41dcf58aa8b) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/runtime/syslog.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/meta/lib/oeqa/runtime/syslog.py b/meta/lib/oeqa/runtime/syslog.py
index f7421ec8c5..202a63f2af 100644
--- a/meta/lib/oeqa/runtime/syslog.py
+++ b/meta/lib/oeqa/runtime/syslog.py
@@ -18,8 +18,13 @@ class SyslogTestConfig(oeRuntimeTest):
18 @testcase(1149) 18 @testcase(1149)
19 @skipUnlessPassed("test_syslog_running") 19 @skipUnlessPassed("test_syslog_running")
20 def test_syslog_logger(self): 20 def test_syslog_logger(self):
21 (status,output) = self.target.run('logger foobar && test -e /var/log/messages && grep foobar /var/log/messages || logread | grep foobar') 21 (status, output) = self.target.run('logger foobar')
22 self.assertEqual(status, 0, msg="Test log string not found in /var/log/messages. Output: %s " % output) 22 self.assertEqual(status, 0, msg="Can't log into syslog. Output: %s " % output)
23
24 (status, output) = self.target.run('grep foobar /var/log/messages')
25 if status != 0:
26 (status, output) = self.target.run('logread | grep foobar')
27 self.assertEqual(status, 0, msg="Test log string not found in /var/log/messages or logread. Output: %s " % output)
23 28
24 @testcase(1150) 29 @testcase(1150)
25 @skipUnlessPassed("test_syslog_running") 30 @skipUnlessPassed("test_syslog_running")