$prog: \`d/no-x': Permission denied
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
$prog: \`d/no-x': Permission denied
EOF
-compare out exp || fail=1
+compare exp out || fail=1
cd a
# This will fail with ``chmod: fts_read failed: Permission denied''
chown -f 0:0 no-such 2>> out && fail=1
touch exp || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
chmod 644 dangle 2> out && fail=1
echo "chmod: cannot operate on dangling symlink \`dangle'" > exp
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
# Note we output a name even though an id was specified.
chown -v --from=42 43 f > out || fail=1
printf "ownership of \`f' retained as `id -nu`\n" > exp
-compare out exp || fail=1
+compare exp out || fail=1
# Ensure diagnostics work for non existent files.
chown -v 0 nf > out && fail=1
printf "failed to change ownership of \`nf' to 0\n" > exp
-compare out exp || fail=1
+compare exp out || fail=1
chown --from=0:1 2:010 f || fail=1
chown: cannot dereference `dangle'
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
chgrp: use --no-preserve-root to override this failsafe
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
cp -dR a/1 b/1 c 2> out && fail=1
- compare out exp || fail=1
+ compare exp out || fail=1
# When the destination is a dangling symlink,
# ensure that cp does not create it.
XXX: backing up `a' would destroy source; `a~' not copied
EOF
-compare out2 exp || fail=1
+compare exp out2 || fail=1
Exit $fail
test -s g && fail=1
sed "s/ .g' to .*//" out > k
mv k out
-compare out exp || fail=1
+compare exp out || fail=1
rm -f g
echo > g
test -s g && fail=1
sed "s/ .g' to .*//" out2 > k
mv k out2
-compare out2 exp || fail=1
+compare exp out2 || fail=1
Exit $fail
EOF
fi
-compare err exp || fail=1
+compare exp err || fail=1
rm -f err noxattr/a
# ...: The file access permissions do not allow the specified action.
# to the expected one:
sed 's/: The file access permissions.*/: Permission denied/'<out>o1;mv o1 out
-compare out exp || fail=1
+compare exp out || fail=1
cp --target-directory=symlink F 2> out && fail=1
sed 's/: The file access permissions.*/: Permission denied/'<out>o1;mv o1 out
-compare out exp || fail=1
+compare exp out || fail=1
chmod 700 D
EOF
#'
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
test -s out && { rm -f out; echo nonempty > out; }
test -s exp && { rm -f exp; echo nonempty > exp; }
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
cat <<\EOF > exp || fail=1
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
# Starting with 6.9.90, this usage fails, by default:
cp f dangle > err 2>&1 && fail=1
-compare err exp-err || fail=1
+compare exp-err err || fail=1
test -f no-such && fail=1
# But you can set POSIXLY_CORRECT to get the historical behavior.
env POSIXLY_CORRECT=1 cp f dangle > out 2>&1 || fail=1
cat no-such >> out || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
(printf 'ab'; sleep $delay; printf 'cd') > dd.fifo
wait #for dd to complete
sed 's/,.*//' err > k && mv k err
- compare err exp-reblock
+ compare exp-reblock err
}
retry_delay_ dd_reblock_1 .1 6 || fail=1
(printf 'ab'; sleep $delay; printf 'cd') > dd.fifo
wait #for dd to complete
sed 's/,.*//' err > k && mv k err
- compare err exp-no-reblock
+ compare exp-no-reblock err
}
retry_delay_ dd_reblock_2 .1 6 || fail=1
xx
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
~2M
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
8589934592 big
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
$tot a
EOF
-compare out exp || fail=1
+compare exp out || fail=1
# Perform this test only if "." is on a local file system.
# Otherwise, it would fail e.g., on an NFS-mounted Solaris ZFS file system.
$d1 d # d + d/1; don't count the dir. entry for d/sub
EOF
- compare out exp || fail=1
+ compare exp out || fail=1
fi
Exit $fail
# Map the number of blocks to 0.
sed 's/^[0-9][0-9]*/0/' out > k && mv k out
-compare out exp || fail=1
+compare exp out || fail=1
compare err err_ok || fail=1
Exit $fail
64 slink-to-64k
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
a/x/y
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
# The diagnostic string is usually "Is a directory" (ENOTDIR),
# but accept a different string or errno value.
sed 's/dir:.*/dir:/' err > k; mv k err
- compare err exp || fail=1
+ compare exp err || fail=1
done
Exit $fail
dir
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
sed "s,/c/j': ,/c': ," out > t && mv t out
sed 's,cannot access,cannot read directory,' out > t && mv t out
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
# Expect failure, ignore diagnostics.
du -s a > out 2> /dev/null && fail=1
-compare out exp || fail=1
+compare exp out || fail=1
# Same as above, but don't use -s, so we print
# an entry for the unreadable "sub", too.
# Expect failure, ignore diagnostics.
du -k a > out 2> /dev/null && fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
echo "du: cannot access: $too_many" > exp || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
# Remove the sizes. They vary between file systems.
cut -f2- out > k && mv k out
-compare out exp || fail=1
-compare err /dev/null || fail=1
+compare exp out || fail=1
+compare /dev/null err || fail=1
# Repeat, but use -d 1.
printf 'a/b\na\n' > exp || framework_failure_
du -d 1 a > out 2>err || fail=1
cut -f2- out > k && mv k out
-compare out exp || fail=1
-compare err /dev/null || fail=1
+compare exp out || fail=1
+compare /dev/null err || fail=1
Exit $fail
# check for the new diagnostic
printf "du: fts_read failed: $t/3/a/b: No such file or directory\n" > exp \
|| fail=1
-compare err exp || fail=1
+compare exp err || fail=1
Exit $fail
slink
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
$prog: \`d/no-x': Permission denied
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
y
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
/
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
slink
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
echo abc > src || fail=1
echo aBc > exp || fail=1
ginstall src dest -s --strip-program=./b || fail=1
-compare dest exp || fail=1
+compare exp dest || fail=1
Exit $fail
ln: `f' and `f' are the same file
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
4 Jan 1 2001 file4096
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
sed 's/.*T //' out > k && mv k out
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
^[[37;44msticky^[[0m$
EOF
-compare out exp || fail=1
+compare exp out || fail=1
rm exp
^[[37;44msticky^[[0m$
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
norm exe$
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
sub
EOF
-compare out exp || fail=1
+compare exp out || fail=1
# Ensure that ls -Li prints "?" as the inode of a dangling symlink.
rm -f out
//DIRED-OPTIONS// --quoting-style=literal
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
sed 's/[@|]$//' exp2 > exp3
ls -p sub > out3 || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
-compare out2 exp2 || fail=1
+compare exp2 out2 || fail=1
-compare out3 exp3 || fail=1
+compare exp3 out3 || fail=1
ls --color=auto -F sub > out || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
sub/link-to-dir:
EOF
-compare out-L exp-L || fail=1
-compare out-FLR-sub exp-FLR-sub || fail=1
+compare exp-L out-L || fail=1
+compare exp-FLR-sub out-FLR-sub || fail=1
Exit $fail
# Ensure that ls exits with status 2 upon detecting a cycle
test $? = 2 || fail=1
-compare err exp-err || fail=1
-compare out exp-out || fail=1
+compare exp-err err || fail=1
+compare exp-out out || fail=1
Exit $fail
0 a, 12 b
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
ls -1 > out || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
cat > exp <<\EOF
.:
ls -R1 > out || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
c:
EOF
-compare out exp || fail=1
+compare exp out || fail=1
rm -rf out exp
ls -R1 x y f > out || fail=1
y:
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
b
c
EOF
-compare out exp || fail=1
+compare exp out || fail=1
rm -rf out exp
ls -1rt a b c > out || fail=1
b
a
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
s@
EOF
-compare out exp || fail=1
+compare exp out || fail=1
rm -f out exp
# Check for the ls -CF misaligned-columns bug:
# rather than the appropriate TAB.
printf 'a2345/\tb/\n' > exp || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
?????????? ? ? ? s
EOF
-sed 's/^l/?/' out | compare - exp || fail=1
+sed 's/^l/?/' out | compare exp - || fail=1
# Ensure that the offsets in --dired output are accurate.
rm -f out exp
//DIRED-OPTIONS// --quoting-style=literal
EOF
-sed 's/^ l/ ?/' out | compare - exp || fail=1
+sed 's/^ l/ ?/' out | compare exp - || fail=1
Exit $fail
printf '\033[01;32mx\033[0m*\n'
} > exp || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
b a
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
arch > out || fail=1
uname -m > exp || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
dd count=1 if=fifo > out &
(echo 1; sleep $delay; echo 2) | cat -v > fifo
wait # for dd to complete
- compare out exp
+ compare exp out
}
retry_delay_ cat_buf_1 .1 6 || fail=1
cat -E $f | sed 's/[0-9][0-9]*/D/g' | tr -d '$' > out || fail=1
cat $f | sed 's/[0-9][0-9]*/D/g' | tr -d '$' > exp || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
f|-ttmp_t|root:object_r:tmp_t:$range
EOF
-compare out exp || fail=1
+compare exp out || fail=1
chcon --verbose -u$u1 f > out || fail=1
echo 'changing security context of `f'\' > exp
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
0
2
EOF
-compare out exp || fail=1
+compare exp out || fail=1
rm -f in out exp
# Ensure that xx02 contains just two newlines.
# This would fail due to reading from freed buffer with coreutils-5.0.91.
printf '\n\n' > exp
cp xx02 out || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
rm -f in out exp
# csplit would infloop
0
3
EOF
-compare out exp || fail=1
+compare exp out || fail=1
rm -f in out exp
# `echo |csplit - 1 1' used to abort.
0
1
EOF
-compare out exp || fail=1
+compare exp out || fail=1
cat <<\EOF > experr
csplit: warning: line number `1' is the same as preceding line number
EOF
-compare err experr || fail=1
+compare experr err || fail=1
rm -f in out exp err experr
# `echo | csplit -b '%0#6.3x' - 1' incorrectly warned about the format
0
1
EOF
-compare out exp || fail=1
+compare exp out || fail=1
touch experr
-compare err experr || fail=1
+compare experr err || fail=1
compare 'xx 000' experr || fail=1
compare 'xx 0x001' in || fail=1
rm -f in out exp err experr xx*
csplit: warning: line number `3' is the same as preceding line number
csplit: `3': line number out of range
EOF
-compare err experr || fail=1
+compare experr err || fail=1
# Ensure that lines longer than the initial buffer length don't cause
# trouble (e.g. reading from freed memory, resulting in corrupt output).
head -n1 t1 > exp || fail=1
head -n1 t2 > out || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
fmt -s in > out || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
groups -- none -- > exp 2>&1 && fail=1
echo $? >> exp
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
groups --version | sed 's/^groups/id/; /^$/q' > out || fail=1
id --version | sed '/^$/q' > exp || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
b
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
$
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
a b c
d e f
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
done
done
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
| sort -n \
> exp
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
foo
EOF
-compare out exp || fail=1
+compare exp out || fail=1
rm -f out exp
# Until coreutils-4.5.10, this would elicit a segfault.
11 x
EOF
-compare out exp || fail=1
+compare exp out || fail=1
# Verify handling of single quote chars (\' or \")
printf: a: expected a numeric value
EOF
-compare out exp || fail=1
-compare err exp_err || fail=1
+compare exp out || fail=1
+compare exp_err err || fail=1
Exit $fail
~3
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
env -- PWD="$base/a/../c" pwd -L >> out || fail=1
printf %s\\n "$base/a/b" >> exp || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
readlink -v -e p/1 > out || fail=1
# readlink -e d/2 > exp || fail=1
echo "$cwd/d/2" > exp || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
# Construct a real loop and make sure readlink still detects it.
ln -sf ../s/1 d/2 || framework_failure_
echo x > d/8 || framework_failure_
readlink -v -e p/1 > out || fail=1
echo "$cwd/d/8" > exp || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
# A trivial loop
ln -s loop loop
readlink -v -e loop 2> out && fail=1
echo "readlink: loop: $symlink_loop_msg" > exp || framework_failure_
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
'runcon: invalid context: '*) echo "$diag" > out;;
esac
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
seq $a $b > out || fail=1
printf "$a\n$b\n" > exp || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
printf 'nan\nnan\n' > exp || fail=1
timeout 10 sort -g -m F F > out || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
time sort in > out || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
printf 'A\tchr10\nB\tchr1\n' | sort -s -k2.4b,2.3n --debug
) > out
-compare out exp || fail=1
+compare exp out || fail=1
cat <<\EOF > exp
1²---++3 1,234 Mi
sort --debug -k1,1n -k1,1g \
-k1,1h -k2,2n -k2,2g -k2,2h -k3,3n -k3,3g -k3,3h
) > out
- compare out exp || fail=1
+ compare exp out || fail=1
fi
Exit $fail
tac exp | LC_ALL=$LOC sort -sg > out || fail=1
- compare out exp || fail=1
+ compare exp out || fail=1
done
Exit $fail
ulimit -n 10 &&
sort -n -m --batch-size=7 -o out out in/1 in/2 in/3 in/4 in/5 out
) &&
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
sort --parallel=1 -u in > exp || fail=1
sort --parallel=2 -u -S 10b < in > out || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
stat --format=%n - < f > out || fail=1
stat -f - < f && fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
stat -L --format=%F link2 >> out || fail=1
stat --format=%F link2/ >> out || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
dd count=1 if=fifo > out 2> err &
(printf '1\n'; sleep $delay; printf '2\n') | stdbuf -oL uniq > fifo
wait # for dd to complete
- compare out exp
+ compare exp out
}
retry_delay_ stdbuf_linebuffer .1 6 || fail=1
dd count=1 if=fifo > out 2> err &
(printf '1\n'; sleep $delay; printf '2\n') | stdbuf -o0 uniq > fifo
wait # for dd to complete
- compare out exp
+ compare exp out
}
retry_delay_ stdbuf_unbuffer .1 6 || fail=1
# dd count=1 if=fifo > /dev/null 2> err &
# printf '1\n\2\n3\n' | (stdbuf -i0 -oL uniq > fifo; cat) > out
# wait # for dd to complete
- # compare out exp || fail=1
+ # compare exp out || fail=1
# One could remove the need for dd (used to close the fifo to get uniq to quit
# early), if head -n1 read stdin char by char. Note uniq | head -c2 doesn't
# suffice due to the buffering implicit in the pipe. sed currently does read
# adding this dependency on a program outside of coreutils.
# printf '2\n' > exp
# printf '1\n2\n' | (stdbuf -i0 sed 1q >/dev/null; cat) > out
- # compare out exp || fail=1
+ # compare exp out || fail=1
# Ensure block buffering stdout takes effect
# We don't currently test block buffering failures as
# dd count=1 if=fifo > out 2> err &
# (printf '1\n'; sleep $delay; printf '2\n') | stdbuf -o4 uniq > fifo
# wait # for dd to complete
- # compare out exp
+ # compare exp out
# }
#
# retry_delay_ stdbuf_blockbuffer .1 6 || fail=1
cat > exp <<\EOF
65535 32897
EOF
-compare out exp || fail=1
+compare exp out || fail=1
rm -f out exp
cat > exp <<\EOF
254 32897
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
echo x | tac - - > out 2> err || fail=1
echo x > exp || fail=1
-compare out exp || fail=1
-compare err /dev/null || fail=1
+compare exp out || fail=1
+compare /dev/null err || fail=1
Exit $fail
1
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
echo '01234567899999999999999999' > exp
echo 'abcdefghijklmnopqrstuvwxyz' |
tr '[:lower:]' '0-9' > out || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
echo 'abcdefghijklmnopqrstuvwxyz' |
tr '[:lower:][:lower:]' '[:upper:]0-9' > out || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
# Validate the alignment of case classes
tr 'A-Z[:lower:]' 'a-y[:upper:]' < /dev/null && fail=1
tr '[:upper:] ' '[:lower:]' < /dev/null 2>out && fail=1
echo 'tr: when translating with string1 longer than string2,
the latter string must not end with a character class' > exp
-compare out exp || fail=1
+compare exp out || fail=1
# Up to coreutils-6.9, tr rejected an unmatched [:lower:] or [:upper:] in SET1.
echo '#$%123abcABC' | tr '[:lower:]' '[.*]' > out || fail=1
echo '#$%123...ABC' > exp
-compare out exp || fail=1
+compare exp out || fail=1
echo '#$%123abcABC' | tr '[:upper:]' '[.*]' > out || fail=1
echo '#$%123abc...' > exp
-compare out exp || fail=1
+compare exp out || fail=1
# When doing a case-converting translation with something after the
# [:upper:] and [:lower:] elements, ensure that tr honors the following byte.
echo 'abc.' | tr '[:lower:].' '[:upper:]x' > out || fail=1
echo 'ABCx' > exp
-compare out exp || fail=1
+compare exp out || fail=1
# Before coreutils 8.6 the disparate number of upper and lower
# characters in some locales, triggered abort()s and invalid behavior
tr '[:upper:] ' '[:lower:]' < /dev/null 2>out && fail=1
echo 'tr: when translating with string1 longer than string2,
the latter string must not end with a character class' > exp
- compare out exp || fail=1
+ compare exp out || fail=1
# Ensure when there are a different number of elements
# in each string, we validate the case mapping correctly
echo 'abc.xyz' |
tr 'ab[:lower:]' '0-1[:upper:]' > out || fail=1
echo 'ABC.XYZ' > exp
- compare out exp || fail=1
+ compare exp out || fail=1
# Ensure we extend string2 appropriately
echo 'ABC- XYZ' |
tr '[:upper:]- ' '[:lower:]_' > out || fail=1
echo 'abc__xyz' > exp
- compare out exp || fail=1
+ compare exp out || fail=1
# Ensure the size of the case classes are accounted
# for as a unit.
echo 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
tr '[:upper:]A-B' '[:lower:]0' >out || fail=1
echo '00cdefghijklmnopqrstuvwxyz' > exp
- compare out exp || fail=1
+ compare exp out || fail=1
# Ensure the size of the case classes are accounted
# for as a unit.
echo 'a' |
tr -t '[:lower:]a' '[:upper:]0' >out || fail=1
echo '0' > exp
- compare out exp || fail=1
+ compare exp out || fail=1
# Ensure the size of the case classes are accounted
# for as a unit.
echo 'a' |
tr -t '[:lower:][:lower:]a' '[:lower:][:upper:]0' >out || fail=1
echo '0' > exp
- compare out exp || fail=1
+ compare exp out || fail=1
fi
Exit $fail
cat <<EOF > exp
truncate: cannot open \`$dir' for writing: No such file or directory
EOF
-compare out exp || fail=1
+compare exp out || fail=1
dir=$d1/
truncate -s0 $dir > out 2>&1 && fail=1
2 3 10 total
EOF
-compare out exp || fail=1
+compare exp out || fail=1
if test "$fail" = ''; then
# Repeat the above test, but read the file name list from stdin.
rm -f out
wc --files0-from=- < names > out || fail=1
- compare out exp || fail=1
+ compare exp out || fail=1
fi
Exit $fail
-e 's/ Unknown error .*$//' \
-e 's/ No such file or directory$//' out > k || fail=1
mv k out || fail=1
- compare out exp || fail=1
+ compare exp out || fail=1
done
Exit $fail
`A' -> `B' (backup: `B.~1~')
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
XXX: backing up `YYY' would destroy source; `ZZZ' not moved
EOF
-compare out2 exp || fail=1
+compare exp out2 || fail=1
Exit $fail
mv: target `f2' is not a directory
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
mv: cannot move `b/t' to `a/t': Directory not empty
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
$i: warning: source file \`a' specified more than once
$i: will not overwrite just-created \`d/a' with \`a'
EOF
- compare out exp || fail=1
+ compare exp out || fail=1
done
for i in mv; do
$i: cannot stat \`a': No such file or directory
$i: cannot stat \`a': No such file or directory
EOF
- compare out exp || fail=1
+ compare exp out || fail=1
done
Exit $fail
mv: \`$ff' and \`$ff' are the same file
EOF
-compare out exp || fail=1
+compare exp out || fail=1
test `cat $ff` = force-contents || fail=1
# This should succeed, even though the source and destination
removed `x'
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
touch exp
touch exp_err
-compare out exp || fail=1
-compare err exp_err || fail=1
+compare exp out || fail=1
+compare exp_err err || fail=1
case "`cat b/foo`" in
foo) ;;
XXX: cannot move `SRC' to a subdirectory of itself, `DEST'
EOF
-compare out2 exp || fail=1
+compare exp out2 || fail=1
# Make sure the file is gone.
test -f $file && fail=1
EOF
#'
-compare out2 exp || fail=1
+compare exp out2 || fail=1
Exit $fail
XXX: cannot move `ZZZ' to a subdirectory of itself, `ZZZ/ZZZ'
EOF
-compare out2 exp || fail=1
+compare exp out2 || fail=1
Exit $fail
\`$dir/d/e/f/file2' -> \`XXX/$dir/d/e/f/file2'
EOF
-compare out2 exp || fail=1
+compare exp out2 || fail=1
# cd "$other_partition_tmpdir"
# ls -l -A -R "$other_partition_tmpdir"
fail=1
fi
fi
-test $fail = 1 && compare out exp
+test $fail = 1 && compare exp out
Exit $fail
mv: cannot move `no-write/dir' to `./dir': Permission denied
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
mv: cannot remove `t/root-owned': Operation not permitted
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
# Map "No such file..." diagnostic to the expected "Not a directory"
sed 's/No such file or directory/Not a directory/' err > k && mv k err
-compare err expected-err || fail=1
+compare expected-err err || fail=1
Exit $fail
rm: cannot remove `a/b/file'
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
sed 's/remove directory/remove/' out-t > out
rm -f out-t
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
EOF
# Before coreutils-5.93 this test would fail on Solaris 9 and newer.
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
rm: cannot remove `a/b': Operation not permitted
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
cat <<\EOF > exp
rm: cannot remove `d/f': Permission denied
EOF
-compare out exp || fail=1
+compare exp out || fail=1
# This used to fail with ELOOP.
rm -rf e 2> out && fail=1
cat <<\EOF > exp
rm: cannot remove `e/slink': Permission denied
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
rm --interactive=never f > out || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
# to the expected one:
sed 's/: The file access permissions.*/: Permission denied/'<out>o1;mv o1 out
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
rm: remove all arguments recursively? .
EOF
-compare out expout || fail=1
-compare err experr || fail=1
+compare expout out || fail=1
+compare experr err || fail=1
Exit $fail
rm: remove all arguments recursively? .
EOF
-compare out expout || fail=1
-compare err experr || fail=1
+compare expout out || fail=1
+compare experr err || fail=1
Exit $fail
# Append an `x' and a newline.
echo x >> out
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
rm --one-file-system -rf a 2> out && fail=1
test -d $t/y || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
cmp out exp > /dev/null 2>&1 || {
cmp out exp2 || fail=1
}
-test $fail = 1 && compare out exp
+test $fail = 1 && compare exp out
test -d b/a/p || fail=1
test -d b/c && fail=1
cmp out exp > /dev/null 2>&1 \
|| { cmp out exp-solaris > /dev/null 2>&1 || fail=1; }
-test $fail = 1 && compare out exp
+test $fail = 1 && compare exp out
test -d a/0 && fail=1
test -d a/1 || fail=1
rm: remove directory \`z'
EOF
-compare out exp || fail=1
+compare exp out || fail=1
test -d z && fail=1
# Make sure it's been removed.
test -d d && fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
rm: cannot remove `a': Permission denied
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
removed directory: `a'
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
FIXME
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
printf '\n3\n' > exp-2
printf '4\n5\n' > exp-3
-compare xaa exp-1 || fail=1
-compare xab exp-2 || fail=1
-compare xac exp-3 || fail=1
-compare b1 exp-1 || fail=1
-compare b2 exp-2 || fail=1
-compare b3 exp-3 || fail=1
+compare exp-1 xaa || fail=1
+compare exp-2 xab || fail=1
+compare exp-3 xac || fail=1
+compare exp-1 b1 || fail=1
+compare exp-2 b2 || fail=1
+compare exp-3 b3 || fail=1
test -f xad && fail=1
Exit $fail
cat <<\EOF > exp
split: line count option -99*... is too large
EOF
-compare out exp || fail=1
+compare exp out || fail=1
# Make sure split fails when it can't read input
# (the current directory in this case)
# invalid number of chunks
echo 'split: 1o: invalid number of chunks' > exp
split -n l/1o 2>err && fail=1
-compare err exp || fail=1
+compare exp err || fail=1
echo "split: \`-': cannot determine file size" > exp
echo | split -n l/1 2>err && fail=1
-compare err exp || fail=1
+compare exp err || fail=1
# N can be greater than the file size
# in which case no data is extracted, or empty files are written
echo 'split: 16: invalid chunk number' > exp
split -n l/16/15 in 2>err && fail=1
-compare err exp || fail=1
+compare exp err || fail=1
printf '%s' "\
14 16 09 15 16 10
: > out
printf '1\n12345\n' > exp
split -n l/13/15 in > out
-compare out exp || fail=1
+compare exp out || fail=1
: > out
printf '' > exp
split -n l/14/15 in > out
-compare out exp || fail=1
+compare exp out || fail=1
: > out
printf '1\n12345\n1\n' > exp
split -n l/15/15 in > out
-compare out exp || fail=1
+compare exp out || fail=1
# test input with no \n at end
printf '12\n34\n5' > in
printf '5' > exp
split -n l/7/7 in > out
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
5
EOF
-compare xaa exp-1 || fail=1
-compare xab exp-2 || fail=1
-compare xac exp-3 || fail=1
+compare exp-1 xaa || fail=1
+compare exp-2 xab || fail=1
+compare exp-3 xac || fail=1
test -f xad && fail=1
Exit $fail
printf '2\n5\n' > exp-2
printf '3\n' > exp-3
-compare xaa exp-1 || fail=1
-compare xab exp-2 || fail=1
-compare xac exp-3 || fail=1
-compare r1 exp-1 || fail=1
-compare r2 exp-2 || fail=1
-compare r3 exp-3 || fail=1
+compare exp-1 xaa || fail=1
+compare exp-2 xab || fail=1
+compare exp-3 xac || fail=1
+compare exp-1 r1 || fail=1
+compare exp-2 r2 || fail=1
+compare exp-3 r3 || fail=1
test -f xad && fail=1
# Test input without trailing \n
printf '1\n2\n3\n4\n5' | split -n r/2/3 > out
printf '2\n5' > exp
-compare out exp || fail=1
+compare exp out || fail=1
# Ensure we fall back to appending to a file at a time
# if we hit the limit for the number of open files.
test -f xaa && fail=1
test -f xaz && fail=1
rm -f x*
-compare err exp-too-short || fail=1
+compare exp-too-short err || fail=1
# With a longer suffix, it must succeed.
split --verbose -b 1 -a 2 in > err || fail=1
-compare err exp || fail=1
+compare exp err || fail=1
# Ensure that xbb is *not* created.
test -f xbb && fail=1
1
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
# we can compare against the above error
sed '/inotify cannot be used/d' err > k && mv k err
-compare err exp || fail=1
+compare exp err || fail=1
Exit $fail
test -s err && fail=1
# Ensure there was
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
echo foo | timeout 10 tail -f -c3 > out || fail=1
echo oo > exp || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
# Wait 6.3s for tail to write something.
retry_delay_ check_tail_output .1 7 || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
# Kill the still-running tail, or fail if it's gone.
kill $pid || fail=1
2
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
stat --p='%.9Y\n' f > out || fail=1
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
touch: cannot touch \`$file': No such file or directory
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail
done
test "$match" = 1 || fail=1
-test $fail = 1 && compare out exp
+test $fail = 1 && compare exp out
Exit $fail
2004-01-11
EOF
-compare out exp || fail=1
+compare exp out || fail=1
Exit $fail