]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
ftests/059: skip test on non-systemd configuration
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 29 Nov 2023 09:20:34 +0000 (09:20 +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/059-sudo-invalid_systemd_create_scope2.py

index 25d2e39095bbeeb859866bb46885e13b858ba9a2..ceaf71676422822a20b4d16258283c2a54b8e709 100755 (executable)
@@ -9,6 +9,7 @@
 
 from cgroup import CgroupVersion as CgroupCliVersion
 from libcgroup import Cgroup, Version
+from systemd import Systemd
 import ftests
 import consts
 import sys
@@ -32,6 +33,10 @@ def prereqs(config):
         result = consts.TEST_SKIPPED
         cause = 'This test requires cgroup v2'
 
+    if not Systemd.is_systemd_enabled():
+        result = consts.TEST_SKIPPED
+        cause = 'Systemd support not compiled in'
+
     return result, cause