]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
ftests/071: skip test on non-systemd configuration
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 29 Nov 2023 09:37:16 +0000 (09:37 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Thu, 7 Dec 2023 15:58:13 +0000 (08:58 -0700)
Skip running the testcase, when compiled with --enable-systemd=no,
using Systemd.is_systemd_enabled().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
tests/ftests/071-sudo-set_default_systemd_cgroup.py

index 2c45320375b5d4c85ccdb760f55ee650ab2877c1..bbec4f746a65420eef368f09eed5915f1467e3eb 100755 (executable)
@@ -11,6 +11,7 @@
 from libcgroup import Version, Cgroup, Mode
 from cgroup import Cgroup as CgroupCli
 from process import Process
+from systemd import Systemd
 import consts
 import ftests
 import time
@@ -33,6 +34,10 @@ def prereqs(config):
         result = consts.TEST_SKIPPED
         cause = 'This test cannot be run within a container'
 
+    if not Systemd.is_systemd_enabled():
+        result = consts.TEST_SKIPPED
+        cause = 'Systemd support not compiled in'
+
     return result, cause