From 02ab62334d9f6a5e9cbb2b06bc3d08c63f17cea5 Mon Sep 17 00:00:00 2001 From: Federico Ressi Date: Tue, 21 Dec 2021 19:12:02 +0100 Subject: [PATCH] Skip test when systemctl command is not available Change-Id: Iaff083085b460723f0100725fcda97f742bae84a --- tobiko/tests/functional/shell/test_systemctl.py | 7 +++++++ zuul.d/docker.yaml | 6 ++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tobiko/tests/functional/shell/test_systemctl.py b/tobiko/tests/functional/shell/test_systemctl.py index a7e9a3653..d637068d6 100644 --- a/tobiko/tests/functional/shell/test_systemctl.py +++ b/tobiko/tests/functional/shell/test_systemctl.py @@ -22,6 +22,13 @@ from tobiko.shell import sh class TestSystemctl(testtools.TestCase): + def setUp(self): + super().setUp() + try: + sh.execute('systemctl --version') + except sh.ShellCommandFailed as ex: + self.skipTest(f"Can't execute systemctl: {ex.stderr}") + def test_list_system_services(self): units = sh.list_systemd_units() self.assertNotEqual([], units) diff --git a/zuul.d/docker.yaml b/zuul.d/docker.yaml index 9b6637932..c48405340 100644 --- a/zuul.d/docker.yaml +++ b/zuul.d/docker.yaml @@ -8,9 +8,7 @@ jobs: - tobiko-docker-unit - tobiko-docker-functional - gate: - jobs: - - tobiko-docker-unit + gate: *CHECK periodic: *CHECK @@ -34,7 +32,7 @@ name: tobiko-docker-functional description: | Run functional tests for an OpenStack Python project inside a Docker container. - voting: false + voting: true parent: tobiko-docker-unit timeout: 3600 vars: