diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-05-08 11:21:42 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2024-05-08 11:35:15 +0200 |
commit | a35edc9ad458c0ca3fa4f5435c4ceb2865a9de30 (patch) | |
tree | 291db83faeecb3705769498ffacf8e386542e114 | |
parent | TEST-07-PID1: Fix race in aux-scope subtest (diff) | |
download | systemd-a35edc9ad458c0ca3fa4f5435c4ceb2865a9de30.tar.xz systemd-a35edc9ad458c0ca3fa4f5435c4ceb2865a9de30.zip |
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)
-rwxr-xr-x | test/units/testsuite-74.mount.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/units/testsuite-74.mount.sh b/test/units/testsuite-74.mount.sh index 594c123e1b..57b06bb005 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" |