Skip systemctl functional tests when systemd is not running

Change-Id: I4c1b61ebf34d8df4e53799151f33465096f33f79
This commit is contained in:
Federico Ressi 2021-12-23 17:58:17 +01:00
parent 9876ce03d9
commit 49376a1bc2
3 changed files with 5 additions and 5 deletions

View File

@ -52,7 +52,7 @@ repos:
hooks: hooks:
- id: pylint - id: pylint
name: 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/ files: ^tobiko/
language: system language: system
types: [python] types: [python]

View File

@ -25,9 +25,9 @@ class TestSystemctl(testtools.TestCase):
def setUp(self): def setUp(self):
super().setUp() super().setUp()
try: try:
sh.execute('systemctl --version') sh.execute('pgrep systemd')
except sh.ShellCommandFailed as ex: except sh.ShellCommandFailed:
self.skipTest(f"Can't execute systemctl: {ex.stderr}") self.skipTest("systemd is not running")
def test_list_system_services(self): def test_list_system_services(self):
units = sh.list_systemd_units() units = sh.list_systemd_units()

View File

@ -47,7 +47,7 @@
name: tobiko-docker-infrared name: tobiko-docker-infrared
description: | description: |
Run functional tests for an OpenStack Python project inside a Docker container. Run functional tests for an OpenStack Python project inside a Docker container.
voting: false voting: true
parent: tobiko-docker-unit parent: tobiko-docker-unit
timeout: 3600 timeout: 3600
vars: vars: