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

index c42d371a34097064840e5342d2c4d42975ab12a8..4b9b7fbe48ec8bae7445ee00b899524de1b0e06a 100755 (executable)
@@ -7,9 +7,10 @@
 # Author: Tom Hromatka <tom.hromatka@oracle.com>
 #
 
-from cgroup import Cgroup
 from process import Process
+from systemd import Systemd
 from libcgroup import Mode
+from cgroup import Cgroup
 from run import RunError
 from log import Log
 import consts
@@ -36,6 +37,10 @@ def prereqs(config):
         result = consts.TEST_SKIPPED
         cause = 'This test requires the unified cgroup hierarchy'
 
+    if not Systemd.is_systemd_enabled():
+        result = consts.TEST_SKIPPED
+        cause = 'Systemd support not compiled in'
+
     return result, cause