summaryrefslogtreecommitdiff
path: root/tests/misc
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/misc
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/misc')
-rwxr-xr-xtests/misc/arch1
-rwxr-xr-xtests/misc/cat-buf1
-rwxr-xr-xtests/misc/cat-proc1
-rwxr-xr-xtests/misc/chcon1
-rwxr-xr-xtests/misc/chcon-fail1
-rwxr-xr-xtests/misc/chroot-credentials1
-rwxr-xr-xtests/misc/chroot-fail1
-rwxr-xr-xtests/misc/close-stdout1
-rwxr-xr-xtests/misc/csplit1
-rwxr-xr-xtests/misc/date-sec1
-rwxr-xr-xtests/misc/df-P1
-rwxr-xr-xtests/misc/env1
-rwxr-xr-xtests/misc/env-null1
-rwxr-xr-xtests/misc/false-status1
-rwxr-xr-xtests/misc/fmt-long-line1
-rwxr-xr-xtests/misc/groups-dash1
-rwxr-xr-xtests/misc/groups-version1
-rwxr-xr-xtests/misc/head-c1
-rwxr-xr-xtests/misc/head-pos1
-rwxr-xr-xtests/misc/help-version1
-rwxr-xr-xtests/misc/id-context1
-rwxr-xr-xtests/misc/id-groups1
-rwxr-xr-xtests/misc/ls-time1
-rwxr-xr-xtests/misc/md5sum-parallel1
-rwxr-xr-xtests/misc/mknod1
-rwxr-xr-xtests/misc/nice1
-rwxr-xr-xtests/misc/nice-fail1
-rwxr-xr-xtests/misc/nl1
-rwxr-xr-xtests/misc/nohup1
-rwxr-xr-xtests/misc/od-N1
-rwxr-xr-xtests/misc/od-multiple-t1
-rwxr-xr-xtests/misc/od-x81
-rwxr-xr-xtests/misc/pathchk11
-rwxr-xr-xtests/misc/printenv1
-rwxr-xr-xtests/misc/printf1
-rwxr-xr-xtests/misc/printf-hex1
-rwxr-xr-xtests/misc/printf-surprise1
-rwxr-xr-xtests/misc/ptx-overrun1
-rwxr-xr-xtests/misc/pwd-option1
-rwxr-xr-xtests/misc/pwd-unreadable-parent1
-rwxr-xr-xtests/misc/readlink-fp-loop1
-rwxr-xr-xtests/misc/runcon-no-reorder1
-rwxr-xr-xtests/misc/selinux1
-rwxr-xr-xtests/misc/seq-long-double1
-rwxr-xr-xtests/misc/shred-exact1
-rwxr-xr-xtests/misc/shred-passes1
-rwxr-xr-xtests/misc/shred-remove1
-rwxr-xr-xtests/misc/shuf1
-rwxr-xr-xtests/misc/sort-compress1
-rwxr-xr-xtests/misc/sort-continue1
-rwxr-xr-xtests/misc/sort-merge-fdlimit1
-rwxr-xr-xtests/misc/sort-rand1
-rwxr-xr-xtests/misc/sort-version1
-rwxr-xr-xtests/misc/split-a1
-rwxr-xr-xtests/misc/split-fail1
-rwxr-xr-xtests/misc/split-l1
-rwxr-xr-xtests/misc/stat-fmt1
-rwxr-xr-xtests/misc/stat-hyphen1
-rwxr-xr-xtests/misc/stat-slash1
-rwxr-xr-xtests/misc/stdbuf1
-rwxr-xr-xtests/misc/stty1
-rwxr-xr-xtests/misc/stty-invalid1
-rwxr-xr-xtests/misc/stty-row-col1
-rwxr-xr-xtests/misc/su-fail1
-rwxr-xr-xtests/misc/sum-sysv1
-rwxr-xr-xtests/misc/tac-continue1
-rwxr-xr-xtests/misc/tee1
-rwxr-xr-xtests/misc/tee-dash1
-rwxr-xr-xtests/misc/timeout1
-rwxr-xr-xtests/misc/timeout-parameters1
-rwxr-xr-xtests/misc/truncate-dangling-symlink1
-rwxr-xr-xtests/misc/truncate-fail-diag1
-rwxr-xr-xtests/misc/truncate-fifo1
-rwxr-xr-xtests/misc/truncate-no-create-missing1
-rwxr-xr-xtests/misc/truncate-overflow1
-rwxr-xr-xtests/misc/truncate-owned-by-other1
-rwxr-xr-xtests/misc/truncate-parameters1
-rwxr-xr-xtests/misc/truncate-relative1
-rwxr-xr-xtests/misc/wc-files01
-rwxr-xr-xtests/misc/xattr1
80 files changed, 0 insertions, 80 deletions
diff --git a/tests/misc/arch b/tests/misc/arch
index 04bce0e1a..4e7ab0a27 100755
--- a/tests/misc/arch
+++ b/tests/misc/arch
@@ -24,7 +24,6 @@ if test "$VERBOSE" = yes; then
arch --version
fi
-fail=0
arch > out || fail=1
uname -m > exp || fail=1
diff --git a/tests/misc/cat-buf b/tests/misc/cat-buf
index 11d553a2b..34567a52b 100755
--- a/tests/misc/cat-buf
+++ b/tests/misc/cat-buf
@@ -30,7 +30,6 @@ fi
# write separately.
mkfifo fifo || framework_failure
-fail=0
echo 1 > exp
diff --git a/tests/misc/cat-proc b/tests/misc/cat-proc
index 8c1998726..3fac2d021 100755
--- a/tests/misc/cat-proc
+++ b/tests/misc/cat-proc
@@ -29,7 +29,6 @@ f=/proc/cpuinfo
test -f $f \
|| skip_test_ "no $f"
-fail=0
# Yes, parts of /proc/cpuinfo might change between cat runs.
# If that happens, consider choosing a file that's less likely to change,
diff --git a/tests/misc/chcon b/tests/misc/chcon
index 723bfd0f3..417163d27 100755
--- a/tests/misc/chcon
+++ b/tests/misc/chcon
@@ -14,7 +14,6 @@ skip_if_mcstransd_is_running_
mkdir -p d/sub/s2 || framework_failure
touch f g d/sub/1 d/sub/2 || framework_failure
-fail=0
# Set to a specified context.
# Use root:object_r:tmp_t:s0. It is special in that
diff --git a/tests/misc/chcon-fail b/tests/misc/chcon-fail
index a9efbff75..148549a87 100755
--- a/tests/misc/chcon-fail
+++ b/tests/misc/chcon-fail
@@ -9,7 +9,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
# neither context nor file
chcon 2> /dev/null && fail=1
diff --git a/tests/misc/chroot-credentials b/tests/misc/chroot-credentials
index f200f14ab..c06da55d7 100755
--- a/tests/misc/chroot-credentials
+++ b/tests/misc/chroot-credentials
@@ -26,7 +26,6 @@ fi
require_root_
-fail=0
# Verify that root credentials are kept.
test $(chroot / whoami) = root || fail=1
diff --git a/tests/misc/chroot-fail b/tests/misc/chroot-fail
index 877ad0aec..38fd2844f 100755
--- a/tests/misc/chroot-fail
+++ b/tests/misc/chroot-fail
@@ -24,7 +24,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
# These tests verify exact status of internal failure; since none of
# them actually run a command, we don't need root privileges
diff --git a/tests/misc/close-stdout b/tests/misc/close-stdout
index fe911d8a9..fec1addc8 100755
--- a/tests/misc/close-stdout
+++ b/tests/misc/close-stdout
@@ -26,7 +26,6 @@ fi
p=$abs_top_builddir
-fail=0
# Ensure these exit successfully, even though stdout is closed,
# because they generate no output.
diff --git a/tests/misc/csplit b/tests/misc/csplit
index e4ba20e79..bf3865e49 100755
--- a/tests/misc/csplit
+++ b/tests/misc/csplit
@@ -23,7 +23,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
# csplit could get a failed assertion to 2.0.17
(echo a; echo; echo) > in
diff --git a/tests/misc/date-sec b/tests/misc/date-sec
index ff19408ca..c3d2f8130 100755
--- a/tests/misc/date-sec
+++ b/tests/misc/date-sec
@@ -26,7 +26,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
# It would be easier simply to sleep for two seconds between two runs
# of `date --date="21:04 +0100" +%S` and ensure that both outputs
diff --git a/tests/misc/df-P b/tests/misc/df-P
index dcfeaa5a2..99d200ed7 100755
--- a/tests/misc/df-P
+++ b/tests/misc/df-P
@@ -23,7 +23,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
df -P . > t1 || fail=1
BLOCK_SIZE=1M df -P . > t2 || fail=1
diff --git a/tests/misc/env b/tests/misc/env
index fb3be2994..ab6ee76d1 100755
--- a/tests/misc/env
+++ b/tests/misc/env
@@ -24,7 +24,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
# Verify clearing the environment
a=1
diff --git a/tests/misc/env-null b/tests/misc/env-null
index 432c6594e..031fbb076 100755
--- a/tests/misc/env-null
+++ b/tests/misc/env-null
@@ -25,7 +25,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
# POSIX is clear that environ may, but need not be, sorted.
# Environment variable values may contain newlines, which cannot be
diff --git a/tests/misc/false-status b/tests/misc/false-status
index 6b80f3b9e..5562230ea 100755
--- a/tests/misc/false-status
+++ b/tests/misc/false-status
@@ -23,7 +23,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
false --version > /dev/null && fail=1
false --help > /dev/null && fail=1
diff --git a/tests/misc/fmt-long-line b/tests/misc/fmt-long-line
index bcabd9946..561a7534d 100755
--- a/tests/misc/fmt-long-line
+++ b/tests/misc/fmt-long-line
@@ -57,7 +57,6 @@ cat <<\EOF > exp || framework_failure
y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y y
EOF
-fail=0
fmt -s in > out || fail=1
diff --git a/tests/misc/groups-dash b/tests/misc/groups-dash
index b2cb3bc45..05cb6ddf8 100755
--- a/tests/misc/groups-dash
+++ b/tests/misc/groups-dash
@@ -26,7 +26,6 @@ require_built_ groups
# Coreutils 6.9 and earlier failed to display information on first argument
# if later argument was --.
-fail=0
groups none -- > out 2>&1 && fail=1
echo $? >> out
groups -- none -- > exp 2>&1 && fail=1
diff --git a/tests/misc/groups-version b/tests/misc/groups-version
index 41e3c7167..f39fe43be 100755
--- a/tests/misc/groups-version
+++ b/tests/misc/groups-version
@@ -24,7 +24,6 @@ fi
. $srcdir/test-lib.sh
require_built_ groups
-fail=0
groups --version | sed 's/^groups/id/; /^$/q' > out || fail=1
id --version | sed '/^$/q' > exp || fail=1
diff --git a/tests/misc/head-c b/tests/misc/head-c
index a93e2cecc..06bd1ccd6 100755
--- a/tests/misc/head-c
+++ b/tests/misc/head-c
@@ -25,7 +25,6 @@ fi
echo abc > in || framework_failure
-fail=0
(head -c1; head -c1) < in > out || fail=1
case "`cat out`" in
ab) ;;
diff --git a/tests/misc/head-pos b/tests/misc/head-pos
index a3aba32db..a40c76214 100755
--- a/tests/misc/head-pos
+++ b/tests/misc/head-pos
@@ -26,7 +26,6 @@ fi
(echo a; echo b) > in || framework_failure
-fail=0
(head -n 1 >/dev/null; cat) < in > out || fail=1
cat <<EOF > exp
b
diff --git a/tests/misc/help-version b/tests/misc/help-version
index da559070f..602835602 100755
--- a/tests/misc/help-version
+++ b/tests/misc/help-version
@@ -43,7 +43,6 @@ expected_failure_status_dir=2
expected_failure_status_ls=2
expected_failure_status_vdir=2
-fail=0
test "$built_programs" \
|| { echo "$this_test: no programs built!?!" 1>&2; Exit $fail; }
diff --git a/tests/misc/id-context b/tests/misc/id-context
index c6c5e8920..4ccf3358b 100755
--- a/tests/misc/id-context
+++ b/tests/misc/id-context
@@ -24,7 +24,6 @@ fi
# Require selinux - when selinux is disabled, id never prints scontext.
require_selinux_
-fail=0
# Check without specified user, context string should be present.
id | grep context= >/dev/null || fail=1
diff --git a/tests/misc/id-groups b/tests/misc/id-groups
index dc0f54c29..83924ef77 100755
--- a/tests/misc/id-groups
+++ b/tests/misc/id-groups
@@ -22,7 +22,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
id -G $(id -nu) || fail=1
Exit $fail
diff --git a/tests/misc/ls-time b/tests/misc/ls-time
index abdd42932..67cbab96a 100755
--- a/tests/misc/ls-time
+++ b/tests/misc/ls-time
@@ -46,7 +46,6 @@ touch -a -d "$u2" b || framework_failure
sleep 2
touch -a -d "$u1" a || framework_failure
-fail=0
# A has ctime more recent than C.
set `ls -c a c`
diff --git a/tests/misc/md5sum-parallel b/tests/misc/md5sum-parallel
index f37631f69..625e66e47 100755
--- a/tests/misc/md5sum-parallel
+++ b/tests/misc/md5sum-parallel
@@ -24,7 +24,6 @@ if test "$VERBOSE" = yes; then
md5sum --version
fi
-fail=0
(mkdir tmp && cd tmp && seq 500 | xargs touch)
diff --git a/tests/misc/mknod b/tests/misc/mknod
index 0f3de38ad..ccec5bcf5 100755
--- a/tests/misc/mknod
+++ b/tests/misc/mknod
@@ -23,7 +23,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
umask 777
diff --git a/tests/misc/nice b/tests/misc/nice
index f85666e34..30a88fec6 100755
--- a/tests/misc/nice
+++ b/tests/misc/nice
@@ -56,7 +56,6 @@ else
skip_test_ "this test must be run at nice level 0"
fi
-fail=0
while :; do
test_name=$1
args=$2
diff --git a/tests/misc/nice-fail b/tests/misc/nice-fail
index 7a1bbe8ec..c621ceaaa 100755
--- a/tests/misc/nice-fail
+++ b/tests/misc/nice-fail
@@ -24,7 +24,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
# These tests verify exact status of internal failure.
nice -n 1 # missing command
diff --git a/tests/misc/nl b/tests/misc/nl
index 2c4703c71..a0fd10c1e 100755
--- a/tests/misc/nl
+++ b/tests/misc/nl
@@ -23,7 +23,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
echo a | nl > out || fail=1
echo b | nl -s%n >> out || fail=1
diff --git a/tests/misc/nohup b/tests/misc/nohup
index 96810588e..06e9ab482 100755
--- a/tests/misc/nohup
+++ b/tests/misc/nohup
@@ -23,7 +23,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
nohup sh -c 'echo stdout; echo stderr 1>&2' 2>err || fail=1
diff --git a/tests/misc/od-N b/tests/misc/od-N
index cf4185a26..df1c997bf 100755
--- a/tests/misc/od-N
+++ b/tests/misc/od-N
@@ -25,7 +25,6 @@ fi
echo abcdefg > in || framework_failure
-fail=0
(od -An -N3 -c; od -An -N3 -c) < in > out
cat <<EOF > exp || fail=1
diff --git a/tests/misc/od-multiple-t b/tests/misc/od-multiple-t
index 8d049ec5b..3ab313468 100755
--- a/tests/misc/od-multiple-t
+++ b/tests/misc/od-multiple-t
@@ -29,7 +29,6 @@ fi
seq 19 > in || framework_failure
test `wc -c < in` -eq 48 || framework_failure
-fail=0
list='a c dC dS dI dL oC oS oI oL uC uS uI uL xC xS xI xL fF fD fL'
for format1 in $list; do
diff --git a/tests/misc/od-x8 b/tests/misc/od-x8
index 6cb56921a..00190484e 100755
--- a/tests/misc/od-x8
+++ b/tests/misc/od-x8
@@ -29,7 +29,6 @@ od -t x8 /dev/null >/dev/null ||
echo abcdefgh |tr -d '\n' > in || framework_failure
-fail=0
od -An -t x8 in > out-raw || fail=1
sed 's/^ //;s/\(..\)/\1 /g;s/ $//' out-raw \
diff --git a/tests/misc/pathchk1 b/tests/misc/pathchk1
index 3e3d97c9a..4f98336ad 100755
--- a/tests/misc/pathchk1
+++ b/tests/misc/pathchk1
@@ -26,7 +26,6 @@ skip_if_root_
touch file || framework_failure
-fail=0
# This should exit nonzero. Before 2.0.13, it gave a diagnostic,
# but exited successfully.
diff --git a/tests/misc/printenv b/tests/misc/printenv
index bc51fca0b..c2bd2e424 100755
--- a/tests/misc/printenv
+++ b/tests/misc/printenv
@@ -23,7 +23,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
# Without arguments, printenv behaves like env. Some shells provide
# printenv as a builtin, so we must test via absolute name.
diff --git a/tests/misc/printf b/tests/misc/printf
index 8961b4433..14682dc7d 100755
--- a/tests/misc/printf
+++ b/tests/misc/printf
@@ -26,7 +26,6 @@ fi
. $srcdir/test-lib.sh
getlimits_
-fail=0
# Verify the 3 methods of specifying "Escape":
test $("$prog" "\x1b\n\33\n\e\n" | uniq -u) && fail=1
diff --git a/tests/misc/printf-hex b/tests/misc/printf-hex
index cf272f08b..36fd32663 100755
--- a/tests/misc/printf-hex
+++ b/tests/misc/printf-hex
@@ -26,7 +26,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
"$prog" '\x7e3\n' > out || fail=1
cat <<\EOF > exp
diff --git a/tests/misc/printf-surprise b/tests/misc/printf-surprise
index d50d9e859..5f1923e90 100755
--- a/tests/misc/printf-surprise
+++ b/tests/misc/printf-surprise
@@ -26,7 +26,6 @@ fi
. $srcdir/test-lib.sh
require_ulimit_
-fail=0
# Up to coreutils-6.9, "printf %.Nf 0" would encounter an ENOMEM internal
# error from glibc's printf(3) function whenever N was large relative to
diff --git a/tests/misc/ptx-overrun b/tests/misc/ptx-overrun
index 038109d57..81147e32d 100755
--- a/tests/misc/ptx-overrun
+++ b/tests/misc/ptx-overrun
@@ -28,7 +28,6 @@ fi
f=01234567890123456789012345678901234567890123456789
touch $f empty || framework_failure
-fail=0
# Specifying a regular expression ending in a lone backslash
# would cause ptx to write beyond the end of a malloc'd buffer.
diff --git a/tests/misc/pwd-option b/tests/misc/pwd-option
index 6c0242118..35546f781 100755
--- a/tests/misc/pwd-option
+++ b/tests/misc/pwd-option
@@ -35,7 +35,6 @@ test "x$PWD" = "x$base" || framework_failure
cd c || framework_failure
test "x$PWD" = "x$base/c" || skip_test_ "cd does not properly update \$PWD"
-fail=0
env -- pwd -L > out || fail=1
printf %s\\n "$base/c" > exp || fail=1
diff --git a/tests/misc/pwd-unreadable-parent b/tests/misc/pwd-unreadable-parent
index f5c7ae237..2f2e599a4 100755
--- a/tests/misc/pwd-unreadable-parent
+++ b/tests/misc/pwd-unreadable-parent
@@ -38,7 +38,6 @@ mkdir -p a/b || framework_failure
cd a/b || framework_failure
chmod a=x .. || framework_failure
-fail=0
env -- pwd > exp || fail=1
readlink -ev . > out || fail=1
diff --git a/tests/misc/readlink-fp-loop b/tests/misc/readlink-fp-loop
index b6d1c81b1..507c9d140 100755
--- a/tests/misc/readlink-fp-loop
+++ b/tests/misc/readlink-fp-loop
@@ -35,7 +35,6 @@ mkdir d || framework_failure
echo 2 > d/2 || framework_failure
ln -s ../s/2 d/1 || framework_failure
-fail=0
# With coreutils-6.9, this would fail with ELOOP.
readlink -v -e p/1 > out || fail=1
# readlink -e d/2 > exp || fail=1
diff --git a/tests/misc/runcon-no-reorder b/tests/misc/runcon-no-reorder
index 85fe745b7..4aaa414e0 100755
--- a/tests/misc/runcon-no-reorder
+++ b/tests/misc/runcon-no-reorder
@@ -26,7 +26,6 @@ fi
diag='runcon: runcon may be used only on a SELinux kernel'
echo "$diag" > exp || framework_failure
-fail=0
# This test works even on systems without SELinux.
# On such a system it fails with the above diagnostic, which is fine.
diff --git a/tests/misc/selinux b/tests/misc/selinux
index 8211c80f7..a56ad0612 100755
--- a/tests/misc/selinux
+++ b/tests/misc/selinux
@@ -20,7 +20,6 @@ touch f || framework_failure
mkdir d s1 s2 || framework_failure
mkfifo p || framework_failure
-fail=0
# special context that works both with and without mcstransd
ctx=root:object_r:tmp_t:s0
diff --git a/tests/misc/seq-long-double b/tests/misc/seq-long-double
index 6990f651a..165608660 100755
--- a/tests/misc/seq-long-double
+++ b/tests/misc/seq-long-double
@@ -44,7 +44,6 @@ $CC -c long.c \
a=$INTMAX_MAX
b=$INTMAX_OFLOW
-fail=0
seq $a $b > out || fail=1
printf "$a\n$b\n" > exp || fail=1
compare out exp || fail=1
diff --git a/tests/misc/shred-exact b/tests/misc/shred-exact
index ed9d10524..e25b4c091 100755
--- a/tests/misc/shred-exact
+++ b/tests/misc/shred-exact
@@ -23,7 +23,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
for opt in --exact --zero; do
echo a > a || fail=1
diff --git a/tests/misc/shred-passes b/tests/misc/shred-passes
index 712c7bd67..b37392ebf 100755
--- a/tests/misc/shred-passes
+++ b/tests/misc/shred-passes
@@ -35,7 +35,6 @@ shred: f: removing
shred: f: renamed to 0
shred: f: removed" > exp || framework_failure
-fail=0
shred -v -u f 2>out || fail=1
diff --git a/tests/misc/shred-remove b/tests/misc/shred-remove
index f0fd5f9c3..6ffe9bdd0 100755
--- a/tests/misc/shred-remove
+++ b/tests/misc/shred-remove
@@ -31,7 +31,6 @@ file=0123456789
touch $file || framework_failure
chmod u-w $file || framework_failure
-fail=0
# This would take so long that it appears to infloop
# when using version from fileutils-4.0k.
diff --git a/tests/misc/shuf b/tests/misc/shuf
index 3013aaecc..a79441419 100755
--- a/tests/misc/shuf
+++ b/tests/misc/shuf
@@ -25,7 +25,6 @@ fi
seq 100 > in || framework_failure
-fail=0
shuf in >out || fail=1
# Fail if the input is the same as the output.
diff --git a/tests/misc/sort-compress b/tests/misc/sort-compress
index 7e319ca8e..7e4278e51 100755
--- a/tests/misc/sort-compress
+++ b/tests/misc/sort-compress
@@ -30,7 +30,6 @@ SORT="$abs_top_builddir/src/sort"
# Ensure that $TMPDIR is valid.
TMPDIR=.; export TMPDIR
-fail=0
# This should force the use of temp files
sort -S 1k in > out || fail=1
diff --git a/tests/misc/sort-continue b/tests/misc/sort-continue
index 8b206f35c..d45eb53e8 100755
--- a/tests/misc/sort-continue
+++ b/tests/misc/sort-continue
@@ -31,7 +31,6 @@ for i in $(seq 31); do
echo $i | tee -a in > __test.$i || framework_failure
done
-fail=0
(
ulimit -n 6
diff --git a/tests/misc/sort-merge-fdlimit b/tests/misc/sort-merge-fdlimit
index 82305be41..3071613aa 100755
--- a/tests/misc/sort-merge-fdlimit
+++ b/tests/misc/sort-merge-fdlimit
@@ -27,7 +27,6 @@ require_ulimit_
mkdir in err || framework_failure
-fail=0
for i in `seq 17`; do
echo $i >in/$i
diff --git a/tests/misc/sort-rand b/tests/misc/sort-rand
index a9027d24c..071ad85a4 100755
--- a/tests/misc/sort-rand
+++ b/tests/misc/sort-rand
@@ -25,7 +25,6 @@ fi
seq 100 > in || framework_failure
-fail=0
sort --random-sort in > out || fail=1
diff --git a/tests/misc/sort-version b/tests/misc/sort-version
index 32b0ed258..e046c3be1 100755
--- a/tests/misc/sort-version
+++ b/tests/misc/sort-version
@@ -105,7 +105,6 @@ cat > exp <<- _EOF_
string start 5.90.0 end of str
_EOF_
-fail=0
sort --sort=version -o out in || fail=1
compare exp out || fail=1
Exit $fail
diff --git a/tests/misc/split-a b/tests/misc/split-a
index 88d225a1d..37cd3cd0f 100755
--- a/tests/misc/split-a
+++ b/tests/misc/split-a
@@ -41,7 +41,6 @@ done > exp || framework_failure
echo split: output file suffixes exhausted \
> exp-too-short || framework_failure
-fail=0
# This should fail.
split -b 1 -a 1 in 2> err && fail=1
diff --git a/tests/misc/split-fail b/tests/misc/split-fail
index ad38e6037..70ee0c009 100755
--- a/tests/misc/split-fail
+++ b/tests/misc/split-fail
@@ -26,7 +26,6 @@ getlimits_
touch in || framework_failure
-fail=0
split -a 0 in 2> /dev/null || fail=1
split -b 0 in 2> /dev/null && fail=1
diff --git a/tests/misc/split-l b/tests/misc/split-l
index 808a3447d..f6cf467cf 100755
--- a/tests/misc/split-l
+++ b/tests/misc/split-l
@@ -25,7 +25,6 @@ fi
printf '1\n2\n3\n4\n5\n' > in || framework_failure
-fail=0
split --lines=2 in > out || fail=1
cat <<\EOF > exp-1
1
diff --git a/tests/misc/stat-fmt b/tests/misc/stat-fmt
index 67dac8baa..4ffc4c7e4 100755
--- a/tests/misc/stat-fmt
+++ b/tests/misc/stat-fmt
@@ -24,7 +24,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
for i in `seq 50`; do
fmt=`printf "%${i}s" %`
diff --git a/tests/misc/stat-hyphen b/tests/misc/stat-hyphen
index f0757fe39..b9a155670 100755
--- a/tests/misc/stat-hyphen
+++ b/tests/misc/stat-hyphen
@@ -26,7 +26,6 @@ fi
printf -- '-\n' > exp || framework_failure
touch f || framework_failure
-fail=0
stat --format=%n - < f > out || fail=1
stat -f - < f && fail=1
diff --git a/tests/misc/stat-slash b/tests/misc/stat-slash
index cda94c544..cea8dcb16 100755
--- a/tests/misc/stat-slash
+++ b/tests/misc/stat-slash
@@ -35,7 +35,6 @@ directory
directory
EOF
-fail=0
# This failed on Solaris 9 for coreutils 8.0.
stat --format=%n link1 > out || fail=1
stat --format=%n link1/ >> out && fail=1
diff --git a/tests/misc/stdbuf b/tests/misc/stdbuf
index 90e45d7f0..b6e52a499 100755
--- a/tests/misc/stdbuf
+++ b/tests/misc/stdbuf
@@ -40,7 +40,6 @@ esac
# write separately.
mkfifo fifo || framework_failure
-fail=0
# Verify input parameter checking
stdbuf -o1 true || fail=1 # verify size syntax
diff --git a/tests/misc/stty b/tests/misc/stty
index a7f93ca75..cb3fee533 100755
--- a/tests/misc/stty
+++ b/tests/misc/stty
@@ -40,7 +40,6 @@ REV_ctlecho=1 REV_echoke=1 REV_crtkill=1 REV_evenp=1 REV_parity=1
REV_oddp=1 REV_nl=1 REV_cooked=1 REV_raw=1 REV_pass8=1 REV_litout=1
REV_cbreak=1 REV_decctlq=1 REV_tabs=1 REV_lcase=1 REV_LCASE=1
-fail=0
saved_state=.saved-state
stty --save > $saved_state || fail=1
diff --git a/tests/misc/stty-invalid b/tests/misc/stty-invalid
index d9f077779..638024f7b 100755
--- a/tests/misc/stty-invalid
+++ b/tests/misc/stty-invalid
@@ -25,7 +25,6 @@ fi
require_controlling_input_terminal_
trap '' TTOU # Ignore SIGTTOU
-fail=0
saved_state=`stty -g` || fail=1
stty $saved_state || fail=1
diff --git a/tests/misc/stty-row-col b/tests/misc/stty-row-col
index c98ab15e7..5efc7dd0a 100755
--- a/tests/misc/stty-row-col
+++ b/tests/misc/stty-row-col
@@ -60,7 +60,6 @@ set $tests
saved_size=`stty size` && test -n "$saved_size" \
|| skip_test_ "can't get window size"
-fail=0
while :; do
test_name=$1
args=$2
diff --git a/tests/misc/su-fail b/tests/misc/su-fail
index f00edc95b..473c76306 100755
--- a/tests/misc/su-fail
+++ b/tests/misc/su-fail
@@ -24,7 +24,6 @@ if test "$VERBOSE" = yes; then
su --version
fi
-fail=0
# Very little that we can test without a root password
su --- / true # unknown option
diff --git a/tests/misc/sum-sysv b/tests/misc/sum-sysv
index 918c00ee7..6a1c63e82 100755
--- a/tests/misc/sum-sysv
+++ b/tests/misc/sum-sysv
@@ -32,7 +32,6 @@ export LC_ALL
. $srcdir/test-lib.sh
-fail=0
# FYI, 16843009 is floor (2^32 / 255).
diff --git a/tests/misc/tac-continue b/tests/misc/tac-continue
index d385660cf..afdc79f6d 100755
--- a/tests/misc/tac-continue
+++ b/tests/misc/tac-continue
@@ -54,7 +54,6 @@ fi
seq 5 > in
-fail=0
# Give tac a fifo command line argument.
# This makes it try to create a temporary file in $TMPDIR.
diff --git a/tests/misc/tee b/tests/misc/tee
index 86eca7d05..7a76d64ca 100755
--- a/tests/misc/tee
+++ b/tests/misc/tee
@@ -26,7 +26,6 @@ fi
echo line >sample || framework_failure
nums=`seq 9` || framework_failure
-fail=0
for n in 0 $nums; do
files=`seq $n`
rm -f $files
diff --git a/tests/misc/tee-dash b/tests/misc/tee-dash
index 5dbb5c4e3..ecf414ccf 100755
--- a/tests/misc/tee-dash
+++ b/tests/misc/tee-dash
@@ -23,7 +23,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
tee - </dev/null || fail=1
Exit $fail
diff --git a/tests/misc/timeout b/tests/misc/timeout
index 08734e6f2..77a42053b 100755
--- a/tests/misc/timeout
+++ b/tests/misc/timeout
@@ -23,7 +23,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
# no timeout
timeout 1 true || fail=1
diff --git a/tests/misc/timeout-parameters b/tests/misc/timeout-parameters
index 02b63a767..c8b1eff5b 100755
--- a/tests/misc/timeout-parameters
+++ b/tests/misc/timeout-parameters
@@ -24,7 +24,6 @@ fi
. $srcdir/test-lib.sh
getlimits_
-fail=0
# internal errors are 125, distinct from execution failure
diff --git a/tests/misc/truncate-dangling-symlink b/tests/misc/truncate-dangling-symlink
index dd63b2017..73e202138 100755
--- a/tests/misc/truncate-dangling-symlink
+++ b/tests/misc/truncate-dangling-symlink
@@ -24,7 +24,6 @@ fi
. $srcdir/test-lib.sh
ln -s truncate-target t-symlink
-fail=0
truncate -s0 t-symlink || fail=1
diff --git a/tests/misc/truncate-fail-diag b/tests/misc/truncate-fail-diag
index 7472c2e7f..aace90ab1 100755
--- a/tests/misc/truncate-fail-diag
+++ b/tests/misc/truncate-fail-diag
@@ -28,7 +28,6 @@ fi
. $srcdir/test-lib.sh
skip_if_root_
-fail=0
d1=no
diff --git a/tests/misc/truncate-fifo b/tests/misc/truncate-fifo
index a521a82e9..aef44173c 100755
--- a/tests/misc/truncate-fifo
+++ b/tests/misc/truncate-fifo
@@ -25,7 +25,6 @@ fi
mkfifo_or_skip_ "fifo"
-fail=0
truncate -s0 "fifo" || fail=1
diff --git a/tests/misc/truncate-no-create-missing b/tests/misc/truncate-no-create-missing
index 346e04ec6..f0ab06e7e 100755
--- a/tests/misc/truncate-no-create-missing
+++ b/tests/misc/truncate-no-create-missing
@@ -23,7 +23,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
# truncate -c no-such-file should not fail.
truncate -s0 -c no-such-file || fail=1
diff --git a/tests/misc/truncate-overflow b/tests/misc/truncate-overflow
index 2b16f0113..afd12a5f1 100755
--- a/tests/misc/truncate-overflow
+++ b/tests/misc/truncate-overflow
@@ -24,7 +24,6 @@ fi
. $srcdir/test-lib.sh
getlimits_
-fail=0
# -= overflow
truncate -s-1 create-zero-len-file || fail=1
diff --git a/tests/misc/truncate-owned-by-other b/tests/misc/truncate-owned-by-other
index 61cbe8b50..c7bdf61c2 100755
--- a/tests/misc/truncate-owned-by-other
+++ b/tests/misc/truncate-owned-by-other
@@ -35,7 +35,6 @@ chmod g+w root-owned
# Ensure that the current directory is searchable by $NON_ROOT_USERNAME.
chmod g+x .
-fail=0
setuidgid $NON_ROOT_USERNAME env PATH="$PATH" truncate -s0 root-owned || fail=1
Exit $fail
diff --git a/tests/misc/truncate-parameters b/tests/misc/truncate-parameters
index 8bef6d106..ce3f8ac5f 100755
--- a/tests/misc/truncate-parameters
+++ b/tests/misc/truncate-parameters
@@ -23,7 +23,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
# must specify at least 1 file
truncate --size=0 && fail=1
diff --git a/tests/misc/truncate-relative b/tests/misc/truncate-relative
index 9916ec615..976eeb84d 100755
--- a/tests/misc/truncate-relative
+++ b/tests/misc/truncate-relative
@@ -23,7 +23,6 @@ fi
. $srcdir/test-lib.sh
-fail=0
# mixture of relative modifiers not allowed
truncate --size="+>0" file && fail=1
diff --git a/tests/misc/wc-files0 b/tests/misc/wc-files0
index 3da8fcdfa..1d1d7650c 100755
--- a/tests/misc/wc-files0
+++ b/tests/misc/wc-files0
@@ -27,7 +27,6 @@ echo 2 > 2b || framework_failure
echo 2 words > 2w || framework_failure
printf '2b\n2w\n' |tr '\n' '\0' > names || framework_failure
-fail=0
wc --files0-from=names > out || fail=1
cat <<\EOF > exp || fail=1
diff --git a/tests/misc/xattr b/tests/misc/xattr
index fcf7ceb79..ed08955f0 100755
--- a/tests/misc/xattr
+++ b/tests/misc/xattr
@@ -55,7 +55,6 @@ getfattr -d a >out_a || skip_test_ "failed to get xattr of file"
grep -F "$xattr_pair" out_a \
|| skip_test_ "failed to set xattr of file"
-fail=0
# cp should not preserve xattr by default
cp a b || fail=1