Browse Source

Skip systemctl functional tests when systemd is not running

Change-Id: I4c1b61ebf34d8df4e53799151f33465096f33f79
changes/51/822851/2
Federico Ressi 5 months ago
parent
commit
49376a1bc2
  1. 2
      .pre-commit-config.yaml
  2. 6
      tobiko/tests/functional/shell/test_systemctl.py
  3. 2
      zuul.d/docker.yaml

2
.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]

6
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()

2
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:

Loading…
Cancel
Save