summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorAlexandru Palalau <alexandrux.palalau@intel.com>2013-08-09 10:59:12 +0300
committerSaul Wold <sgw@linux.intel.com>2013-08-13 10:13:18 -0700
commit6386dc718f85210c9b6b9f69878ec9a7847b78de (patch)
treedbebcff8b16ca662053898a711b7a5e00033af8b /meta/lib
parentc75f3e2385dde44ee96e33f4e5d064894dfb7d52 (diff)
downloadopenembedded-core-6386dc718f85210c9b6b9f69878ec9a7847b78de.tar.gz
openembedded-core-6386dc718f85210c9b6b9f69878ec9a7847b78de.tar.bz2
openembedded-core-6386dc718f85210c9b6b9f69878ec9a7847b78de.zip
lib/oeqa/runtime: add new systemd tests
New systemd runtime tests for enable/disable service, start/stop service and list services. Signed-off-by: Alexandru Palalau <alexandrux.palalau@intel.com> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/runtime/systemd.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/systemd.py b/meta/lib/oeqa/runtime/systemd.py
index edf4f39609..e4f433632f 100644
--- a/meta/lib/oeqa/runtime/systemd.py
+++ b/meta/lib/oeqa/runtime/systemd.py
@@ -22,3 +22,38 @@ class SystemdTests(oeRuntimeTest):
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])
+
+ @skipUnlessPassed('test_systemd_version')
+ def test_systemd_service(self):
+ (status, output) = self.target.run('systemctl list-unit-files | grep "systemd-hostnamed.service"')
+ self.assertEqual(status, 0, msg="systemd-hostnamed.service service is not available.")
+
+ @skipUnlessPassed('test_systemd_service')
+ 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))
+
+ @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))
+
+ @skipUnlessPassed('test_systemd_version')
+ def test_systemd_enable(self):
+ self.target.run('systemctl enable machineid.service')
+ (status, output) = self.target.run('systemctl is-enabled machineid.service')
+ self.assertEqual(output, 'enabled', msg="machineid.service service could not be enabled. Status and output: %s and %s" % (status, output))
+
+ @skipUnlessPassed('test_systemd_enable')
+ def test_systemd_disable(self):
+ self.target.run('systemctl disable machineid.service')
+ (status, output) = self.target.run('systemctl is-enabled machineid.service')
+ self.assertEqual(output, 'disabled', msg="machineid.service service could not be disabled. Status and output: %s and %s" % (status, output))
+
+ @skipUnlessPassed('test_systemd_version')
+ def test_systemd_list(self):
+ (status, output) = self.target.run('systemctl list-unit-files')
+ self.assertEqual(status, 0, msg="systemctl list-unit-files command failed. Status: %s" % status)