Patchwork [3/3] lib/oeqa/runtime: output more logging from systemd when services have failed

login
register
mail settings
Submitter Ross Burton
Date Dec. 5, 2013, 12:56 p.m.
Message ID <1386248161-7086-3-git-send-email-ross.burton@intel.com>
Download mbox | patch
Permalink /patch/62909/
State Accepted
Commit 8dee33872b82ba981814419befdc6f09a1c2568d
Headers show

Comments

Ross Burton - Dec. 5, 2013, 12:56 p.m.
If some services have failed to start, get the status of them and some of their
log to help debug the problem.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/lib/oeqa/runtime/systemd.py |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/lib/oeqa/runtime/systemd.py b/meta/lib/oeqa/runtime/systemd.py
index e4f4336..17cc19f 100644
--- a/meta/lib/oeqa/runtime/systemd.py
+++ b/meta/lib/oeqa/runtime/systemd.py
@@ -21,7 +21,9 @@  class SystemdTests(oeRuntimeTest):
     @skipUnlessPassed('test_systemd_version')
     def test_systemd_failed(self):
         (status, output) = self.target.run('systemctl --failed | grep "0 loaded units listed"')
-        self.assertEqual(status, 0, msg="Failed systemd services: %s" % self.target.run('systemctl --failed')[1])
+        if status != 0:
+            print self.target.run('systemctl status --failed -l')[1]
+            self.fail("Some systemd units failed.")
 
     @skipUnlessPassed('test_systemd_version')
     def test_systemd_service(self):