From ad09be9443467915d6cdd6a3ce482178db9fde84 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Thu, 28 Sep 2023 18:08:38 +0200 Subject: [PATCH] tests: Skip test when host /mnt is a symlink The test wants to mount /tmp on /mnt but /mnt comes from the host and can be a symlink in which case the test fails. Skip the test in this situation. Signed-off-by: Sebastian Wick --- tests/test-run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-run.sh b/tests/test-run.sh index a90f0b1..f0503e7 100755 --- a/tests/test-run.sh +++ b/tests/test-run.sh @@ -264,12 +264,12 @@ if command -v mktemp > /dev/null; then $BWRAP --bind / / --bind /tmp /tmp cat "$tempfile" > stdout assert_file_has_content stdout hello echo "ok - bind-mount of /tmp exposes real /tmp" - if [ -d /mnt ]; then + if [ -d /mnt ] && [ ! -L /mnt ]; then $BWRAP --bind / / --bind /tmp /mnt cat "/mnt/${tempfile#/tmp/}" > stdout assert_file_has_content stdout hello echo "ok - bind-mount of /tmp onto /mnt exposes real /tmp" else - echo "ok - # SKIP /mnt does not exist" + echo "ok - # SKIP /mnt does not exist or is a symlink" fi else echo "ok - # SKIP mktemp not found"