chown --dereference $user dangle 2> out1 && fail=1
sed 's/: [^:]*$//' out1 > out
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
chown: cannot dereference 'dangle'
EOF
# With -RHh, --preserve-root should trigger nothing,
# since the symlink in question is not a command line argument.
# Contrary to the above commands, these two should succeed.
-echo '==== test -RHh' >> out
+echo '==== test -RHh' >> out || framework_failure_
chown -RHh --preserve-root $(id -u) d >> out 2>&1 || fail=1
chgrp -RHh --preserve-root $(id -g) d >> out 2>&1 || fail=1
# These must fail.
-echo '==== test -RLh' >> out
+echo '==== test -RLh' >> out || framework_failure_
chown -RLh --preserve-root $(id -u) d >> out 2>&1 && fail=1
chgrp -RLh --preserve-root $(id -g) d >> out 2>&1 && fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
chown: it is dangerous to operate recursively on '/'
chown: use --no-preserve-root to override this failsafe
chgrp: it is dangerous to operate recursively on '/'
file=F
file_backup="$file$suffix"
-echo test > $file || fail=1
+echo test > $file || framework_failure_
# Specify both version control and suffix so the environment variables
# (possibly set by the user running these tests) aren't used.
mkdir x y || framework_failure_
-
cd y
cp --verbose -ab ../x/. . > out 2>&1 || fail=1
-cat <<\EOF > exp || fail=1
-EOF
-
-compare exp out || fail=1
+compare /dev/null out || fail=1
Exit $fail
print_ver_ dd
-echo LA:3456789abcdef > in || fail=1
+echo LA:3456789abcdef > in || framework_failure_
(dd bs=1 skip=3 count=0 && dd bs=5) < in > out 2> /dev/null || fail=1
case $(cat out) in
3456789abcdef) ;;
*) fail=1 ;;
esac
-echo LA:3456789abcdef > in || fail=1
+echo LA:3456789abcdef > in || framework_failure_
(dd bs=1 skip=3 count=0 && dd bs=5 count=2) < in > out 2> /dev/null || fail=1
case $(cat out) in
3456789abc) ;;
dd cbs=4 ibs=4 conv=unblock,sync < in > out 2> /dev/null || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
0001
0002
0003
rm -f $big
sed 's/^2[0-9][0-9][0-9][0-9][0-9][0-9] '$big'$/~2M/' out1 > out
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
~2M
EOF
# /proc support, nor native openat support.
sed 's/^[0-9][0-9]* //' ../t | sort -u > out
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
.
./a
./b
esac
i_minus_1=$i
done
-echo foo > $i
+echo foo > $i || framework_failure_
# If a system can handle this many symlinks in a file name,
# just skip this test.
# With coreutils-5.94 we get the desired diagnostic:
# du: cannot access '1/s/s/s/.../s': Too many levels of symbolic links
du -L 1 > /dev/null 2> out1 && fail=1
-sed "s, .1/s/s/s/[/s]*',," out1 > out || fail=1
+sed "s, .1/s/s/s/[/s]*',," out1 > out || framework_failure_
-echo "du: cannot access: $too_many" > exp || fail=1
+echo "du: cannot access: $too_many" > exp || framework_failure_
compare exp out || fail=1
# would not traverse into second and subsequent directories listed
# on the command line.
du -ax b y > t || fail=1
-sed 's/^[0-9][0-9]* //' t > out
-cat <<\EOF > exp || fail=1
+sed 's/^[0-9][0-9]* //' t > out || framework_failure_
+cat <<\EOF > exp || framework_failure_
b/c
b
y/z
# "du -xL" reported a zero count for a file in a different file system,
# instead of ignoring it.
du -xL d > u || fail=1
-sed 's/^[0-9][0-9]* //' u > out1
-echo d > exp1 || fail=1
+sed 's/^[0-9][0-9]* //' u > out1 || framework_failure_
+echo d > exp1 || framework_failure_
compare exp1 out1 || fail=1
# With coreutils-8.15, "du -xs FILE" would print no output.
touch f
for opt in -x -xs; do
du $opt f > u || fail=1
- sed 's/^[0-9][0-9]* //' u > out2
- echo f > exp2 || fail=1
+ sed 's/^[0-9][0-9]* //' u > out2 || framework_failure_
+ echo f > exp2 || framework_failure_
compare exp2 out2 || fail=1
done
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ fmt
-cat <<\_EOF_ > base || fail=1
+cat <<\_EOF_ > base || framework_failure_
@command{fmt} prefers breaking lines at the end of a sentence, and tries to
avoid line breaks after the first word of a sentence or before the last word
fmt -g 60 -w 72 base > out || fail=1
-cat <<\_EOF_ > exp
+cat <<\_EOF_ > exp || framework_failure_
@command{fmt} prefers breaking lines at the end of a sentence,
and tries to avoid line breaks after the first word of a sentence
chmod a+x b || framework_failure_
-echo abc > src || fail=1
-echo aBc > exp || fail=1
+echo abc > src || framework_failure_
+echo aBc > exp || framework_failure_
ginstall src dest -s --strip-program=./b || fail=1
compare exp dest || fail=1
ln --backup f f 2> out && fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
ln: 'f' and 'f' are the same file
EOF
ls -og --color=always $long_name > out || fail=1
# Append a newline, to accommodate less-capable versions of sed.
-echo >> out || fail=1
+echo >> out || framework_failure_
sed 's/.*T //' out > k && mv k out
TERM=xterm ls --color=always > out || fail=1
-cat -A out > o1 || fail=1
-mv o1 out || fail=1
+cat -A out > o1 || framework_failure_
+mv o1 out || framework_failure_
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
^[[0m^[[01;34md^[[0m$
^[[34;42mother-writable^[[0m$
out$
compare exp out || fail=1
-rm exp
+rm exp || framework_failure_
# Turn off colors for other-writable dirs and ensure
# we fall back to the color for standard directories.
cat -A out > o1 || fail=1
mv o1 out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
^[[0m^[[01;34md^[[0m$
^[[01;34mother-writable^[[0m$
out$
# Before coreutils-5.1.1, the following would produce leading white space.
# All of the sed business is because the sizes are not portable.
ls -sm a b | sed 's/^[0-9]/0/;s/, [0-9][0-9]* b/, 12 b/' >> out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
a,
b
0 a, 12 b
done
# Append a newline, to accommodate less-capable versions of sed.
-echo >> out || fail=1
+echo >> out || framework_failure_
# Strip possible varying portion of long format
sed -e 's/.*T //' -e '/^total/d' out > k && mv k out
ls --file-type d > out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
s@
EOF
compare exp out || fail=1
-rm -f out exp
# Check for the ls -CF misaligned-columns bug:
ls -CF e > out || fail=1
# coreutils-6.0 would print two spaces after the first slash,
# rather than the appropriate TAB.
-printf 'a2345/\tb/\n' > exp || fail=1
+printf 'a2345/\tb/\n' > exp || framework_failure_
compare exp out || fail=1
returns_ 2 ls -l --time-style=XX > out 2> err || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
ls: invalid argument 'XX' for 'time style'
Valid arguments are:
- [posix-]full-iso
# Coreutils 6.8 and 6.9 would output this in the wrong order.
ls -x subdir > out || fail=1
ls -rx subdir >> out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
a b
b a
EOF
stat --printf="f|$i|"'%C\n' f >> out || fail=1
done
-cat <<EOF > exp || fail=1
+cat <<EOF > exp || framework_failure_
f|$ctx
g|$ctx
f|--user=$u2|$u2:$r1:$t1:$range
compare exp out || fail=1
chcon --verbose -u$u1 f > out || fail=1
-echo "changing security context of 'f'" > exp
+echo "changing security context of 'f'" > exp || framework_failure_
compare exp out || fail=1
Exit $fail
echo 'nohup: ignoring input and appending output to 'nohup.out'\'
else
echo 'nohup: appending output to 'nohup.out'\'
- fi >exp || fail=1
+ fi >exp || framework_failure_
else
# Here it should not even exist.
test -f nohup.out && fail=1
echo 'nohup: ignoring input' >exp
else
rm -f exp
- fi || fail=1
+ fi || framework_failure_
fi
-echo 'stderr' >> exp || fail=1
+echo 'stderr' >> exp || framework_failure_
compare exp err || fail=1
rm -f nohup.out err exp
compare /dev/null nohup.out || fail=1
fi
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
nohup: appending output to 'nohup.out'
nohup: cannot run command 'no-such-command': No such file or directory
EOF
compare /dev/null nohup.out || fail=1
fi
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
nohup: appending output to 'nohup.out'
nohup: cannot run command './k': Permission denied
EOF
(od -An -N3 -c; od -An -N3 -c) < in > out
-cat <<EOF > exp || fail=1
+cat <<EOF > exp || framework_failure_
a b c
d e f
EOF
# With coreutils-6.9, this would fail with ELOOP.
readlink -v -e p/1 > out || fail=1
# readlink -e d/2 > exp || fail=1
-echo "$cwd/d/2" > exp || fail=1
+echo "$cwd/d/2" > exp || framework_failure_
compare exp out || fail=1
# Construct a real loop and make sure readlink still detects it.
ln -nsf ../p/8 d/7 || framework_failure_
echo x > d/8 || framework_failure_
readlink -v -e p/1 > out || fail=1
-echo "$cwd/d/8" > exp || fail=1
+echo "$cwd/d/8" > exp || framework_failure_
compare exp out || fail=1
# A trivial loop
# make sure that neither --exact nor --zero gobbles a command line argument
for opt in --exact --zero; do
- echo a > a || fail=1
- echo bb > b || fail=1
- echo ccc > c || fail=1
+ echo a > a || framework_failure_
+ echo bb > b || framework_failure_
+ echo ccc > c || framework_failure_
shred --remove $opt a b || fail=1
test -f a && fail=1
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ sort
-echo nan > F || fail=1
-printf 'nan\nnan\n' > exp || fail=1
+echo nan > F || framework_failure_
+printf 'nan\nnan\n' > exp || framework_failure_
timeout 10 sort -g -m F F > out || fail=1
compare exp out || fail=1
compare exp out || fail=1
# Create our own gzip program that will be used as the default
-cat <<EOF > gzip || fail=1
+cat <<EOF > gzip || framework_failure_
#!$SHELL
tr 41 14
touch ok
# This test finds the bug only with shells that do not close FDs on
# exec, and will miss the bug (if present) on other shells, but it's
# not easy to fix this without running afoul of the OpenBSD-like sh bugs.
-(seq 6 && echo 6) >exp || fail=1
-echo 6 >out || fail=1
+(seq 6 && echo 6) >exp || framework_failure_
+echo 6 >out || framework_failure_
(exec 3<&- 4<&- 5<&- 6</dev/null 7<&6 8<&6 9<&6 &&
ulimit -n 10 &&
sort -n -m --batch-size=7 -o out out in/1 in/2 in/3 in/4 in/5 out
print_ver_ tac
echo x | tac - - > out 2> err || fail=1
-echo x > exp || fail=1
+echo x > exp || framework_failure_
compare exp out || fail=1
compare /dev/null err || fail=1
seq 1000 > fifo & pid=$!
TMPDIR=$FULL_PARTITION_TMPDIR tac fifo in >out 2>err && fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
5
4
3
sed 's/[^ ]* *[^ ]* *[^ ]* *[^ ]* *//' lsout >lsed || framework_failure_
sed '/^$/d' prout >pred || framework_failure_
-cat <<\EOF > duexp || fail=1
+cat <<\EOF > duexp || framework_failure_
1970-07-08 09:10:11.000000000 +0000 a
1970-07-08 09:10 a
1970-07-08 a
%bJul%bJul a
EOF
-cat <<\EOF > lsexp || fail=1
+cat <<\EOF > lsexp || framework_failure_
1970-07-08 09:10:11.000000000 +0000 a
1970-07-08 09:10 a
1970-07-08 a
%bJul%bJul a
EOF
-cat <<\EOF > prexp || fail=1
+cat <<\EOF > prexp || framework_failure_
+1970-07-08 09:10:11 +0000 (UTC) a Page 1
hello
+%bJul%bJul a Page 1
# Running via "env" ensures we run our program and not the built-in.
env -- $cmd_w_arg --context=$c 2> out && fail=1
set $cmd_w_arg; cmd=$1
- echo "$cmd: $msg" > exp || fail=1
+ echo "$cmd: $msg" > exp || framework_failure_
# Some systems fail with ENOTSUP, EINVAL, ENOENT, or even
# "Unknown system error", or "Function not implemented".
-e 's/ Function not implemented$//' \
-e 's/ Unsupported attribute value$//' \
-e 's/ Unknown error .*$//' \
- -e 's/ No such file or directory$//' out > k || fail=1
+ -e 's/ No such file or directory$//' out > k || framework_failure_
mv k out || fail=1
compare exp out || fail=1
done
for cmd in 'mkdir dir' 'mknod b p' 'mkfifo f'; do
$cmd --context="$c" 2> out && fail=1
set $cmd
- echo "$1: $msg" > exp || fail=1
+ echo "$1: $msg" > exp || framework_failure_
- sed -e 's/ Operation not permitted$//' out > k || fail=1
+ sed -e 's/ Operation not permitted$//' out > k || framework_failure_
mv k out || fail=1
compare exp out || fail=1
done
# Before coreutils-6.2, the " (backup: 'B.~1~')" suffix was not printed.
mv --verbose --backup=numbered -T A B > out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
renamed 'A' -> 'B' (backup: 'B.~1~')
EOF
# Test ln -f.
rm -f a/f b/f c/f
-echo a > a/f || fail=1
-echo b > b/f || fail=1
+echo a > a/f || framework_failure_
+echo b > b/f || framework_failure_
returns_ 1 ln -f a/f b/f c 2> /dev/null || fail=1
# a/f and c/f must be linked
test $(stat --format %i a/f) = $(stat --format %i c/f) || fail=1
sed 's/: File exists/: Directory not empty/'<out>o1;mv o1 out
sed 's/: Device or resource busy/: Directory not empty/'<out>o1;mv o1 out
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
mv: cannot move 'b/t' to 'a/t': Directory not empty
EOF
case "$args" in *loc_sl*) slink=$loc_sl ;; esac
case "$args" in *rem_sl*) slink=$rem_sl ;; esac
- echo $contents > "$reg_abs" || fail=1
+ echo $contents > "$reg_abs" || framework_failure_
ln -nsf "$reg_abs" $slink || fail=1
actual_args=$(echo $args|sed 's,^,$,;s/ / $/')
actual_args=$(eval echo $actual_args)
test $fail = 1 &&
{ (exit 1); exit; }
-cat <<\EOF > expected
+cat <<\EOF > expected || framework_failure_
1 cp loc_reg rem_sl
[cp: 'loc_reg' and 'rem_sl' are the same file]
(loc_reg) (rem_sl -> dir/loc_reg)
case "$(cat old)" in new) ;; *) fail=1 ;; esac
# Restore initial conditions.
-echo old > old || fail=1
+echo old > old || framework_failure_
touch -d yesterday old || fail=1
-echo new > new || fail=1
+echo new > new || framework_failure_
# This will actually perform the copy.
cp --update new old || fail=1
# For rm from coreutils-5.0.1, this would prompt.
rm ---presume-input-tty unwritable-dir < /dev/null > out-t 2>&1 && fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
rm: cannot remove 'unwritable-dir': Is a directory
EOF
rm d 2> out && fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
rm: cannot remove 'd': Is a directory
EOF
test -d "$p/abs1" && fail=1
test -d "$p/abs2" && fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
rm: cannot remove 'rel': Permission denied
EOF
# The prompt has a trailing space, and no newline, so an extra
# 'echo .' is inserted after each rm to make it obvious what was asked.
-echo 'no WHEN' > err || fail=1
+echo 'no WHEN' > err || framework_failure_
rm -R --interactive file1-* < in >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
test -f file1-1 || fail=1
test -f file1-2 && fail=1
-echo 'WHEN=never' >> err || fail=1
+echo 'WHEN=never' >> err || framework_failure_
rm -R --interactive=never file2-* < in >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
test -f file2-1 && fail=1
test -f file2-2 && fail=1
-echo 'WHEN=once' >> err || fail=1
+echo 'WHEN=once' >> err || framework_failure_
rm -R --interactive=once file3-* < in >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
test -f file3-1 || fail=1
test -f file3-2 || fail=1
-echo 'WHEN=always' >> err || fail=1
+echo 'WHEN=always' >> err || framework_failure_
rm -R --interactive=always file4-* < in >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
test -f file4-1 || fail=1
test -f file4-2 && fail=1
-echo '-f overrides --interactive' >> err || fail=1
+echo '-f overrides --interactive' >> err || framework_failure_
rm -R --interactive=once -f file1-* < in >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
test -f file1-1 && fail=1
-echo '--interactive overrides -f' >> err || fail=1
+echo '--interactive overrides -f' >> err || framework_failure_
rm -R -f --interactive=once file4-* < in >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
test -f file4-1 || fail=1
-cat <<\EOF > expout || fail=1
-EOF
-sed 's/@remove_empty/rm: remove regular empty file/g' <<\EOF > experr || fail=1
+cat <<\EOF > experr.t || framework_failure_
no WHEN
@remove_empty 'file1-1'? @remove_empty 'file1-2'? .
WHEN=never
--interactive overrides -f
rm: remove 1 argument recursively? .
EOF
+sed 's/@remove_empty/rm: remove regular empty file/g' < experr.t > experr ||
+ framework_failure_
-compare expout out || fail=1
+compare /dev/null out || fail=1
compare experr err || fail=1
Exit $fail
echo 'one file, no recursion' > err || framework_failure_
rm -I file1-* < in-n >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
test -f file1-1 && fail=1
echo 'one file, read only, answer no' >> err || framework_failure_
write_prot_msg1="rm: remove write-protected regular empty file 'file1-1'? "
fi
rm ---presume-input-tty -I file1-* < in-n >> out 2>> err || fail=1
- echo . >> err || fail=1
+ echo . >> err || framework_failure_
if test "$write_prot_msg1"; then
test -f file1-1 || fail=1
fi
echo 'three files, no recursion' >> err || framework_failure_
rm -I file2-* < in-n >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
test -f file2-1 && fail=1
test -f file2-2 && fail=1
test -f file2-3 && fail=1
echo 'four files, no recursion, answer no' >> err || framework_failure_
rm -I file3-* < in-n >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
test -f file3-1 || fail=1
test -f file3-2 || fail=1
test -f file3-3 || fail=1
echo 'four files, no recursion, answer yes' >> err || framework_failure_
rm -I file3-* < in-y >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
test -f file3-1 && fail=1
test -f file3-2 && fail=1
test -f file3-3 && fail=1
write_prot_msg2="rm: remove write-protected regular file 'file3-4'? "
fi
cat in-y in-n | rm ---presume-input-tty -I file3-* >> out 2>> err || fail=1
- echo . >> err || fail=1
+ echo . >> err || framework_failure_
test -f file3-1 && fail=1
test -f file3-2 && fail=1
test -f file3-3 && fail=1
echo 'one file, recursion, answer no' >> err || framework_failure_
rm -I -R dir1-* < in-n >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
test -d dir1-1 || fail=1
echo 'one file, recursion, answer yes' >> err || framework_failure_
rm -I -R dir1-* < in-y >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
test -d dir1-1 && fail=1
echo 'multiple files, recursion, answer no' >> err || framework_failure_
rm -I -R dir2-* < in-n >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
test -d dir2-1 || fail=1
test -d dir2-2 || fail=1
echo 'multiple files, recursion, answer yes' >> err || framework_failure_
rm -I -R dir2-* < in-y >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
test -d dir2-1 && fail=1
test -d dir2-2 && fail=1
-cat <<\EOF > expout || fail=1
-EOF
-cat <<EOF > experr || fail=1
+cat <<EOF > experr || framework_failure_
one file, no recursion
.
one file, read only, answer no
rm: remove 2 arguments recursively? .
EOF
-compare expout out || fail=1
+compare /dev/null out || fail=1
compare experr err || fail=1
Exit $fail
cd ..
-cat <<EOF > in
+cat <<EOF > in || framework_failure_
y
y
y
# This avoids a bug whereby some vendor-provided (Tru64) versions of sed
# would mistakenly tack a newline onto the end of the output.
tr '?' '\n' < out | head --bytes=-1 | sed 's/^ //' |sort > o2
-mv o2 out
+mv o2 out || framework_failure_
-sort <<EOF > exp || fail=1
+sort <<EOF > exp || framework_failure_
rm: descend into directory 'z'
rm: remove regular empty file 'z/empty'
rm: remove write-protected regular file 'z/fu'
rm --verbose -r a/// > out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
removed 'a/x'
removed directory 'a/'
EOF
# FIXME: . "$abs_srcdir/tests/other-fs-tmpdir"
FIXME > out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
FIXME
EOF
TZ=UTC0 ls -og --time-style=+%Y-%m-%d f > out.1 || fail
sed 's/ f$//;s/.* //' out.1 > out
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
2004-01-11
EOF