summaryrefslogtreecommitdiff
path: root/tests/du/hard-link
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-03-14 06:54:37 +0000
committerJim Meyering <jim@meyering.net>2003-03-14 06:54:37 +0000
commitb38d8f4a44ceb291a50dd5d33bd49984e2808d0f (patch)
treea37110f05fc04e59fdcd632fb3067d686be4c5bf /tests/du/hard-link
parent4f6b47eb0b0ea76c53f94409bc34eafa596d3706 (diff)
downloadcoreutils-b38d8f4a44ceb291a50dd5d33bd49984e2808d0f.tar.xz
Transform output from first du, so that this
test doesn't fail on file systems like tmpfs that order directory entries differently.
Diffstat (limited to 'tests/du/hard-link')
-rwxr-xr-xtests/du/hard-link8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/du/hard-link b/tests/du/hard-link
index 5de5d81da..6d0d71117 100755
--- a/tests/du/hard-link
+++ b/tests/du/hard-link
@@ -30,13 +30,17 @@ fi
fail=0
+# Note that for this first test, we transform f1 or f2
+# (whichever name we find first) to f_. That is necessary because,
+# depending on the type of file system, du could encounter either of those
+# two hard-linked files first, thus listing that one and not the other.
du -a --exclude=sub dir \
- | sed 's/^[0-9][0-9]* //' > out || fail=1
+ | sed 's/^[0-9][0-9]* //' | sed 's/f[12]/f_/' > out || fail=1
echo === >> out
du -a --exclude=sub --count-links dir \
| sed 's/^[0-9][0-9]* //' | sort -r >> out || fail=1
cat <<\EOF > exp
-dir/f1
+dir/f_
dir
===
dir/f2