From: Daan De Meyer Date: Wed, 8 May 2024 09:21:42 +0000 (+0200) Subject: TEST-74-AUX-UTILS: Make more robust X-Git-Tag: v256-rc2~72^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a35edc9ad458c0ca3fa4f5435c4ceb2865a9de30;p=thirdparty%2Fsystemd.git TEST-74-AUX-UTILS: Make more robust Let's run mkfs on the file we create instead of the loop device and let's use udevadm wait --settle to wait for udev to settle before doing anything with the loop device Fixes #32680 (hopefully) --- diff --git a/test/units/testsuite-74.mount.sh b/test/units/testsuite-74.mount.sh index 594c123e1ba..57b06bb005b 100755 --- a/test/units/testsuite-74.mount.sh +++ b/test/units/testsuite-74.mount.sh @@ -32,8 +32,9 @@ systemd-mount --list --quiet # Set up a simple block device for further tests dd if=/dev/zero of="$WORK_DIR/simple.img" bs=1M count=16 +mkfs.ext4 -L sd-mount-test "$WORK_DIR/simple.img" LOOP="$(losetup --show --find "$WORK_DIR/simple.img")" -mkfs.ext4 -L sd-mount-test "$LOOP" +udevadm wait --timeout 60 --settle "$LOOP" mkdir "$WORK_DIR/mnt" mount "$LOOP" "$WORK_DIR/mnt" touch "$WORK_DIR/mnt/foo.bar" @@ -130,8 +131,9 @@ systemd-umount "$WORK_DIR/simple.img" # Create a vfat image, as ext4 doesn't support uid=/gid= fixating for all # files/directories dd if=/dev/zero of="$WORK_DIR/owner-vfat.img" bs=1M count=16 +mkfs.vfat -n owner-vfat "$WORK_DIR/owner-vfat.img" LOOP="$(losetup --show --find "$WORK_DIR/owner-vfat.img")" -mkfs.vfat -n owner-vfat "$LOOP" +udevadm wait --timeout 60 --settle "$LOOP" # Mount it and check the UID/GID [[ "$(stat -c "%U:%G" "$WORK_DIR/mnt")" == "root:root" ]] systemd-mount --owner=testuser "$LOOP" "$WORK_DIR/mnt"