From a047bb771b6cdba5b635187901567c6113c0844f Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Wed, 29 Nov 2023 09:38:40 +0000 Subject: [PATCH] ftests/078: skip test on non-systemd configuration Skip running the testcase, when compiled with --enable-systemd=no, using Systemd.is_systemd_enabled(). Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka (cherry picked from commit 7a59e3529f51edeb2ca671acd07f81db6d83b156) --- tests/ftests/078-sudo-cgcreate_systemd_scope.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/ftests/078-sudo-cgcreate_systemd_scope.py b/tests/ftests/078-sudo-cgcreate_systemd_scope.py index 48897d56..2867aafe 100755 --- a/tests/ftests/078-sudo-cgcreate_systemd_scope.py +++ b/tests/ftests/078-sudo-cgcreate_systemd_scope.py @@ -7,9 +7,10 @@ # Author: Tom Hromatka # -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 -- 2.47.3