summaryrefslogtreecommitdiffstats
path: root/meta
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:11:19 +0000
commit599eed2f3b363eb8e89b29da00921e02902242c1 (patch)
tree1229cde8d9ce80e2e1f8b9098203c9b3ccdf727f /meta
parentbf595ca4b6cf5a2bf6bff0581bb927521e5767bb (diff)
downloadpoky-599eed2f3b363eb8e89b29da00921e02902242c1.tar.gz
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. (From OE-Core rev: 024cc1cee3a9954272ecbbff1ba7153725c56dce) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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):
34 def test_systemd_stop(self): 34 def test_systemd_stop(self):
35 self.target.run('systemctl stop systemd-hostnamed.service') 35 self.target.run('systemctl stop systemd-hostnamed.service')
36 (status, output) = self.target.run('systemctl show systemd-hostnamed.service | grep "ActiveState" | grep "=inactive"') 36 (status, output) = self.target.run('systemctl show systemd-hostnamed.service | grep "ActiveState" | grep "=inactive"')
37 self.assertEqual(status, 0, msg="systemd-hostnamed.service service could not be stopped.Status and output: %s and %s" % (status, output)) 37 if status != 0:
38 (status, output) = self.target.run('systemctl status -l systemd-hostnamed.service')
39 self.fail(msg="systemd-hostnamed.service service could not be stopped. Status:\n" + output)
38 40
39 @skipUnlessPassed('test_systemd_stop') 41 @skipUnlessPassed('test_systemd_stop')
40 @skipUnlessPassed('test_systemd_version') 42 @skipUnlessPassed('test_systemd_version')
41 def test_systemd_start(self): 43 def test_systemd_start(self):
42 self.target.run('systemctl start systemd-hostnamed.service') 44 self.target.run('systemctl start systemd-hostnamed.service')
43 (status, output) = self.target.run('systemctl show systemd-hostnamed.service | grep "ActiveState" | grep "=active"') 45 (status, output) = self.target.run('systemctl is-active systemd-hostnamed.service')
44 self.assertEqual(status, 0, msg="systemd-hostnamed.service service could not be started. Status and output: %s and %s" % (status, output)) 46 if status != 0:
47 (status, output) = self.target.run('systemctl status -l systemd-hostnamed.service')
48 self.fail(msg="systemd-hostnamed.service service could not be started. Status:\n" + output)
45 49
46 @skipUnlessPassed('test_systemd_version') 50 @skipUnlessPassed('test_systemd_version')
47 def test_systemd_enable(self): 51 def test_systemd_enable(self):