]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: wait for whole block device instead of partition
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 19 Aug 2022 22:09:21 +0000 (07:09 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 20 Aug 2022 00:01:14 +0000 (09:01 +0900)
In 'udevadm lock' the device /dev/loopX is locked instead of
/dev/loopXp1. Hence, 'udevadm wait' should wait for /dev/loopX.

For some reasons, the kernel sometimes does not emit uevent for
partitions, and 'udevadm wait' for partitions may fail.

Fixes #24360.

test/units/testsuite-60.sh

index c221b19c36eaeba515c5904174fdd126e4931ed0..13fe139a38fffb11c07621f3a431c2ab23154b14 100755 (executable)
@@ -40,8 +40,8 @@ label:gpt
 name="loop${1?}-part1"
 EOF
     LOOP=$(losetup -P --show -f "/tmp/testsuite-60-dependencies-${1?}.img")
-    udevadm wait --settle --timeout=10 "${LOOP}p1"
-    udevadm lock --device="${LOOP}p1" mkfs.ext4 -L "partname${1?}-1" "${LOOP}p1"
+    udevadm wait --settle --timeout=10 "${LOOP}"
+    udevadm lock --device="${LOOP}" mkfs.ext4 -L "partname${1?}-1" "${LOOP}p1"
 }
 
 check_dependencies() {