]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Revert "test: wait for loop device to be removed"
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 27 Aug 2022 06:58:46 +0000 (15:58 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 29 Aug 2022 04:44:42 +0000 (13:44 +0900)
This reverts commit 1a0e065e9f154f46fd68cd45f46310bc7df7a51c.

This does not work as expected.

After `losetup --detach`, the kernel lazily removes the loop device.
But, systemd-dissect should gracefully handle that. If it does not, then
it is a bug in systemd-dissect.
Let's not hide the real issue in systemd-dissect.

test/units/testsuite-50.sh

index 0111a3a2e47fb6a0947ace28f830545dcf1a60b8..42c311be26bedc9e101c63d81958089ba618a702 100755 (executable)
@@ -189,7 +189,6 @@ if [ "${HAVE_OPENSSL}" -eq 1 ]; then
     sfdisk --part-label "${image}.gpt" 3 "Signature Partition"
 fi
 loop="$(losetup --show -P -f "${image}.gpt")"
-# kernel sometimes(?) does not emit add uevent for partitions, let's wait for the whole block device.
 udevadm wait --timeout 60 --settle "${loop:?}"
 dd if="${image}.raw" of="${loop}p1"
 dd if="${image}.verity" of="${loop}p2"
@@ -197,11 +196,6 @@ if [ "${HAVE_OPENSSL}" -eq 1 ]; then
     dd if="${image}.verity-sig" of="${loop}p3"
 fi
 losetup -d "${loop}"
-# Interestingly, kernel does not emit remove uevent for the whole block device, but does for partitions.
-udevadm wait --timeout 60 --settle --removed "${loop}p1" "${loop}p2"
-if [ "${HAVE_OPENSSL}" -eq 1 ]; then
-    udevadm wait --timeout 60 --settle --removed "${loop}p3"
-fi
 
 # Derive partition UUIDs from root hash, in UUID syntax
 ROOT_UUID="$(systemd-id128 -u show "$(head -c 32 "${image}.roothash")" -u | tail -n 1 | cut -b 6-)"