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-10 18:10:25 +0100 |
commit | 206d532180eca9c32e86d1ee36d4b8c61b15436b (patch) | |
tree | 62f6f725a4d76c0e2c232fcd45aae5a7141f1b24 /meta/lib/oeqa | |
parent | 058e75d60e98841c8532a05006ae46725e3cdfd1 (diff) | |
download | poky-206d532180eca9c32e86d1ee36d4b8c61b15436b.tar.gz |
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.
(From OE-Core rev: ca23337d517cfdb7119e5fd8bd9a9a663ae135de)
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-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): | |||
67 | 67 | ||
68 | class SystemdServiceTests(SystemdTest): | 68 | class SystemdServiceTests(SystemdTest): |
69 | 69 | ||
70 | def check_for_avahi(self): | ||
71 | if not self.hasPackage('avahi-daemon'): | ||
72 | raise unittest.SkipTest("Testcase dependency not met: need avahi-daemon installed on target") | ||
73 | |||
70 | @skipUnlessPassed('test_systemd_basic') | 74 | @skipUnlessPassed('test_systemd_basic') |
71 | def test_systemd_status(self): | 75 | def test_systemd_status(self): |
76 | self.check_for_avahi() | ||
72 | self.systemctl('status --full', 'avahi-daemon.service') | 77 | self.systemctl('status --full', 'avahi-daemon.service') |
73 | 78 | ||
74 | @testcase(695) | 79 | @testcase(695) |
75 | @skipUnlessPassed('test_systemd_status') | 80 | @skipUnlessPassed('test_systemd_status') |
76 | def test_systemd_stop_start(self): | 81 | def test_systemd_stop_start(self): |
82 | self.check_for_avahi() | ||
77 | self.systemctl('stop', 'avahi-daemon.service') | 83 | self.systemctl('stop', 'avahi-daemon.service') |
78 | self.systemctl('is-active', 'avahi-daemon.service', expected=3, verbose=True) | 84 | self.systemctl('is-active', 'avahi-daemon.service', expected=3, verbose=True) |
79 | self.systemctl('start','avahi-daemon.service') | 85 | self.systemctl('start','avahi-daemon.service') |
@@ -82,6 +88,7 @@ class SystemdServiceTests(SystemdTest): | |||
82 | @testcase(696) | 88 | @testcase(696) |
83 | @skipUnlessPassed('test_systemd_basic') | 89 | @skipUnlessPassed('test_systemd_basic') |
84 | def test_systemd_disable_enable(self): | 90 | def test_systemd_disable_enable(self): |
91 | self.check_for_avahi() | ||
85 | self.systemctl('disable', 'avahi-daemon.service') | 92 | self.systemctl('disable', 'avahi-daemon.service') |
86 | self.systemctl('is-enabled', 'avahi-daemon.service', expected=1) | 93 | self.systemctl('is-enabled', 'avahi-daemon.service', expected=1) |
87 | self.systemctl('enable', 'avahi-daemon.service') | 94 | self.systemctl('enable', 'avahi-daemon.service') |