diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-10-21 09:55:46 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-10-21 09:55:46 -0400 |
commit | bf0f99be20ce4097c1f44da024dc6131e718d86e (patch) | |
tree | 6c6c51c6f624ae30db494784713a31c67a03e8d2 /tests/gnu/inum_automount.sh | |
parent | 62de5e2bc9a39b189a84ff0691efeb8518f1688a (diff) | |
download | bfs-bf0f99be20ce4097c1f44da024dc6131e718d86e.tar.xz |
tests/gnu/inum_automount: Work around systemd-mount race
This test used systemd-mount to set up an automount on scratch/mnt.
If a previous test mounted something there, systemd will notice that
asynchronously and may not have noticed the unmount by the time that test
runs. This led to the test randomly being skipped sometimes when
systemd-mount failed. It could be reproduced with a loop like this:
$ for _ in {1..10}; ./tests/tests.sh common/L_mount gnu/inum_automount
Work around it by using scratch/automnt instead to avoid conflicts.
Diffstat (limited to 'tests/gnu/inum_automount.sh')
-rw-r--r-- | tests/gnu/inum_automount.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/gnu/inum_automount.sh b/tests/gnu/inum_automount.sh index 82f85d2..648ea05 100644 --- a/tests/gnu/inum_automount.sh +++ b/tests/gnu/inum_automount.sh @@ -4,14 +4,14 @@ skip_unless test "$SUDO" skip_unless command -v systemd-mount &>/dev/null clean_scratch -mkdir scratch/{foo,mnt} -skip_unless sudo systemd-mount -A -o bind basic scratch/mnt +mkdir scratch/{foo,automnt} +skip_unless sudo systemd-mount -A -o bind basic scratch/automnt -before=$(inum scratch/mnt) +before=$(inum scratch/automnt) bfs_diff scratch -inum "$before" -prune ret=$? -after=$(inum scratch/mnt) +after=$(inum scratch/automnt) -sudo systemd-umount scratch/mnt +sudo systemd-umount scratch/automnt ((ret == 0 && before == after)) |