teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

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

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