summaryrefslogtreecommitdiff
path: root/meta/lib
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2013-12-12 10:06:09 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-14 09:09:37 +0000
commit024cc1cee3a9954272ecbbff1ba7153725c56dce (patch)
treed929a09222c35e330cbb1488a762febd14810a06 /meta/lib
parentd518892d38ac399c091ff509a9fd90fc00d71224 (diff)
downloadopenembedded-core-024cc1cee3a9954272ecbbff1ba7153725c56dce.tar.gz
openembedded-core-024cc1cee3a9954272ecbbff1ba7153725c56dce.tar.bz2
openembedded-core-024cc1cee3a9954272ecbbff1ba7153725c56dce.zip
lib/oeqa/runtime: systemd failure case improvements
If the hostnamed service can't be started or stopped, show the output from systemctl status to assist debugging. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/runtime/systemd.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/meta/lib/oeqa/runtime/systemd.py b/meta/lib/oeqa/runtime/systemd.py
index 17cc19f7a5..31007df424 100644
--- a/meta/lib/oeqa/runtime/systemd.py
+++ b/meta/lib/oeqa/runtime/systemd.py
@@ -34,14 +34,18 @@ class SystemdTests(oeRuntimeTest):
def test_systemd_stop(self):
self.target.run('systemctl stop systemd-hostnamed.service')
(status, output) = self.target.run('systemctl show systemd-hostnamed.service | grep "ActiveState" | grep "=inactive"')
- self.assertEqual(status, 0, msg="systemd-hostnamed.service service could not be stopped.Status and output: %s and %s" % (status, output))
+ if status != 0:
+ (status, output) = self.target.run('systemctl status -l systemd-hostnamed.service')
+ self.fail(msg="systemd-hostnamed.service service could not be stopped. Status:\n" + output)
@skipUnlessPassed('test_systemd_stop')
@skipUnlessPassed('test_systemd_version')
def test_systemd_start(self):
self.target.run('systemctl start systemd-hostnamed.service')
- (status, output) = self.target.run('systemctl show systemd-hostnamed.service | grep "ActiveState" | grep "=active"')
- self.assertEqual(status, 0, msg="systemd-hostnamed.service service could not be started. Status and output: %s and %s" % (status, output))
+ (status, output) = self.target.run('systemctl is-active systemd-hostnamed.service')
+ if status != 0:
+ (status, output) = self.target.run('systemctl status -l systemd-hostnamed.service')
+ self.fail(msg="systemd-hostnamed.service service could not be started. Status:\n" + output)
@skipUnlessPassed('test_systemd_version')
def test_systemd_enable(self):