From 49376a1bc245d6ae091a8f36df2d87915de574c7 Mon Sep 17 00:00:00 2001 From: Federico Ressi Date: Thu, 23 Dec 2021 17:58:17 +0100 Subject: [PATCH] Skip systemctl functional tests when systemd is not running Change-Id: I4c1b61ebf34d8df4e53799151f33465096f33f79 --- .pre-commit-config.yaml | 2 +- tobiko/tests/functional/shell/test_systemctl.py | 6 +++--- zuul.d/docker.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 87a9b3722..26895879b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -52,7 +52,7 @@ repos: hooks: - id: pylint name: pylint - entry: pylint --max-line-length=88 -E -e W,E -d unused-import,broad-except,fixme,unspecified-encoding,redundant-u-string-prefix + entry: .tox/pep8/bin/pylint --max-line-length=88 -E -e W,E -d unused-import,broad-except,fixme,unspecified-encoding,redundant-u-string-prefix files: ^tobiko/ language: system types: [python] diff --git a/tobiko/tests/functional/shell/test_systemctl.py b/tobiko/tests/functional/shell/test_systemctl.py index d637068d6..83006dfab 100644 --- a/tobiko/tests/functional/shell/test_systemctl.py +++ b/tobiko/tests/functional/shell/test_systemctl.py @@ -25,9 +25,9 @@ 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}") + sh.execute('pgrep systemd') + except sh.ShellCommandFailed: + self.skipTest("systemd is not running") def test_list_system_services(self): units = sh.list_systemd_units() diff --git a/zuul.d/docker.yaml b/zuul.d/docker.yaml index c84a13fed..13ee5b862 100644 --- a/zuul.d/docker.yaml +++ b/zuul.d/docker.yaml @@ -47,7 +47,7 @@ name: tobiko-docker-infrared description: | Run functional tests for an OpenStack Python project inside a Docker container. - voting: false + voting: true parent: tobiko-docker-unit timeout: 3600 vars: