summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-11-27 16:10:36 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-11-27 16:56:43 +0100
commit6bb3771e8c6c0d6c9f561ab0be88ce76b16f031a (patch)
tree34a1f814dbe9aa220ddef0f40419d5dfd7ddff69
parentTEST-67-INTEGRITY: modernize test code (diff)
downloadsystemd-6bb3771e8c6c0d6c9f561ab0be88ce76b16f031a.tar.xz
systemd-6bb3771e8c6c0d6c9f561ab0be88ce76b16f031a.zip
TEST-67-INTEGRITY: blkid should not provide the underlying loopback block device
Fixes #35363.
-rwxr-xr-xtest/units/TEST-67-INTEGRITY.sh18
1 files changed, 10 insertions, 8 deletions
diff --git a/test/units/TEST-67-INTEGRITY.sh b/test/units/TEST-67-INTEGRITY.sh
index d13f9071ac..6a464c40ab 100755
--- a/test/units/TEST-67-INTEGRITY.sh
+++ b/test/units/TEST-67-INTEGRITY.sh
@@ -35,6 +35,14 @@ cat >/run/udev/rules.d/00-integrity-test.rules <<EOF
SUBSYSTEM=="block", KERNEL=="loop*|dm-*", OPTIONS="log_level=debug"
EOF
+# FIXME:
+# There is no ordering restriction between underlying loopback block devices and DM devices.
+# Hence, we may get wrong device node symlinks. To workaround that issue, let's decrease the
+# priority for loopback block devices.
+cat >/run/udev/rules.d/99-priority.rules <<EOF
+SUBSYSTEM=="block", KERNEL=="loop*", OPTIONS="link_priority=-200"
+EOF
+
udevadm control --reload
TMP_DIR="$(mktemp -d -t -p / integrity.tmp.XXXXXX)"
@@ -64,7 +72,7 @@ test_cleanup() (
test_one() {
local algorithm="${1?}"
local separate_data="${2?}"
- local data_option dev_name
+ local data_option
trap test_cleanup RETURN
@@ -105,13 +113,7 @@ EOF
udevadm wait --timeout=30 --settle "${DM_NODE}"
# Check the signature on the FS to ensure we can retrieve it and that is matches.
- # If a separate device is used for the metadata storage, then blkid will return one of the loop devices.
- if [[ "${separate_data}" == 1 ]]; then
- dev_name="$(integritysetup status ${DM_NAME} | grep '^\s*device:' | awk '{print $2}')"
- else
- dev_name="${DM_NODE}"
- fi
- [[ "$(blkid -U "${FS_UUID}")" == "${dev_name}" ]]
+ [[ "$(blkid -U "${FS_UUID}")" == "${DM_NODE}" ]]
}
for a in crc32c crc32 xxhash64 sha1 sha256; do