[oe-commits] [openembedded-core] 01/08: oeqa/runtime/syslog.py: Improve test_syslog_logger

git at git.openembedded.org git at git.openembedded.org
Thu Jul 28 21:43:08 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit e4af13ab5012e81e2058407c1a527408b24bc1cb
Author: Aníbal Limón <anibal.limon at linux.intel.com>
AuthorDate: Wed Jul 27 17:40:38 2016 -0500

    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
    
    Signed-off-by: Aníbal Limón <anibal.limon at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at 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")

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list