summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2016-01-16 13:34:07 +0000
committerPádraig Brady <P@draigBrady.com>2016-01-16 13:36:57 +0000
commit2a5494271c3ffa371cdc8773cd12682f3d5c678f (patch)
treecd0592428cd22f23a2a0f44aea90fe92b4fc4e41 /tests
parent0d60653001d0fd56b36507ad00615bef18dc95a9 (diff)
downloadcoreutils-2a5494271c3ffa371cdc8773cd12682f3d5c678f.tar.xz
tests: avoid false failure with BTRFS subvolumes
* tests/df/df-symlink.sh: Only check the symmetry of the source <-> target lookup, when the source is only mounted once, which isn't the case if '.' is a BTRFS subvolume for example. Reported by Assaf Gordon on a default OpenSUSE 42.1 install.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/df/df-symlink.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/df/df-symlink.sh b/tests/df/df-symlink.sh
index ed4c7882c..a9d8c9623 100755
--- a/tests/df/df-symlink.sh
+++ b/tests/df/df-symlink.sh
@@ -32,7 +32,11 @@ compare exp out || fail=1
# This was not the case in coreutil-8.22 on systems
# where the device in the mount list was a symlink itself.
# I.e., '.' => /dev/mapper/fedora-home -> /dev/dm-2
-df --out=source,target '.' > out || fail=1
-compare exp out || fail=1
+# 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 "$disk" | wc -l)" = 1; then
+ df --out=source,target '.' > out || fail=1
+ compare exp out || fail=1
+fi
Exit $fail