From d6f719e3313659c3a290e239412887a747f9598c Mon Sep 17 00:00:00 2001 From: Martin Kalcok Date: Thu, 26 Nov 2020 14:42:12 +0100 Subject: [PATCH] Skip 'service' action tests on systems without systemd --- zaza/openstack/charm_tests/ceph/osd/tests.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/zaza/openstack/charm_tests/ceph/osd/tests.py b/zaza/openstack/charm_tests/ceph/osd/tests.py index 03e212f..63f9c4e 100644 --- a/zaza/openstack/charm_tests/ceph/osd/tests.py +++ b/zaza/openstack/charm_tests/ceph/osd/tests.py @@ -136,8 +136,14 @@ class ServiceTest(unittest.TestCase): def setUp(self): """Run test setup.""" - # Note: This counter reset is needed because ceph-osd service is - # limited to 3 restarts per 30 mins which is insufficient + # Skip 'service' action tests on systems without systemd + result = zaza_model.run_on_unit(self.TESTED_UNIT, 'which systemctl') + if not result['Stdout']: + raise unittest.SkipTest("'service' action is not supported on " + "systems without 'systemd'. Skipping " + "tests.") + # Note(mkalcok): This counter reset is needed because ceph-osd service + # is limited to 3 restarts per 30 mins which is insufficient # when running functional tests for 'service' action. This # limitation is defined in /lib/systemd/system/ceph-osd@.service # in section [Service] with options 'StartLimitInterval' and