]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: systemd-mount --list and systemd-umount requires the device is initialized...
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 15 Dec 2022 18:04:22 +0000 (03:04 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 Dec 2022 06:14:42 +0000 (15:14 +0900)
Fixes #25674.

test/units/testsuite-74.mount.sh

index 6edff265b50de5341fd5f33ee38963d1d1d96006..4890911fd00f3d6b008a1944357de4dddb7cdf32 100755 (executable)
@@ -3,6 +3,9 @@
 set -eux
 set -o pipefail
 
+# shellcheck source=test/units/assert.sh
+. "$(dirname "$0")"/assert.sh
+
 # We're going to play around with block/loop devices, so bail out early
 # if we're running in nspawn
 if systemd-detect-virt --container >/dev/null; then
@@ -115,8 +118,11 @@ timeout 10s bash -c "while systemctl status '$(systemd-escape --path "$WORK_DIR/
 
 # Mount a disk image
 systemd-mount --discover "$WORK_DIR/simple.img"
-systemd-mount --list --full
+# We can access files in the image even if the loopback block device is not initialized by udevd.
 test -e /run/media/system/simple.img/foo.bar
+# systemd-mount --list and systemd-umount require the loopback block device is initialized by udevd.
+udevadm settle --timeout 30
+assert_in "/dev/loop.* ext4 sd-mount-test" "$(systemd-mount --list --full)"
 systemd-umount "$WORK_DIR/simple.img"
 
 # --owner + vfat