summaryrefslogtreecommitdiff
path: root/tests/du
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-10-18 13:09:45 +0000
committerJim Meyering <jim@meyering.net>2003-10-18 13:09:45 +0000
commit5e54e08bbf3c884b2a082477f84aa31f936e2ebf (patch)
tree13b34ca88b558fd4c86e2f36414621bccb1a4502 /tests/du
parent672f1510e15d2a59026a83080d5c5dde4cb11bf7 (diff)
downloadcoreutils-5e54e08bbf3c884b2a082477f84aa31f936e2ebf.tar.xz
Ensure that du -D now dereferences all
symlinks specified on the command line, not just those that reference directories.
Diffstat (limited to 'tests/du')
-rwxr-xr-xtests/du/deref-args8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/du/deref-args b/tests/du/deref-args
index 4b6588ef2..8698f9d66 100755
--- a/tests/du/deref-args
+++ b/tests/du/deref-args
@@ -17,6 +17,8 @@ mkdir -p $tmp || framework_failure=1
cd $tmp || framework_failure=1
mkdir -p dir/a
ln -s dir slink
+seq --format=%100g 900 | head --bytes=64k > 64k
+ln -s 64k slink-to-64k
if test $framework_failure = 1; then
echo "$0: failure in testing framework" 1>&2
@@ -28,11 +30,17 @@ fail=0
du -D slink | sed 's/^[0-9][0-9]* //' > out
# Ensure that the trailing slash is preserved and handled properly.
du -D slink/ | sed 's/^[0-9][0-9]* //' >> out
+
+# Ensure that -D makes du dereference even symlinks to non-directories.
+# The sed command maps the 68 I get on an ext3 file system to the 64 I expected.
+# On tmpfs, I get 64.
+du -kD slink-to-64k | sed 's/^6[0-9]/64/' >> out
cat <<\EOF > exp
slink/a
slink
slink/a
slink/
+64 slink-to-64k
EOF
cmp out exp || fail=1