From: Yu Watanabe Date: Tue, 21 May 2024 10:10:49 +0000 (+0900) Subject: test: wait for loop/backing_file attribute being removed X-Git-Tag: v256-rc3~13^2~1 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=e504f5a33979c896213f2fb53217b14263cfe036;p=systemd%2F.git test: wait for loop/backing_file attribute being removed Hopefully fixes issue like https://github.com/systemd/systemd/issues/32680#issuecomment-2120959238 https://github.com/systemd/systemd/issues/32680#issuecomment-2122074805 --- diff --git a/test/units/TEST-74-AUX-UTILS.mount.sh b/test/units/TEST-74-AUX-UTILS.mount.sh index 5bba5a3ac5..98c388a272 100755 --- a/test/units/TEST-74-AUX-UTILS.mount.sh +++ b/test/units/TEST-74-AUX-UTILS.mount.sh @@ -145,7 +145,12 @@ 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)" +LOOP_AUTO=$(systemd-mount --list --full --no-legend | awk '$6 == "sd-mount-test" { print $1 }') +LOOP_AUTO_DEVPATH=$(udevadm info --query property --property DEVPATH --value "$LOOP_AUTO") systemd-umount "$WORK_DIR/simple.img" +# Wait for 'change' uevent for the device with DISK_MEDIA_CHANGE=1. +# After the event, the backing_file attribute should be removed. +timeout 60 bash -c "while [[ -e /sys/$LOOP_AUTO_DEVPATH/loop/backing_file ]]; do sleep 1; done" # --owner + vfat #