From 6f11f24642ee7165a5dd9dfd570bd8603874c3a3 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 11 Oct 2026 09:16:08 +0900 Subject: [PATCH] test: silence more shellcheck warnings (cherry picked from commit 89bddce9875de8ac5b18520cb771029b82b6c354) --- test/units/TEST-17-UDEV.SYSTEMD_WANTS-escape.sh | 1 + test/units/TEST-17-UDEV.diskseq.sh | 1 + test/units/TEST-17-UDEV.failed-event.sh | 2 +- test/units/TEST-17-UDEV.global-property.sh | 2 +- test/units/TEST-17-UDEV.loop-own.sh | 1 + test/units/TEST-17-UDEV.verify.sh | 2 +- test/units/TEST-50-DISSECT.sysext.sh | 9 ++------- 7 files changed, 8 insertions(+), 10 deletions(-) diff --git a/test/units/TEST-17-UDEV.SYSTEMD_WANTS-escape.sh b/test/units/TEST-17-UDEV.SYSTEMD_WANTS-escape.sh index e37feaf89d..3635b0d577 100755 --- a/test/units/TEST-17-UDEV.SYSTEMD_WANTS-escape.sh +++ b/test/units/TEST-17-UDEV.SYSTEMD_WANTS-escape.sh @@ -11,6 +11,7 @@ set -o pipefail IFNAME=test-netif-foo +# shellcheck disable=SC2329 at_exit() { set +e diff --git a/test/units/TEST-17-UDEV.diskseq.sh b/test/units/TEST-17-UDEV.diskseq.sh index d1f565f8d5..04b8bd3421 100755 --- a/test/units/TEST-17-UDEV.diskseq.sh +++ b/test/units/TEST-17-UDEV.diskseq.sh @@ -11,6 +11,7 @@ set -o pipefail # This is a test case for issue #34637. +# shellcheck disable=SC2329 at_exit() ( set +e diff --git a/test/units/TEST-17-UDEV.failed-event.sh b/test/units/TEST-17-UDEV.failed-event.sh index d7896c8c2d..cbaeb7a4da 100755 --- a/test/units/TEST-17-UDEV.failed-event.sh +++ b/test/units/TEST-17-UDEV.failed-event.sh @@ -30,7 +30,7 @@ EOF systemctl reload systemd-udevd.service } -# shellcheck disable=SC2317 +# shellcheck disable=SC2317,SC2329 teardown() { set +e diff --git a/test/units/TEST-17-UDEV.global-property.sh b/test/units/TEST-17-UDEV.global-property.sh index d1648ab924..ecace36f9c 100755 --- a/test/units/TEST-17-UDEV.global-property.sh +++ b/test/units/TEST-17-UDEV.global-property.sh @@ -16,7 +16,7 @@ test_property() { assert_eq "$(udevadm info --query property --property "$2" --value "$1")" "$3" } -# shellcheck disable=SC2317 +# shellcheck disable=SC2317,SC2329 cleanup() { set +e diff --git a/test/units/TEST-17-UDEV.loop-own.sh b/test/units/TEST-17-UDEV.loop-own.sh index 7961d6d0b2..3fa52b7f17 100755 --- a/test/units/TEST-17-UDEV.loop-own.sh +++ b/test/units/TEST-17-UDEV.loop-own.sh @@ -7,6 +7,7 @@ set -o pipefail # shellcheck source=test/units/util.sh . "$(dirname "$0")"/util.sh +# shellcheck disable=SC2329 at_exit() ( set +e diff --git a/test/units/TEST-17-UDEV.verify.sh b/test/units/TEST-17-UDEV.verify.sh index 66ab257be8..0d5b31cf54 100755 --- a/test/units/TEST-17-UDEV.verify.sh +++ b/test/units/TEST-17-UDEV.verify.sh @@ -8,7 +8,7 @@ set -o pipefail # shellcheck source=test/units/util.sh . "$(dirname "$0")"/util.sh -# shellcheck disable=SC2317 +# shellcheck disable=SC2317,SC2329 cleanup() { cd / rm -rf "${workdir}" diff --git a/test/units/TEST-50-DISSECT.sysext.sh b/test/units/TEST-50-DISSECT.sysext.sh index 4c38599620..aca1c8f28e 100755 --- a/test/units/TEST-50-DISSECT.sysext.sh +++ b/test/units/TEST-50-DISSECT.sysext.sh @@ -11,7 +11,7 @@ FSTYPE=$(stat --file-system --format "%T" /usr) shopt -s nullglob -# shellcheck disable=SC2317 +# shellcheck disable=SC2317,SC2329 at_exit() { set +ex @@ -97,20 +97,15 @@ prepare_root() { prepend_trap "cleanup_os_release ${root@Q}" } +# shellcheck disable=SC2317,SC2329 cleanup_os_release() { - # shellcheck disable=SC2317 # It is not unreachable, used in a trap couple lines above. local root=${1:-} - # shellcheck disable=SC2317 # It is not unreachable, used in a trap couple lines above. rm -f "$root/usr/lib/os-release" - # shellcheck disable=SC2317 # It is not unreachable, used in a trap couple lines above. if [[ -e $root/usr/lib/os-release.orig ]]; then - # shellcheck disable=SC2317 # It is not unreachable, used in a trap couple lines above. mv "$root/usr/lib/os-release.orig" "$root/usr/lib/os-release" fi - # shellcheck disable=SC2317 # It is not unreachable, used in a trap couple lines above. if [[ -e $root/etc/os-release.orig ]]; then - # shellcheck disable=SC2317 # It is not unreachable, used in a trap couple lines above. mv "$root/etc/os-release.orig" "$root/etc/os-release" fi }