Skip test when systemctl command is not available

Change-Id: Iaff083085b460723f0100725fcda97f742bae84a
This commit is contained in:
Federico Ressi 2021-12-21 19:12:02 +01:00
parent ecb9893d68
commit 02ab62334d
2 changed files with 9 additions and 4 deletions

View File

@ -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)

View File

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