From: Frantisek Sumsal Date: Tue, 8 Nov 2022 11:01:13 +0000 (+0100) Subject: test: fix a race in the systemd-mount test X-Git-Tag: v253-rc1~574^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9ffa095e461b4456dc44aa46616e9bc1c061ed87;p=thirdparty%2Fsystemd.git test: fix a race in the systemd-mount test Where we might check the automount unit before systemd has a chance to react. --- diff --git a/test/units/testsuite-74.mount.sh b/test/units/testsuite-74.mount.sh index 33322fc7722..32bdb3037fb 100755 --- a/test/units/testsuite-74.mount.sh +++ b/test/units/testsuite-74.mount.sh @@ -99,8 +99,8 @@ systemctl status "$(systemd-escape --path "$WORK_DIR/mnt").automount" # Disassemble the underlying block device losetup -d "$LOOP" unset LOOP -# The automount unit should be gone at this point -(! systemctl status "$(systemd-escape --path "$WORK_DIR/mnt").automount") +# The automount unit should disappear once the underlying blockdev is gone +timeout 10s bash -c "while systemctl status '$(systemd-escape --path "$WORK_DIR/mnt").automount)'; do sleep .2; done" # Mount a disk image systemd-mount "$WORK_DIR/simple.img"