From bf0f99be20ce4097c1f44da024dc6131e718d86e Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 21 Oct 2022 09:55:46 -0400 Subject: 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. --- tests/gnu/inum_automount.out | 2 +- tests/gnu/inum_automount.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/gnu/inum_automount.out b/tests/gnu/inum_automount.out index 99c7511..7b53ae3 100644 --- a/tests/gnu/inum_automount.out +++ b/tests/gnu/inum_automount.out @@ -1 +1 @@ -scratch/mnt +scratch/automnt 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)) -- cgit v1.2.3