teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0124-test-make-masking-of-supplementary-services-configur.patch

594167
From 4197469aa26e8e3e61c859341002e37bde751ada Mon Sep 17 00:00:00 2001
594167
From: Frantisek Sumsal <frantisek@sumsal.cz>
594167
Date: Wed, 16 Feb 2022 20:29:14 +0100
594167
Subject: [PATCH] test: make masking of supplementary services configurable
594167
594167
(cherry picked from commit 508a7f04b345878dcd8365ff0ded5f87b18d75fa)
594167
594167
Related: #2087652
594167
---
594167
 test/TEST-01-BASIC/test.sh | 1 +
594167
 test/test-functions        | 6 +++---
594167
 2 files changed, 4 insertions(+), 3 deletions(-)
594167
594167
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh
594167
index a790cd78ac..cc6d0651c1 100755
594167
--- a/test/TEST-01-BASIC/test.sh
594167
+++ b/test/TEST-01-BASIC/test.sh
594167
@@ -6,6 +6,7 @@ TEST_DESCRIPTION="Basic systemd setup"
594167
 IMAGE_NAME="basic"
594167
 RUN_IN_UNPRIVILEGED_CONTAINER=${RUN_IN_UNPRIVILEGED_CONTAINER:-yes}
594167
 TEST_REQUIRE_INSTALL_TESTS=0
594167
+TEST_SUPPORTING_SERVICES_SHOULD_BE_MASKED=0
594167
 
594167
 # shellcheck source=test/test-functions
594167
 . "${TEST_BASE_DIR:?}/test-functions"
594167
diff --git a/test/test-functions b/test/test-functions
594167
index 7c37d05610..44f465c914 100644
594167
--- a/test/test-functions
594167
+++ b/test/test-functions
594167
@@ -40,6 +40,7 @@ IMAGE_NAME=${IMAGE_NAME:-default}
594167
 STRIP_BINARIES="${STRIP_BINARIES:-yes}"
594167
 TEST_REQUIRE_INSTALL_TESTS="${TEST_REQUIRE_INSTALL_TESTS:-1}"
594167
 TEST_PARALLELIZE="${TEST_PARALLELIZE:-0}"
594167
+TEST_SUPPORTING_SERVICES_SHOULD_BE_MASKED="${TEST_SUPPORTING_SERVICES_SHOULD_BE_MASKED:-1}"
594167
 LOOPDEV=
594167
 
594167
 # Simple wrapper to unify boolean checks.
594167
@@ -2787,9 +2788,8 @@ test_setup() {
594167
         fi
594167
 
594167
         mount_initdir
594167
-        # We want to test all services in TEST-01-BASIC, but mask them in
594167
-        # all other tests
594167
-        if [[ "${TESTID:?}" != "01" ]]; then
594167
+
594167
+        if get_bool "${TEST_SUPPORTING_SERVICES_SHOULD_BE_MASKED}"; then
594167
             dinfo "Masking supporting services"
594167
             mask_supporting_services
594167
         fi