You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
systemd/SOURCES/0124-test-make-masking-of-s...

50 lines
1.8 KiB

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