summaryrefslogtreecommitdiff
path: root/tests/du
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-10-30 10:50:21 +0100
committerJim Meyering <meyering@redhat.com>2009-10-30 12:50:12 +0100
commit3c88587b2eadee11413f4207abbbf13af07c438d (patch)
tree79d45c03b5c6ba2520eeeb236170dbafef49fac7 /tests/du
parent12a0a583f6fe3303bd9dfb30de4a5fe46e8e486f (diff)
downloadcoreutils-3c88587b2eadee11413f4207abbbf13af07c438d.tar.xz
tests: factor 350 fail=0 initializations into test-lib.sh
Run this command to remove the factored-out "fail=0" lines. perl -ni -e '/^fail=0$/ or print' $(g grep -l '^fail=0$') * tests/test-lib.sh: Initialize fail=0 here, not in 300+ scripts. * tests/...: nearly all bourne shell scripts Suggested by Eric Blake.
Diffstat (limited to 'tests/du')
-rwxr-xr-xtests/du/2g1
-rwxr-xr-xtests/du/8gb1
-rwxr-xr-xtests/du/basic1
-rwxr-xr-xtests/du/deref1
-rwxr-xr-xtests/du/deref-args1
-rwxr-xr-xtests/du/exclude1
-rwxr-xr-xtests/du/fd-leak1
-rwxr-xr-xtests/du/hard-link1
-rwxr-xr-xtests/du/inacc-dest1
-rwxr-xr-xtests/du/inacc-dir1
-rwxr-xr-xtests/du/inaccessible-cwd1
-rwxr-xr-xtests/du/long-from-unreadable1
-rwxr-xr-xtests/du/long-sloop1
-rwxr-xr-xtests/du/no-deref1
-rwxr-xr-xtests/du/no-x1
-rwxr-xr-xtests/du/one-file-system1
-rwxr-xr-xtests/du/restore-wd1
-rwxr-xr-xtests/du/slash1
-rwxr-xr-xtests/du/slink1
-rwxr-xr-xtests/du/trailing-slash1
-rwxr-xr-xtests/du/two-args1
21 files changed, 0 insertions, 21 deletions
diff --git a/tests/du/2g b/tests/du/2g
index 4981efba8..4dc9fe03d 100755
--- a/tests/du/2g
+++ b/tests/du/2g
@@ -28,7 +28,6 @@ fi
# Creating a 2GB file counts as `very expensive'.
very_expensive_
-fail=0
# Get number of free kilobytes on current partition, so we can
# skip this test if there is insufficient free space.
diff --git a/tests/du/8gb b/tests/du/8gb
index 1812d16a9..a9779c62a 100755
--- a/tests/du/8gb
+++ b/tests/du/8gb
@@ -44,7 +44,6 @@ possibly because this system's NFS support is buggy
Consider rerunning this test on a different file system."
fi
-fail=0
# This would print `0 big' with coreutils-4.5.8.
du -ab big > out || fail=1
diff --git a/tests/du/basic b/tests/du/basic
index 5714e5720..38253bd04 100755
--- a/tests/du/basic
+++ b/tests/du/basic
@@ -32,7 +32,6 @@ printf '%*s' 257 make-sure-the-file-is-non-empty > a/b/F || framework_failure
printf %4096s x > d/1
cp d/1 d/sub/2
-fail=0
B=`stat --format=%B a/b/F`
diff --git a/tests/du/deref b/tests/du/deref
index cb23cc124..3d7fe031d 100755
--- a/tests/du/deref
+++ b/tests/du/deref
@@ -28,7 +28,6 @@ mkdir -p a/sub || framework_failure
ln -s a/sub slink || framework_failure
touch b || framework_failure
-fail=0
# This used to fail with the following diagnostic:
# du: `b': No such file or directory
diff --git a/tests/du/deref-args b/tests/du/deref-args
index ce02807fc..7ed7d40da 100755
--- a/tests/du/deref-args
+++ b/tests/du/deref-args
@@ -29,7 +29,6 @@ ln -s dir slink || framework_failure
printf %65536s x > 64k || framework_failure
ln -s 64k slink-to-64k || framework_failure
-fail=0
du -D slink | sed 's/^[0-9][0-9]* //' > out
# Ensure that the trailing slash is preserved and handled properly.
diff --git a/tests/du/exclude b/tests/du/exclude
index 15dd9a6ca..12c1ef428 100755
--- a/tests/du/exclude
+++ b/tests/du/exclude
@@ -25,7 +25,6 @@ fi
mkdir -p a/b/c a/x/y a/u/v || framework_failure
-fail=0
du --exclude=x a | sed 's/^[0-9][0-9]* //' | sort > out || fail=1
printf '===\n' >> out
diff --git a/tests/du/fd-leak b/tests/du/fd-leak
index c280b884e..fd53f1f52 100755
--- a/tests/du/fd-leak
+++ b/tests/du/fd-leak
@@ -40,7 +40,6 @@ done
# This may fail due to command line limitations.
touch $f || framework_failure
-fail=0
# With coreutils-5.0, this would fail due to a file descriptor leak.
du $f > out || fail=1
diff --git a/tests/du/hard-link b/tests/du/hard-link
index d9dd247d0..fe4ae19bc 100755
--- a/tests/du/hard-link
+++ b/tests/du/hard-link
@@ -28,7 +28,6 @@ fi
mkdir -p dir/sub
( cd dir && { echo non-empty > f1; ln f1 f2; echo non-empty > sub/F; } )
-fail=0
# Note that for this first test, we transform f1 or f2
# (whichever name we find first) to f_. That is necessary because,
diff --git a/tests/du/inacc-dest b/tests/du/inacc-dest
index 337319583..fe65fca02 100755
--- a/tests/du/inacc-dest
+++ b/tests/du/inacc-dest
@@ -28,7 +28,6 @@ skip_if_root_
mkdir f && cd f && mkdir a b c d e && touch c/j && chmod a-x c \
|| framework_failure
-fail=0
du > ../t 2>&1 && fail=1
# Accept either of the following outputs.
diff --git a/tests/du/inacc-dir b/tests/du/inacc-dir
index 030a40a22..dde790322 100755
--- a/tests/du/inacc-dir
+++ b/tests/du/inacc-dir
@@ -25,7 +25,6 @@ skip_if_root_
mkdir -p a/sub || framework_failure
-fail=0
du -s a > exp || fail=1
chmod 0 a/sub || fail=1
diff --git a/tests/du/inaccessible-cwd b/tests/du/inaccessible-cwd
index 05f9b2f9c..0f36b0c68 100755
--- a/tests/du/inaccessible-cwd
+++ b/tests/du/inaccessible-cwd
@@ -33,7 +33,6 @@ mkdir -p no-x a/b || framework_failure
cd no-x || framework_failure
chmod 0 . || framework_failure
-fail=0
du "$cwd/a" > /dev/null || fail=1
diff --git a/tests/du/long-from-unreadable b/tests/du/long-from-unreadable
index 68ec61362..c87d3b516 100755
--- a/tests/du/long-from-unreadable
+++ b/tests/du/long-from-unreadable
@@ -65,7 +65,6 @@ mkdir inaccessible || framework_failure
cd inaccessible || framework_failure
chmod 0 . || framework_failure
-fail=0
du -s "$cwd/$dir" > /dev/null || fail=1
Exit $fail
diff --git a/tests/du/long-sloop b/tests/du/long-sloop
index f62441970..99f7a1578 100755
--- a/tests/du/long-sloop
+++ b/tests/du/long-sloop
@@ -62,7 +62,6 @@ cat $file > /dev/null 2> err &&
in file name resolution'
too_many=`sed 's/.*: //' err`
-fail=0
# With coreutils-5.93 there was no failure.
# With coreutils-5.94 we get the desired diagnostic:
diff --git a/tests/du/no-deref b/tests/du/no-deref
index 9ea8df328..9b2927012 100755
--- a/tests/du/no-deref
+++ b/tests/du/no-deref
@@ -26,7 +26,6 @@ fi
mkdir -p dir/a/b || framework_failure
ln -s dir slink || framework_failure
-fail=0
du slink | sed 's/^[0-9][0-9]* //' > out
cat <<\EOF > exp
diff --git a/tests/du/no-x b/tests/du/no-x
index 986689a68..3d24572bb 100755
--- a/tests/du/no-x
+++ b/tests/du/no-x
@@ -28,7 +28,6 @@ skip_if_root_
mkdir -p d/no-x/y || framework_failure
chmod u=rw d/no-x || framework_failure
-fail=0
# This must exit nonzero.
du d >/dev/null 2>out && fail=1
diff --git a/tests/du/one-file-system b/tests/du/one-file-system
index 0f95fe9d3..1d395c42e 100755
--- a/tests/du/one-file-system
+++ b/tests/du/one-file-system
@@ -26,7 +26,6 @@ fi
mkdir -p b/c y/z || framework_failure
-fail=0
# Due to a used-uninitialized variable, the "du -x" from coreutils-6.6
# would not traverse into second and subsequent directories listed
diff --git a/tests/du/restore-wd b/tests/du/restore-wd
index cbe147abf..fcaf1f3f1 100755
--- a/tests/du/restore-wd
+++ b/tests/du/restore-wd
@@ -26,7 +26,6 @@ fi
mkdir a b || framework_failure
-fail=0
# With du from coreutils-4.5.5 and 4.5.6, this would fail with
# du: `b': No such file or directory
diff --git a/tests/du/slash b/tests/du/slash
index aac17183d..826a70f66 100755
--- a/tests/du/slash
+++ b/tests/du/slash
@@ -24,7 +24,6 @@ fi
. $srcdir/test-lib.sh
require_readable_root_
-fail=0
du --exclude='[^/]*' -x / > out-t || fail=1
sed 's/^[0-9][0-9]* //' out-t > out
diff --git a/tests/du/slink b/tests/du/slink
index 3653067d6..45bd17e46 100755
--- a/tests/du/slink
+++ b/tests/du/slink
@@ -45,7 +45,6 @@ if df --type=nfsv3 . >/dev/null 2>&1; then
skip_test_ "\`.' is on an NFS file system"
fi
-fail=0
symlink_name_lengths='1 15 16 31 32 59 60 63 64 127 128 255 256 511 512 1024'
for len in $symlink_name_lengths; do
name=`seq 1 $len|tr -c x y |head -c$len`
diff --git a/tests/du/trailing-slash b/tests/du/trailing-slash
index 997bc057d..10244630b 100755
--- a/tests/du/trailing-slash
+++ b/tests/du/trailing-slash
@@ -29,7 +29,6 @@ fi
mkdir -p dir/1/2 || framework_failure
ln -s dir slink || framework_failure
-fail=0
du slink/ | sed 's/^[0-9][0-9]* //' > out
echo === >> out
diff --git a/tests/du/two-args b/tests/du/two-args
index f59ca7398..e5ddb2b53 100755
--- a/tests/du/two-args
+++ b/tests/du/two-args
@@ -33,7 +33,6 @@ cd sub || framework_failure
t=t
mkdir -p $t/1 $t/2 || framework_failure
-fail=0
test -d $t || fail=1
du $t/1 $t/2 > /dev/null || fail=1