]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-23-UNIT-FILE: skip verifying masked unit
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 10 Mar 2025 19:21:11 +0000 (04:21 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 5 Aug 2025 15:24:45 +0000 (17:24 +0200)
This fixes the following failure:
TEST-23-UNIT-FILE.sh[2408]: + systemd-analyze --recursive-errors=no --man=no verify /usr/lib/systemd/system/sysinit.target.wants/systemd-hwdb-update.service
systemd-analyze[2737]: sys-kernel-config.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: proc-sys-fs-binfmt_misc.automount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: dev-hugepages.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: sys-kernel-tracing.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: sys-kernel-debug.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: sys-fs-fuse-connections.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: dev-mqueue.mount: symlinks are not allowed for units of this type, rejecting.
systemd-analyze[2737]: Unit systemd-hwdb-update.service is masked.
TEST-23-UNIT-FILE.sh[166]: + :
TEST-23-UNIT-FILE.sh[166]: + kill -0 2408
TEST-23-UNIT-FILE.sh[166]: + wait 2408
TEST-23-UNIT-FILE.sh[166]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/TEST-23-UNIT-FILE.verify-unit-files.sh failed'
TEST-23-UNIT-FILE.sh[166]: Subtest /usr/lib/systemd/tests/testdata/units/TEST-23-UNIT-FILE.verify-unit-files.sh failed

(cherry picked from commit e5e7cc9a98155b031d9855527da08ac87617f427)

test/units/TEST-23-UNIT-FILE.verify-unit-files.sh

index 3e83d44607b662dd538da2fde5fff35011274994..200e7582bddbb65c1c68a67d583ab9cb8c2964e9 100755 (executable)
@@ -41,5 +41,12 @@ for unit_file in "${UNIT_FILES[@]}"; do
         continue
     fi
 
+    # Skip masked unit files
+    resolved=$(readlink -f "$unit_file")
+    if [[ "$resolved" == "/dev/null" || "$(systemctl is-enabled "${resolved##*/}" 2>/dev/null || :)" == "masked" ]]; then
+        echo "$unit_file is masked, skipping"
+        continue
+    fi
+
     systemd-analyze --recursive-errors=no --man=no verify "$unit_file"
 done