summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2023-03-18 21:44:56 +0000
committerPádraig Brady <P@draigBrady.com>2023-03-19 12:23:05 +0000
commit82bb131c551039971d6668dedc1975a770df88b9 (patch)
treea23dad00ca44335259d25d6ac83d170b018cd64c
parent11f4d591383f4c89d8bf5970db703cbd0e4a174d (diff)
downloadcoreutils-82bb131c551039971d6668dedc1975a770df88b9.tar.gz
tests: df: avoid false failure on systems with multiple roots
* tests/df/df-symlink.sh: Skip the test on systems with multiple file system roots.
-rwxr-xr-xtests/df/df-symlink.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/df/df-symlink.sh b/tests/df/df-symlink.sh
index 34e8a8fed..1b24429a6 100755
--- a/tests/df/df-symlink.sh
+++ b/tests/df/df-symlink.sh
@@ -30,14 +30,17 @@ df --out=source,target symlink > out || fail=1
compare exp out || fail=1
# Ensure we output the same values for device nodes and '.'
-# This was not the case in coreutil-8.22 on systems
+# This was not the case in coreutils-8.22 on systems
# where the device in the mount list was a symlink itself.
# I.e., '.' => /dev/mapper/fedora-home -> /dev/dm-2
# Restrict this test to systems with a 1:1 mapping between
# source and target. This excludes for example BTRFS sub-volumes.
if test "$(df --output=source | grep -F "$file_system" | wc -l)" = 1; then
- df --out=source,target '.' > out || fail=1
- compare exp out || fail=1
+ # Restrict to systems with a single file system root (and have findmnt(1))
+ if test "$(findmnt -nro FSROOT | uniq | wc -l)" = 1; then
+ df --out=source,target '.' > out || fail=1
+ compare exp out || fail=1
+ fi
fi
test "$fail" = 1 && dump_mount_list_