diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2015-04-09 02:24:23 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-04-09 19:48:01 +0100 |
commit | ca23337d517cfdb7119e5fd8bd9a9a663ae135de (patch) | |
tree | a760f6e71d60014ac6446cb8b13638abcc75c778 | |
parent | 4b6f87a82ece230b7296f1577d4092ef559af1d4 (diff) | |
download | openembedded-core-ca23337d517cfdb7119e5fd8bd9a9a663ae135de.tar.gz openembedded-core-ca23337d517cfdb7119e5fd8bd9a9a663ae135de.tar.bz2 openembedded-core-ca23337d517cfdb7119e5fd8bd9a9a663ae135de.zip |
oeqa/runtime/systemd.py: skip instead of failing without avahi
The SystemdServiceTests assume that avahi-daemon is installed,
which is not necessarily the case depending on the image being
tested.
Better check this dependency before starting the tests and skip
them if the service is not installed. This has to be done for
each test instead of for the entire module, because other
tests in the module can run without avavi.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/runtime/systemd.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/systemd.py b/meta/lib/oeqa/runtime/systemd.py index 5935edd549..c74394ca54 100644 --- a/meta/lib/oeqa/runtime/systemd.py +++ b/meta/lib/oeqa/runtime/systemd.py @@ -67,13 +67,19 @@ class SystemdBasicTests(SystemdTest): class SystemdServiceTests(SystemdTest): + def check_for_avahi(self): + if not self.hasPackage('avahi-daemon'): + raise unittest.SkipTest("Testcase dependency not met: need avahi-daemon installed on target") + @skipUnlessPassed('test_systemd_basic') def test_systemd_status(self): + self.check_for_avahi() self.systemctl('status --full', 'avahi-daemon.service') @testcase(695) @skipUnlessPassed('test_systemd_status') def test_systemd_stop_start(self): + self.check_for_avahi() self.systemctl('stop', 'avahi-daemon.service') self.systemctl('is-active', 'avahi-daemon.service', expected=3, verbose=True) self.systemctl('start','avahi-daemon.service') @@ -82,6 +88,7 @@ class SystemdServiceTests(SystemdTest): @testcase(696) @skipUnlessPassed('test_systemd_basic') def test_systemd_disable_enable(self): + self.check_for_avahi() self.systemctl('disable', 'avahi-daemon.service') self.systemctl('is-enabled', 'avahi-daemon.service', expected=1) self.systemctl('enable', 'avahi-daemon.service') |