]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
ftests/078: skip test on non-systemd configuration
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 29 Nov 2023 09:38:40 +0000 (09:38 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Thu, 7 Dec 2023 16:21:09 +0000 (09:21 -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>
(cherry picked from commit 7a59e3529f51edeb2ca671acd07f81db6d83b156)

tests/ftests/078-sudo-cgcreate_systemd_scope.py

index 48897d567b71abc357a96fb8463fff25f7137167..2867aafe96d47c0f8b7136b165e029009aff8dba 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
@@ -37,6 +38,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