set _ $groups; shift
g2=$2
-mkdir d && touch f && ln -s ../f d/s || framework_failure
+mkdir d && touch f && ln -s ../f d/s || framework_failure_
g_init=`stat --printf=%g f`
g1=$1
g2=$2
-mkdir -p d/no-x/y || framework_failure
-chmod u=rw d/no-x || framework_failure
+mkdir -p d/no-x/y || framework_failure_
+chmod u=rw d/no-x || framework_failure_
# This must exit nonzero.
g1=$1
g2=$2
-mkdir 1 2 3 || framework_failure
-touch 1/1F 2/2F 3/3F || framework_failure
-ln -s 1 1s || framework_failure
-ln -s ../3 2/2s || framework_failure
-chgrp -R $g1 1 2 3 || framework_failure
+mkdir 1 2 3 || framework_failure_
+touch 1/1F 2/2F 3/3F || framework_failure_
+ln -s 1 1s || framework_failure_
+ln -s ../3 2/2s || framework_failure_
+chgrp -R $g1 1 2 3 || framework_failure_
chgrp --preserve-root -H -R $g2 1s 2 || fail=1
umask 0
file=f
-touch $file || framework_failure
-chmod 444 $file || framework_failure
+touch $file || framework_failure_
+chmod 444 $file || framework_failure_
skip_if_setgid_
print_ver_ chmod
file=f
-touch $file || framework_failure
+touch $file || framework_failure_
umask 005
for mode in =x =xX =Xx =x,=X =X,=x; do
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ chmod
-touch f || framework_failure
+touch f || framework_failure_
expected_u=-rwx------
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ chmod
-mkdir -p d/e || framework_failure
-chmod 0 d/e d || framework_failure
+mkdir -p d/e || framework_failure_
+chmod 0 d/e d || framework_failure_
chmod u+rwx d d/e || fail=1
print_ver_ chmod
skip_if_root_
-mkdir -p d/no-x/y a/b || framework_failure
-chmod u=rw d/no-x || framework_failure
+mkdir -p d/no-x/y a/b || framework_failure_
+chmod u=rw d/no-x || framework_failure_
# This must exit nonzero.
print_ver_ chmod
umask 0
-mkdir d || framework_failure
+mkdir d || framework_failure_
chmod g+s d 2> /dev/null && env -- test -g d ||
{
id_g=`id -g` &&
test -n "$id_g" &&
chgrp "$id_g" d &&
- chmod g+s d || framework_failure
+ chmod g+s d || framework_failure_
}
# "chmod g+s d" does nothing on some NFS file systems.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ chmod
-ln -s non-existent dangle || framework_failure
+ln -s non-existent dangle || framework_failure_
# This operation cannot succeed since the symbolic link dangles.
case $files in
'')
- touch -- $all_files || framework_failure
+ touch -- $all_files || framework_failure_
chmod $args 2>/dev/null && fail=1
;;
?*)
- touch -- $files || framework_failure
+ touch -- $files || framework_failure_
chmod $args || fail=1
for file in $files; do
# Test for misparsing args by creating all $files but $file.
# chmod has a bug if it succeeds even though $file is absent.
rm -f -- $all_files && touch -- $files && rm -- $file \
- || framework_failure
+ || framework_failure_
chmod $args 2>/dev/null && fail=1
done
;;
print_ver_ chgrp
require_root_
-touch f || framework_failure
+touch f || framework_failure_
chown -R --preserve-root 0:1 f
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ chown
-ln -s no-such dangle || framework_failure
+ln -s no-such dangle || framework_failure_
set _ `ls -ldo dangle`; shift; user=$3
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ chown
-id_u=`id -u` || framework_failure
-test -n "$id_u" || framework_failure
+id_u=`id -u` || framework_failure_
+test -n "$id_u" || framework_failure_
-id_un=`id -un` || framework_failure
-test -n "$id_un" || framework_failure
+id_un=`id -un` || framework_failure_
+test -n "$id_un" || framework_failure_
-id_g=`id -g` || framework_failure
-test -n "$id_g" || framework_failure
+id_g=`id -g` || framework_failure_
+test -n "$id_g" || framework_failure_
-id_gn=`id -gn` || framework_failure
-test -n "$id_gn" || framework_failure
+id_gn=`id -gn` || framework_failure_
+test -n "$id_gn" || framework_failure_
# FreeBSD 6.x's getgrnam fails to look up a group name containing
# a space. On such a system, skip this test if the group name contains
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-mkdir a b c || framework_failure
-ln -s ../t a/1 || framework_failure
-echo payload > b/1 || framework_failure
+mkdir a b c || framework_failure_
+ln -s ../t a/1 || framework_failure_
+echo payload > b/1 || framework_failure_
echo "cp: will not copy \`b/1' through just-created symlink \`c/1'" \
- > exp || framework_failure
+ > exp || framework_failure_
# Check both cases: a dangling symlink, and one pointing to a writable file.
grep '^#define USE_ACL 1' $CONFIG_HEADER > /dev/null ||
skip_ "insufficient ACL support"
-mkdir -p a b || framework_failure
-touch a/file || framework_failure
+mkdir -p a b || framework_failure_
+touch a/file || framework_failure_
# Ensure that setfacl and getfacl work on this file system.
skip=no
# copy a file without preserving permissions
cp a/file b/ || fail=1
-acl2=`cd b && getfacl file` || framework_failure
+acl2=`cd b && getfacl file` || framework_failure_
test "$acl1" = "$acl2" || fail=1
# Update with acl set above
-acl1=`cd a && getfacl file` || framework_failure
+acl1=`cd a && getfacl file` || framework_failure_
# copy a file, preserving permissions
cp -p a/file b/ || fail=1
-acl2=`cd b && getfacl file` || framework_failure
+acl2=`cd b && getfacl file` || framework_failure_
test "$acl1" = "$acl2" || fail=1
# copy a file, preserving permissions, with --attributes-only
-echo > a/file || framework_failure # add some data
-test -s a/file || framework_failure
+echo > a/file || framework_failure_ # add some data
+test -s a/file || framework_failure_
cp -p --attributes-only a/file b/ || fail=1
test -s b/file && fail=1
-acl2=`cd b && getfacl file` || framework_failure
+acl2=`cd b && getfacl file` || framework_failure_
test "$acl1" = "$acl2" || fail=1
Exit $fail
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-mkdir x y || framework_failure
+mkdir x y || framework_failure_
cp -a x y || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-echo a > a || framework_failure
-echo a-tilde > a~ || framework_failure
+echo a > a || framework_failure_
+echo a-tilde > a~ || framework_failure_
# This cp command should exit nonzero.
cp --b=simple a~ a > out 2>&1 && fail=1
|| skip_ "getcap utility not found"
-touch file || framework_failure
-chown $NON_ROOT_USERNAME file || framework_failure
+touch file || framework_failure_
+chown $NON_ROOT_USERNAME file || framework_failure_
setcap 'cap_net_bind_service=ep' file ||
skip_ "setcap doesn't work"
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-mkdir src-dir dest-dir || framework_failure
-echo f > f || framework_failure
-ln -s f slink || framework_failure
-ln -s no-such-file src-dir/slink || framework_failure
+mkdir src-dir dest-dir || framework_failure_
+echo f > f || framework_failure_
+ln -s f slink || framework_failure_
+ln -s no-such-file src-dir/slink || framework_failure_
cp -H -R slink src-dir dest-dir || fail=1
ctx=root:object_r:tmp_t:s0
# Check basic functionality - before check on fixed context mount
-touch c || framework_failure
-chcon $ctx c || framework_failure
-cp -a c d 2>err || framework_failure
-cp --preserve=context c e || framework_failure
-cp --preserve=all c f || framework_failure
+touch c || framework_failure_
+chcon $ctx c || framework_failure_
+cp -a c d 2>err || framework_failure_
+cp --preserve=context c e || framework_failure_
+cp --preserve=all c f || framework_failure_
ls -Z d | grep $ctx || fail=1
test -s err && fail=1 #there must be no stderr output for -a
ls -Z e | grep $ctx || fail=1
test $skip = 1 \
&& skip_ "insufficient mount/ext2 support"
-cd mnt || framework_failure
+cd mnt || framework_failure_
-echo > f || framework_failure
+echo > f || framework_failure_
-echo > g || framework_failure
+echo > g || framework_failure_
# /bin/cp from coreutils-6.7-3.fc7 would fail this test by letting cp
# succeed (giving no diagnostics), yet leaving the destination file empty.
cp -a f g 2>err || fail=1
# NFS mounted directory. When doing that, I get this diagnostic:
# cp: failed to set the security context of `g' to `system_u:object_r:nfs_t': \
# Operation not supported
-cat <<\EOF > exp || framework_failure=1
+cat <<\EOF > exp || framework_failure_
cp: failed to set the security context of
EOF
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-mkdir a b c d || framework_failure
-ln -s ../c a || framework_failure
-ln -s ../c b || framework_failure
+mkdir a b c d || framework_failure_
+ln -s ../c a || framework_failure_
+ln -s ../c b || framework_failure_
# Before coreutils-5.94, the following would fail with this message:
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-mkdir -p a b/a/c || framework_failure
-touch a/c || framework_failure
+mkdir -p a b/a/c || framework_failure_
+touch a/c || framework_failure_
# coreutils 6.2 cp would neglect to prompt in this case.
echo n | cp -iR a b 2>/dev/null || fail=1
# test miscellaneous combinations of -f -i -n parameters
-touch c d || framework_failure
+touch c d || framework_failure_
echo "\`c' -> \`d'" > out_copy
> out_empty
xattr_value="bar"
xattr_pair="$xattr_name=\"$xattr_value\""
-echo test > xattr/a || framework_failure
+echo test > xattr/a || framework_failure_
getfattr -d xattr/a >out_a || skip_ "failed to get xattr of file"
-grep -F "$xattr_pair" out_a >/dev/null && framework_failure
+grep -F "$xattr_pair" out_a >/dev/null && framework_failure_
setfattr -n "$xattr_name" -v "$xattr_value" xattr/a >out_a \
|| skip_ "failed to set xattr of file"
getfattr -d xattr/a >out_a || skip_ "failed to get xattr of file"
# Run the setgid check from the just-created directory.
skip_if_setgid_
-mkdir foo bar || framework_failure
-mkdir -p a/b/c d e g || framework_failure
-ln -s d/a sym || framework_failure
-touch f || framework_failure
+mkdir foo bar || framework_failure_
+mkdir -p a/b/c d e g || framework_failure_
+ln -s d/a sym || framework_failure_
+touch f || framework_failure_
# With 4.0.37 and earlier (back to when?), this would fail
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-touch f slink-target || framework_failure
-ln -s slink-target slink || framework_failure
+touch f slink-target || framework_failure_
+ln -s slink-target slink || framework_failure_
cp -d f slink || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-mkdir d e || framework_failure
+mkdir d e || framework_failure_
# Do it once with no destination...
cp -R --remove-destination d e || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-mkdir dir1 dir2 || framework_failure
-touch dir1/file || framework_failure
+mkdir dir1 dir2 || framework_failure_
+touch dir1/file || framework_failure_
cp -R dir1/ dir2 || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-mkdir dir || framework_failure
-touch file || framework_failure
+mkdir dir || framework_failure_
+touch file || framework_failure_
# In 4.0.35, this cp invocation silently succeeded.
print_ver_ cp
skip_if_root_
-chmod g-s . || framework_failure
-mkdir D D/D || framework_failure
-touch D/a || framework_failure
-chmod 0 D/a || framework_failure
-chmod u=rx,go=,-st D || framework_failure
+chmod g-s . || framework_failure_
+mkdir D D/D || framework_failure_
+touch D/a || framework_failure_
+chmod 0 D/a || framework_failure_
+chmod u=rx,go=,-st D || framework_failure_
# This is expected to exit non-zero, because it can't read D/a.
rm space.test
# Ensure we read a large empty file quickly
-fallocate -l 300MiB empty.big || framework_failure
+fallocate -l 300MiB empty.big || framework_failure_
timeout 3 cp --sparse=always empty.big cp.test || fail=1
test $(stat -c %s empty.big) = $(stat -c %s cp.test) || fail=1
rm empty.big cp.test
# Ensure we handle extents beyond file size correctly.
# Note until we support fallocate, we will not maintain
# the file allocation. FIXME: amend this test when fallocate is supported.
-fallocate -l 10MiB -n unwritten.withdata || framework_failure
+fallocate -l 10MiB -n unwritten.withdata || framework_failure_
dd count=10 if=/dev/urandom conv=notrunc iflag=fullblock of=unwritten.withdata
cp unwritten.withdata cp.test || fail=1
test $(stat -c %s unwritten.withdata) = $(stat -c %s cp.test) || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-mkdir a dir || framework_failure
+mkdir a dir || framework_failure_
# This command should exit nonzero.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-touch src || framework_failure
-touch dest || framework_failure
-touch dest2 || framework_failure
+touch src || framework_failure_
+touch dest || framework_failure_
+touch dest2 || framework_failure_
cp -f --link src dest || fail=1
(mkdir $a \
&& cd $a \
&& seq --format=%031g 10000 |xargs touch \
- && seq --format=d%030g 10000 |xargs mkdir ) || framework_failure
-cp -al $a $b || framework_failure
-mkdir e || framework_failure
-mv $a $b e || framework_failure
+ && seq --format=d%030g 10000 |xargs mkdir ) || framework_failure_
+cp -al $a $b || framework_failure_
+mkdir e || framework_failure_
+mv $a $b e || framework_failure_
(ulimit -v 20000; cp -al e f) || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-ln -s no-such-file dangling-slink || framework_failure
+ln -s no-such-file dangling-slink || framework_failure_
# Prior to coreutils-6.0, this would fail on non-Linux kernels,
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-touch a || framework_failure
-ln a b || framework_failure
-mkdir c || framework_failure
-cp -d a b c || framework_failure
-test -f c/a || framework_failure
-test -f c/b || framework_failure
+touch a || framework_failure_
+ln a b || framework_failure_
+mkdir c || framework_failure_
+cp -d a b c || framework_failure_
+test -f c/a || framework_failure_
+test -f c/b || framework_failure_
a_inode=`ls -i c/a|sed 's,c/.*,,'`
# Check that the timestamps of the symlink are copied
# if we're using hardlink to symlink emulation.
touch file
-ln -s file link || framework_failure
+ln -s file link || framework_failure_
touch -m -h -d 2011-01-01 link ||
skip_ "Your system doesn't support updating symlink timestamps"
case `stat --format=%y link` in
# cp -p gives ENOTSUP on NFS on Linux 2.6.9 at least
require_local_dir_
-mkdir -p a/b/c a/b/d e || framework_failure
-touch a/b/c/foo a/b/d/foo || framework_failure
-cp -p --parent a/b/c/foo e || framework_failure
+mkdir -p a/b/c a/b/d e || framework_failure_
+touch a/b/c/foo a/b/d/foo || framework_failure_
+cp -p --parent a/b/c/foo e || framework_failure_
# Make permissions of e/a different, so that we exercise the
# code in cp -p --parents that propagates permissions even
# to a destination directory that it doesn't create.
-chmod g-rx e/a e/a/b || framework_failure
+chmod g-rx e/a e/a/b || framework_failure_
cp -p --parent a/b/d/foo e || fail=1
require_local_dir_
umask 002
-mkdir mode ownership d || framework_failure
+mkdir mode ownership d || framework_failure_
chmod g+s d 2>/dev/null # The cp test is valid either way.
# cp -p gives ENOTSUP on NFS on Linux 2.6.9 at least
require_local_dir_
-touch f || framework_failure
+touch f || framework_failure_
cp --preserve=mode,links f g || fail=1
grep '^#define HAVE_LUTIMES 1' "$CONFIG_HEADER" > /dev/null ||
skip_ 'this system lacks the utimensat function'
-ln -s no-such dangle || framework_failure
+ln -s no-such dangle || framework_failure_
# If the current file system lacks sub-second resolution, sleep for 2s to
# ensure that the times on the copy are different from those of the original.
esac
# Can't use --format=%x, as lstat() modifies atime on some platforms.
-cp -Pp dangle d2 || framework_failure
-stat --format=%y dangle > t1 || framework_failure
-stat --format=%y d2 > t2 || framework_failure
+cp -Pp dangle d2 || framework_failure_
+stat --format=%y dangle > t1 || framework_failure_
+stat --format=%y d2 > t2 || framework_failure_
compare t1 t2 || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-touch empty || framework_failure
+touch empty || framework_failure_
f=/proc/cpuinfo
test -r $f || f=empty
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-echo abc > foo || framework_failure
-ln -s foo slink || framework_failure
-ln -s no-such-file no-file || framework_failure
+echo abc > foo || framework_failure_
+ln -s foo slink || framework_failure_
+ln -s no-such-file no-file || framework_failure_
# This would fail in 4.1.5, not in 4.1.6.
cleanup_() { rm -rf "$other_partition_tmpdir"; }
. "$abs_srcdir/other-fs-tmpdir"
a_other="$other_partition_tmpdir/a"
-rm -f "$a_other" || framework_failure
+rm -f "$a_other" || framework_failure_
-echo non_zero_size > "$a_other" || framework_failure
+echo non_zero_size > "$a_other" || framework_failure_
# we shouldn't be able to reflink() files on separate partitions
cp --reflink "$a_other" b && fail=1
: > time_check
: > file
ts='2009-08-28 19:00'
-touch -d "$ts" file || framework_failure
+touch -d "$ts" file || framework_failure_
test time_check -nt file || skip_ "The system clock is wrong"
-chmod a=rwx file || framework_failure
+chmod a=rwx file || framework_failure_
umask 077
cp --reflink=auto --preserve file copy || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-touch file || framework_failure
-ln -s file a || framework_failure
-ln -s file b || framework_failure
-ln -s no-such-file c || framework_failure
-ln -s no-such-file d || framework_failure
+touch file || framework_failure_
+ln -s file a || framework_failure_
+ln -s file b || framework_failure_
+ln -s no-such-file c || framework_failure_
+ln -s no-such-file d || framework_failure_
cp --update --no-dereference a b || fail=1
cp --update --no-dereference c d || fail=1
# Make its size one larger than 128K, in order to tickle the
# bug in coreutils-6.0.
size=`expr 128 \* 1024 + 1`
-dd bs=1 seek=$size of=sparse < /dev/null 2> /dev/null || framework_failure
+dd bs=1 seek=$size of=sparse < /dev/null 2> /dev/null || framework_failure_
cp --sparse=always sparse copy || fail=1
# j: 6 extents found
# exclude the physical block numbers; they always differ
- filefrag -v j1 > ff1 || framework_failure
- filefrag -vs j2 > ff2 || framework_failure
+ filefrag -v j1 > ff1 || framework_failure_
+ filefrag -vs j2 > ff2 || framework_failure_
{ f ff1; f ff2; } | $PERL $abs_top_srcdir/tests/filefrag-extent-compare \
|| {
warn_ ignoring filefrag-reported extent map differences
print_ver_ cp
require_root_
-touch a b c || framework_failure
-chmod u+sx,go= a || framework_failure
-chmod u=rwx,g=sx,o= b || framework_failure
-chmod a=r,ug+sx c || framework_failure
-chown $NON_ROOT_USERNAME . || framework_failure
-chmod u=rwx,g=rx,o=rx . || framework_failure
+touch a b c || framework_failure_
+chmod u+sx,go= a || framework_failure_
+chmod u=rwx,g=sx,o= b || framework_failure_
+chmod a=r,ug+sx c || framework_failure_
+chown $NON_ROOT_USERNAME . || framework_failure_
+chmod u=rwx,g=rx,o=rx . || framework_failure_
cp -p a a2 || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-mkdir x y || framework_failure
+mkdir x y || framework_failure_
cd y
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-mkdir dir || framework_failure
-ln -s dir symlink || framework_failure
+mkdir dir || framework_failure_
+ln -s dir symlink || framework_failure_
cp -dR symlink/ s || fail=1
set `ls -l s`
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp
-ln -s no-such dangle || framework_failure
-echo hi > f || framework_failure
-echo hi > exp || framework_failure
+ln -s no-such dangle || framework_failure_
+echo hi > f || framework_failure_
+echo hi > exp || framework_failure_
echo "cp: not writing through dangling symlink \`dangle'" \
- > exp-err || framework_failure
+ > exp-err || framework_failure_
# Starting with 6.9.90, this usage fails, by default:
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ dd
-truncate -s 8192 in || framework_failure
+truncate -s 8192 in || framework_failure_
dd if=in oflag=direct of=out 2> /dev/null \
|| skip_ 'this file system lacks support for O_DIRECT'
-truncate -s 511 short || framework_failure
-truncate -s 8191 m1 || framework_failure
-truncate -s 8193 p1 || framework_failure
+truncate -s 511 short || framework_failure_
+truncate -s 8191 m1 || framework_failure_
+truncate -s 8193 p1 || framework_failure_
for i in short m1 p1; do
rm -f out
tmp_out=dd-out
warn=0
-echo data > $tmp_in || framework_failure
-ln $tmp_in $tmp_in2 || framework_failure
-ln -s $tmp_in $tmp_sym || framework_failure
+echo data > $tmp_in || framework_failure_
+ln $tmp_in $tmp_in2 || framework_failure_
+ln -s $tmp_in $tmp_sym || framework_failure_
dd if=$tmp_in of=$tmp_out 2> /dev/null || fail=1
compare $tmp_in $tmp_out || fail=1
# There might be some missed failures but it's unlikely.
(echo a; sleep .1; echo b) \
| env LC_ALL=C dd bs=4 status=noxfer iflag=fullblock >out 2>err || fail=1
-printf 'a\nb\n' > out_ok || framework_failure
+printf 'a\nb\n' > out_ok || framework_failure_
echo "1+0 records in
-1+0 records out" > err_ok || framework_failure
+1+0 records out" > err_ok || framework_failure_
compare out_ok out || fail=1
compare err_ok err || fail=1
# The rest ensure that the documented uses cases
# proceed without error
for f in ifile ofile; do
- dd if=/dev/zero of=$f conv=fdatasync count=100 || framework_failure
+ dd if=/dev/zero of=$f conv=fdatasync count=100 || framework_failure_
done
# Advise to drop cache for whole file
print_ver_ dd
# 2 short reads -> 1 full write + 1 partial write
-cat <<\EOF > exp-reblock || framework_failure
+cat <<\EOF > exp-reblock || framework_failure_
0+2 records in
1+1 records out
4 bytes (4 B) copied
EOF
# 2 short reads -> 2 partial writes
-cat <<\EOF > exp-no-reblock || framework_failure
+cat <<\EOF > exp-no-reblock || framework_failure_
0+2 records in
0+2 records out
4 bytes (4 B) copied
# Get path to device the current dir is on.
# Note df can only get fs size, not device size.
-device=$(df -P . | tail -n1 | cut -d' ' -f1) || framework_failure
+device=$(df -P . | tail -n1 | cut -d' ' -f1) || framework_failure_
dev_size=$(get_device_size "$device") ||
skip_ "failed to determine size of $device"
test "$?" = "1" || fail=1
echo "dd: \`standard input': cannot skip: Invalid argument
0+0 records in
-0+0 records out" > err_ok || framework_failure
+0+0 records out" > err_ok || framework_failure_
compare err_ok err || fail=1
timeout 10 dd bs=1 seek=$DEV_OFLOW count=0 status=noxfer > "$device" 2> err
test "$?" = "1" || fail=1
echo "dd: \`standard output': cannot seek: Invalid argument
0+0 records in
-0+0 records out" > err_ok || framework_failure
+0+0 records out" > err_ok || framework_failure_
compare err_ok err || fail=1
Exit $fail
eval $(getlimits) # for OFF_T limits
-printf "1234" > file || framework_failure
+printf "1234" > file || framework_failure_
echo "\
dd: \`standard input': cannot skip to specified offset
0+0 records in
-0+0 records out" > skip_err || framework_failure
+0+0 records out" > skip_err || framework_failure_
# skipping beyond number of blocks in file should issue a warning
dd bs=1 skip=5 count=0 status=noxfer < file 2> err || fail=1
# seeking beyond end of file is OK
dd bs=1 seek=5 count=0 status=noxfer > file 2> err || fail=1
echo "0+0 records in
-0+0 records out" > err_ok || framework_failure
+0+0 records out" > err_ok || framework_failure_
compare err_ok err || fail=1
# skipping > OFF_T_MAX should fail immediately
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ dd
-printf 000100020003xx > in || framework_failure
+printf 000100020003xx > in || framework_failure_
dd cbs=4 ibs=4 conv=unblock,sync < in > out 2> /dev/null || fail=1
df || skip_ "df fails"
-cat <<\EOF > check-df || framework_failure
+cat <<\EOF > check-df || framework_failure_
my ($total, $used, $avail) = (0, 0, 0);
while (<>)
{
# Use --block-size=512 to keep df from printing rounded-to-kilobyte
# numbers which wouldn't necessarily add up to the displayed total.
-df --total -P --block-size=512 > space || framework_failure
+df --total -P --block-size=512 > space || framework_failure_
cat space # this helps when debugging any test failure
-df --total -i -P > inode || framework_failure
+df --total -i -P > inode || framework_failure_
cat inode
$PERL check-df space || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ du
-mkdir -p a/b d d/sub || framework_failure
+mkdir -p a/b d d/sub || framework_failure_
# Ensure that these files contain more than 64 bytes, so that we don't
# immediately disqualify file systems (e.g., NetApp) on which smaller
# files take up zero disk blocks.
-printf '%*s' 257 make-sure-the-file-is-non-empty > a/b/F || framework_failure
+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
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ du
-mkdir -p a/sub || framework_failure
-ln -s a/sub slink || framework_failure
-touch b || framework_failure
-ln -s .. a/sub/dotdot || framework_failure
-ln -s nowhere dangle || framework_failure
+mkdir -p a/sub || framework_failure_
+ln -s a/sub slink || framework_failure_
+touch b || framework_failure_
+ln -s .. a/sub/dotdot || framework_failure_
+ln -s nowhere dangle || framework_failure_
# This used to fail with the following diagnostic:
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ du
-mkdir -p dir/a || framework_failure
-ln -s dir slink || framework_failure
-printf %65536s x > 64k || framework_failure
-ln -s 64k slink-to-64k || framework_failure
+mkdir -p dir/a || framework_failure_
+ln -s dir slink || framework_failure_
+printf %65536s x > 64k || framework_failure_
+ln -s 64k slink-to-64k || framework_failure_
du -D slink | sed 's/^[0-9][0-9]* //' > out
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ du
-mkdir -p a/b/c a/x/y a/u/v || framework_failure
+mkdir -p a/b/c a/x/y a/u/v || framework_failure_
du --exclude=x a | sed 's/^[0-9][0-9]* //' | sort > out || fail=1
done
# This may fail due to command line limitations.
-touch $f || framework_failure
+touch $f || framework_failure_
# With coreutils-5.0, this would fail due to a file descriptor leak.
skip_if_root_
mkdir f && cd f && mkdir a b c d e && touch c/j && chmod a-x c \
- || framework_failure
+ || framework_failure_
du > ../t 2>&1 && fail=1
print_ver_ du
skip_if_root_
-mkdir -p a/sub || framework_failure
+mkdir -p a/sub || framework_failure_
du -s a > exp || fail=1
skip_if_root_
cwd=`pwd`
-mkdir -p no-x a/b || framework_failure
-cd no-x || framework_failure
-chmod 0 . || framework_failure
+mkdir -p no-x a/b || framework_failure_
+cd no-x || framework_failure_
+chmod 0 . || framework_failure_
du "$cwd/a" > /dev/null || fail=1
# Construct a hierarchy containing a relative file with a name
# longer than PATH_MAX.
# for i in `seq 52`; do
-# mkdir $dir || framework_failure
-# cd $dir || framework_failure
+# mkdir $dir || framework_failure_
+# cd $dir || framework_failure_
# done
-# cd $tmp || framework_failure
+# cd $tmp || framework_failure_
# Sheesh. Bash 3.1.5 can't create this hierarchy. I get
# cd: error retrieving current directory: getcwd:
$PERL \
-e 'my $d = '$dir'; foreach my $i (1..52)' \
-e ' { mkdir ($d, 0700) && chdir $d or die "$!" }' \
- || framework_failure
+ || framework_failure_
-mkdir inaccessible || framework_failure
-cd inaccessible || framework_failure
-chmod 0 . || framework_failure
+mkdir inaccessible || framework_failure_
+cd inaccessible || framework_failure_
+chmod 0 . || framework_failure_
du -s "$cwd/$dir" > /dev/null || fail=1
n=400
dir_list=`seq $n`
-mkdir $dir_list || framework_failure
+mkdir $dir_list || framework_failure_
file=1
i_minus_1=0
for i in $dir_list `expr $n + 1`; do
case $i_minus_1 in
0) ;;
*)
- ln -s ../$i $i_minus_1/s || framework_failure
+ ln -s ../$i $i_minus_1/s || framework_failure_
file=$file/s;;
esac
i_minus_1=$i
chmod a+x inotify-watch-for-dir-access.py
t=T/U
-mkdir d2 || framework_failure
+mkdir d2 || framework_failure_
long=d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z
# One iteration of this loop creates a tree with which
# du sometimes completes its traversal before the above rename.
# Using 10 iterations was not enough, either.
# Using 30, I saw no failure in 200 trials.
for i in $(seq 30); do
- mkdir -p $t/3/a/b/c/$i/$long || framework_failure
+ mkdir -p $t/3/a/b/c/$i/$long || framework_failure_
done
# Prohibit suspension, which could otherwise cause a timeout-induced FP failure.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ du
-mkdir -p dir/a/b || framework_failure
-ln -s dir slink || framework_failure
+mkdir -p dir/a/b || framework_failure_
+ln -s dir slink || framework_failure_
du slink | sed 's/^[0-9][0-9]* //' > out
print_ver_ du
skip_if_root_
-mkdir -p d/no-x/y || framework_failure
-chmod u=rw d/no-x || framework_failure
+mkdir -p d/no-x/y || framework_failure_
+chmod u=rw d/no-x || framework_failure_
# This must exit nonzero.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ du
-mkdir -p b/c y/z || framework_failure
+mkdir -p b/c y/z || framework_failure_
# Due to a used-uninitialized variable, the "du -x" from coreutils-6.6
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ du
-mkdir a b || framework_failure
+mkdir a b || framework_failure_
# With du from coreutils-4.5.5 and 4.5.6, this would fail with
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ du
-mkdir -p dir/1/2 || framework_failure
-ln -s dir slink || framework_failure
+mkdir -p dir/1/2 || framework_failure_
+ln -s dir slink || framework_failure_
du slink/ | sed 's/^[0-9][0-9]* //' > out
# Run this test from a sub-directory one level deeper than normal,
# so that the "du .." below doesn't traverse sibling directories
# that may be inaccessible due concurrently-running tests.
-mkdir sub || framework_failure
-cd sub || framework_failure
+mkdir sub || framework_failure_
+cd sub || framework_failure_
t=t
-mkdir -p $t/1 $t/2 || framework_failure
+mkdir -p $t/1 $t/2 || framework_failure_
test -d $t || fail=1
du $t/1 $t/2 > /dev/null || fail=1
# TESTS_ENVIRONMENT definition.
stderr_fileno_=9
-# FIXME: eventually, FIXME: s/(framework_failure)\>/${1}_/ and remove the
-# FIXME: definition of framework_failure below
-
# Having an unsearchable directory in PATH causes execve to fail with EACCES
# when applied to an unresolvable program name, contrary to the desired ENOENT.
# Avoid the problem by rewriting PATH to exclude unsearchable directories.
is_local_dir_()
{
- test $# = 1 || framework_failure
+ test $# = 1 || framework_failure_
df --local "$1" >/dev/null 2>&1
}
# with the named syscall. Usage: require_strace_ unlink
require_strace_()
{
- test $# = 1 || framework_failure
+ test $# = 1 || framework_failure_
strace -V < /dev/null > /dev/null 2>&1 ||
skip_ 'no strace program'
}
skip_if_root_() { uid_is_privileged_ && skip_ "must be run as non-root"; }
-framework_failure() { fatal_ 'failure in testing framework'; }
# Set `groups' to a space-separated list of at least two groups
# of which the user is a member.
require_membership_in_two_groups_()
{
- test $# = 0 || framework_failure
+ test $# = 0 || framework_failure_
groups=${COREUTILS_GROUPS-`(id -G || /usr/xpg4/bin/id -G) 2>/dev/null`}
case "$groups" in
# Does the current (working-dir) file system support sparse files?
require_sparse_support_()
{
- test $# = 0 || framework_failure
+ test $# = 0 || framework_failure_
# Test whether we can create a sparse file.
# For example, on Darwin6.5 with a file system of type hfs, it's not possible.
# NTFS requires 128K before a hole appears in a sparse file.
mkfifo_or_skip_()
{
- test $# = 1 || framework_failure
+ test $# = 1 || framework_failure_
if ! mkfifo "$1"; then
# Make an exception of this case -- usually we interpret framework-creation
# failure as a test failure. However, in this case, when running on a SunOS
skip_if_mcstransd_is_running_()
{
- test $# = 0 || framework_failure
+ test $# = 0 || framework_failure_
# When mcstransd is running, you'll see only the 3-component
# version of file-system context strings. Detect that,
# and if it's running, skip this test.
- __ctx=$(stat --printf='%C\n' .) || framework_failure
+ __ctx=$(stat --printf='%C\n' .) || framework_failure_
case $__ctx in
*:*:*:*) ;; # four components is ok
*) # anything else probably means mcstransd is running
dir=dir
file=file
-rm -rf $dir $file || framework_failure
-mkdir -p $dir || framework_failure
-echo foo > $file || framework_failure
+rm -rf $dir $file || framework_failure_
+mkdir -p $dir || framework_failure_
+echo foo > $file || framework_failure_
ginstall $file $dir || fail=1
# Make sure the source file still exists.
mode3=2755
-echo test > a || framework_failure
-echo "\`a' -> \`b'" > out_installed_first || framework_failure
+echo test > a || framework_failure_
+echo "\`a' -> \`b'" > out_installed_first || framework_failure_
echo "removed \`b'
-\`a' -> \`b'" > out_installed_second || framework_failure
-: > out_empty || framework_failure
+\`a' -> \`b'" > out_installed_second || framework_failure_
+: > out_empty || framework_failure_
# destination file does not exist
ginstall -Cv -m$mode1 a b > out || fail=1
compare out out_installed_second || fail=1
# files are not regular files
-ln -s a c || framework_failure
-ln -s b d || framework_failure
+ln -s a c || framework_failure_
+ln -s b d || framework_failure_
ginstall -Cv -m$mode1 c d > out || fail=1
echo "removed \`d'
\`c' -> \`d'" > out_installed_second_cd
compare out out_installed_second_cd || fail=1
# destination file exists but content differs
-echo test1 > a || framework_failure
+echo test1 > a || framework_failure_
ginstall -Cv -m$mode1 a b > out || fail=1
compare out out_installed_second || fail=1
ginstall -Cv -m$mode1 a b > out || fail=1
compare out out_empty || fail=1
# destination file exists but content differs (same size)
-echo test2 > a || framework_failure
+echo test2 > a || framework_failure_
ginstall -Cv -m$mode1 a b > out || fail=1
compare out out_installed_second || fail=1
ginstall -Cv -m$mode1 a b > out || fail=1
g2=2
-echo test > a || framework_failure
+echo test > a || framework_failure_
echo "\`a' -> \`b'" > out_installed_first
echo "removed \`b'
\`a' -> \`b'" > out_installed_second
require_selinux_
-echo test > a || framework_failure
+echo test > a || framework_failure_
chcon -u system_u a || skip_ "chcon doesn't work"
echo "\`a' -> \`b'" > out_installed_first
working_umask_or_skip_
-cat <<EOF > b || framework_failure
+cat <<EOF > b || framework_failure_
#!$PREFERABLY_POSIX_SHELL
sed s/b/B/ \$1 > \$1.t && mv \$1.t \$1
EOF
-chmod a+x b || framework_failure
+chmod a+x b || framework_failure_
echo abc > src || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ ln
-touch a b || framework_failure
+touch a b || framework_failure_
ln b b~ || fail=1
ln -f --b=simple a b || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ ln
-touch f || framework_failure
+touch f || framework_failure_
ln --backup f f 2> out && fail=1
# ===================================================
# ensure -s silently overrides -L, -P
-touch a || framework_failure
+touch a || framework_failure_
ln -L -s a symlink1 || fail=1
ln -P -s symlink1 symlink2 || fail=1
ln -s -L -P symlink2 symlink3 || fail=1
case "$ls" in
*'hard-to-ax') ;;
*'hard-to-a -> '*x) fail=1 ;;
- *) framework_failure ;;
+ *) framework_failure_ ;;
esac
# ===================================================
*'hard-to-3 -> symlink2x') ;;
*'hard-to-3x') fail=1 ;;
*'hard-to-3 -> '*x) fail=1 ;;
- *) framework_failure ;;
+ *) framework_failure_ ;;
esac
# ===================================================
# Create a hard link to a dangling symlink.
-ln -s /no-such-dir || framework_failure
+ln -s /no-such-dir || framework_failure_
ln -L no-such-dir hard-to-dangle 2>err && fail=1
case `cat err` in
*' accessing `no-such-dir'\':*) ;;
# ===================================================
# Create a hard link to a symlink to a directory.
-mkdir d || framework_failure
-ln -s d link-to-dir || framework_failure
+mkdir d || framework_failure_
+ln -s d link-to-dir || framework_failure_
ln -L link-to-dir hard-to-dir-link 2>err && fail=1
case `cat err` in
*': `link-to-dir'\'': hard link not allowed for directory'*) ;;
# Create a simple symlink with both source and destination files
# in current directory.
-touch $f || framework_failure
-rm -f $t || framework_failure
+touch $f || framework_failure_
+rm -f $t || framework_failure_
ln -s $f $t || fail=1
test -f $t || fail=1
rm $t $f
# Create a symlink with source file and explicit destination directory/file.
-touch $f || framework_failure
-rm -rf $d || framework_failure
-mkdir $d || framework_failure
+touch $f || framework_failure_
+rm -rf $d || framework_failure_
+mkdir $d || framework_failure_
ln -s ../$f $d/$t || fail=1
test -f $d/$t || fail=1
rm -rf $d $f
# Create a symlink with source file and destination directory.
-touch $f || framework_failure
-rm -rf $d || framework_failure
-mkdir $d || framework_failure
+touch $f || framework_failure_
+rm -rf $d || framework_failure_
+mkdir $d || framework_failure_
ln -s ../$f $d || fail=1
test -f $d/$f || fail=1
rm -rf $d $f
# See whether a trailing slash is followed too far.
-touch $f || framework_failure
-rm -rf $d || framework_failure
-mkdir $d $d/$f || framework_failure
+touch $f || framework_failure_
+rm -rf $d || framework_failure_
+mkdir $d $d/$f || framework_failure_
ln $f $d/ 2> /dev/null && fail=1
ln -s $f $d/ 2> /dev/null && fail=1
rm -rf $d $f
# Make sure we get a failure with existing dest without -f option
-touch $t || framework_failure
+touch $t || framework_failure_
# FIXME: don't ignore the error message but rather test
# it to make sure it's the right one.
ln -s $t $t 2> /dev/null && fail=1
rm $t
# Make sure -sf fails when src and dest are the same
-touch $t || framework_failure
+touch $t || framework_failure_
ln -sf $t $t 2> /dev/null && fail=1
rm $t
# Create a symlink with source file and no explicit directory
-rm -rf $d || framework_failure
-mkdir $d || framework_failure
-touch $d/$f || framework_failure
+rm -rf $d || framework_failure_
+mkdir $d || framework_failure_
+touch $d/$f || framework_failure_
ln -s $d/$f || fail=1
test -f $f || fail=1
rm -rf $d $f
# Create a symlink with source file and destination symlink-to-directory.
-rm -rf $d $f $ld || framework_failure
-touch $f || framework_failure
-mkdir $d || framework_failure
+rm -rf $d $f $ld || framework_failure_
+touch $f || framework_failure_
+mkdir $d || framework_failure_
ln -s $d $ld
ln -s ../$f $ld || fail=1
test -f $d/$f || fail=1
# Create a symlink with source file and destination symlink-to-directory.
# BUT use the new --no-dereference option.
-rm -rf $d $f $ld || framework_failure
-touch $f || framework_failure
-mkdir $d || framework_failure
+rm -rf $d $f $ld || framework_failure_
+touch $f || framework_failure_
+mkdir $d || framework_failure_
ln -s $d $ld
af=`pwd`/$f
ln --no-dereference -fs "$af" $ld || fail=1
# Try to create a symlink with backup where the destination file exists
# and the backup file name is a hard link to the destination file.
-touch a b || framework_failure
-ln b b~ || framework_failure
+touch a b || framework_failure_
+ln b b~ || framework_failure_
ln -f --b=simple a b || fail=1
# ===================================================
# This was fixed in 4.0.34. Broken in 4.0r.
for cmd in ln cp mv ginstall; do
rm -rf a x a.orig
- touch a x || framework_failure
+ touch a x || framework_failure_
$cmd --backup=simple --suffix=.orig x a || fail=1
test -f a.orig || fail=1
done
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ ln
-echo foo > a || framework_failure
-ln -s . b || framework_failure
+echo foo > a || framework_failure_
+ln -s . b || framework_failure_
ln -sf a b > err 2>&1 && fail=1
case `cat err` in
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ ln
-touch f || framework_failure
+touch f || framework_failure_
# Before coreutils-7.6, this would succeed on Solaris 10
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ ln
-mkdir d || framework_failure
+mkdir d || framework_failure_
ln -s --target-dir=d ../f || fail=1
Exit $fail
print_ver_ ls
for mon in $(seq -w 12); do
- touch -d"+$mon month" $mon.ts || framework_failure
+ touch -d"+$mon month" $mon.ts || framework_failure_
done
dir:
\e[${code}mcap_neg\e[0m
cap_pos
-" > out_ok || framework_failure
+" > out_ok || framework_failure_
compare out out_ok || fail=1
done
print_ver_ ls
long_name=zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.foo
-touch $long_name || framework_failure
+touch $long_name || framework_failure_
e='\33'
color_code='0;31;42'
c_pre="$e[0m$e[${color_code}m"
c_post="$e[0m$e[K\n"
-printf "$c_pre$long_name$c_post\n" > exp || framework_failure
+printf "$c_pre$long_name$c_post\n" > exp || framework_failure_
env TERM=xterm COLUMNS=80 LS_COLORS="*.foo=$color_code" TIME_STYLE=+T \
ls -og --color=always $long_name > out || fail=1
# Don't let a different umask perturb the results.
umask 22
-mkdir d other-writable sticky || framework_failure
-chmod o+w other-writable || framework_failure
-chmod o+t sticky || framework_failure
+mkdir d other-writable sticky || framework_failure_
+chmod o+w other-writable || framework_failure_
+chmod o+t sticky || framework_failure_
ls --color=always > out || fail=1
# helper to strip ls columns up to "norm" time
qls() { sed 's/-r.*norm/norm/'; }
-touch exe || framework_failure
-chmod u+x exe || framework_failure
-touch nocolor || framework_failure
+touch exe || framework_failure_
+chmod u+x exe || framework_failure_
+touch nocolor || framework_failure_
TCOLORS="no=7:ex=01;32"
# Ensure no coloring is done unless enabled
LS_COLORS=$TCOLORS ls -gGU nocolor exe | qls >> out || fail=1
-cat -A out > out.display || framework_failure
-mv out.display out || framework_failure
+cat -A out > out.display || framework_failure_
+mv out.display out || framework_failure_
-cat <<\EOF > exp || framework_failure
+cat <<\EOF > exp || framework_failure_
^[[0m^[[7mnorm ^[[m^[[01;32mexe^[[0m$
^[[7mnorm nocolor^[[0m$
^[[0m^[[7m^[[m^[[01;32mexe^[[0m ^[[7mnocolor^[[0m$
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ ls
-ln -s no-such-file dangle || framework_failure
-mkdir -p dir/sub || framework_failure
-ln -s dir slink-to-dir || framework_failure
-mkdir d || framework_failure
-ln -s no-such d/dangle || framework_failure
-printf '? dangle\n' > subdir_Li_exp || framework_failure
-printf 'total 0\n? dangle\n' > subdir_Ls_exp || framework_failure
+ln -s no-such-file dangle || framework_failure_
+mkdir -p dir/sub || framework_failure_
+ln -s dir slink-to-dir || framework_failure_
+mkdir d || framework_failure_
+ln -s no-such d/dangle || framework_failure_
+printf '? dangle\n' > subdir_Li_exp || framework_failure_
+printf 'total 0\n? dangle\n' > subdir_Ls_exp || framework_failure_
# This must exit nonzero.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ ls
-mkdir dir || framework_failure
+mkdir dir || framework_failure_
LC_MESSAGES=C ls -lR --dired dir > out || fail=1
print_ver_ ls
# Isolate output files from directory being listed
-mkdir dir dir/sub dir1 || framework_failure
-cd dir || framework_failure
-ln -s link link || framework_failure
-ln -s ../../dir1 sub/link-to-dir || framework_failure
+mkdir dir dir/sub dir1 || framework_failure_
+cd dir || framework_failure_
+ln -s link link || framework_failure_
+ln -s ../../dir1 sub/link-to-dir || framework_failure_
# Make sure the symlink was created.
# `ln -s link link' succeeds, but creates no file on
# systems running some DJGPP-2.03 libc.
-ls -F link > /dev/null || framework_failure
+ls -F link > /dev/null || framework_failure_
# When explicitly listing a broken link, the command must fail.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ ls
-mkdir loop || framework_failure
-ln -s ../loop loop/sub || framework_failure
+mkdir loop || framework_failure_
+ln -s ../loop loop/sub || framework_failure_
-cat <<\EOF > exp-out || framework_failure
+cat <<\EOF > exp-out || framework_failure_
loop:
sub
EOF
-cat <<\EOF > exp-err || framework_failure
+cat <<\EOF > exp-err || framework_failure_
ls: loop/sub: not listing already-listed directory
EOF
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ ls
-touch f || framework_failure
-ln -s f slink || framework_failure
+touch f || framework_failure_
+ln -s f slink || framework_failure_
# When listed explicitly:
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ ls
-seq 2000 > b || framework_failure
-touch a || framework_failure
+seq 2000 > b || framework_failure_
+touch a || framework_failure_
# Before coreutils-5.1.1, the following would output a space after the comma.
print_ver_ ls
working_umask_or_skip_
-touch file file1 || framework_failure
+touch file file1 || framework_failure_
ln file1 file2 || skip_ "can't create hard link"
code_mh='44;37'
code_ex='01;32'
# regular file - not hard linked
LS_COLORS="mh=$code_mh" ls -U1 --color=always file > out || fail=1
-printf "file\n" > out_ok || framework_failure
+printf "file\n" > out_ok || framework_failure_
compare out out_ok || fail=1
# hard links
LS_COLORS="mh=$code_mh" ls -U1 --color=always file1 file2 > out || fail=1
printf "$c0${c_mh}file1$c0
${c_mh}file2$c0
-" > out_ok || framework_failure
+" > out_ok || framework_failure_
compare out out_ok || fail=1
# hard links and png (hard link coloring takes precedence)
-mv file2 file2.png || framework_failure
+mv file2 file2.png || framework_failure_
LS_COLORS="mh=$code_mh:*.png=$code_png" ls -U1 --color=always file1 file2.png \
> out || fail=1
printf "$c0${c_mh}file1$c0
${c_mh}file2.png$c0
-" > out_ok || framework_failure
+" > out_ok || framework_failure_
compare out out_ok || fail=1
# hard links and exe (exe coloring takes precedence)
-chmod a+x file2.png || framework_failure
+chmod a+x file2.png || framework_failure_
LS_COLORS="mh=$code_mh:*.png=$code_png:ex=$code_ex" \
ls -U1 --color=always file1 file2.png > out || fail=1
-chmod a-x file2.png || framework_failure
+chmod a-x file2.png || framework_failure_
printf "$c0${c_ex}file1$c0
${c_ex}file2.png$c0
-" > out_ok || framework_failure
+" > out_ok || framework_failure_
compare out out_ok || fail=1
# hard links and png (hard link coloring disabled => png coloring enabled)
|| fail=1
printf "file1
$c0${c_png}file2.png$c0
-" > out_ok || framework_failure
+" > out_ok || framework_failure_
compare out out_ok || fail=1
# hard links and png (hard link coloring not enabled explicitly => png coloring)
|| fail=1
printf "file1
$c0${c_png}file2.png$c0
-" > out_ok || framework_failure
+" > out_ok || framework_failure_
compare out out_ok || fail=1
Exit $fail
skip_ "couldn't find a nameless UID"
fi
-touch f || framework_failure
-chown $nameless_uid f || framework_failure
+touch f || framework_failure_
+chown $nameless_uid f || framework_failure_
set -- `ls -o f` || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ ls
-mkdir -p dir/subdir || framework_failure
-touch dir/subdir/file2 || framework_failure
-ln -s f symlink || framework_failure
+mkdir -p dir/subdir || framework_failure_
+touch dir/subdir/file2 || framework_failure_
+ln -s f symlink || framework_failure_
-cat > exp <<\EOF || framework_failure
+cat > exp <<\EOF || framework_failure_
dir
exp
out
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ ls
-mkdir x y a b c a/1 a/2 a/3 || framework_failure
-touch f a/1/I a/1/II || framework_failure
+mkdir x y a b c a/1 a/2 a/3 || framework_failure_
+touch f a/1/I a/1/II || framework_failure_
# This first example is from Andreas Schwab's bug report.
date=1998-01-15
-touch -d "$date" c || framework_failure
-touch -d "$date" a || framework_failure
-touch -d "$date" b || framework_failure
+touch -d "$date" c || framework_failure_
+touch -d "$date" a || framework_failure_
+touch -d "$date" b || framework_failure_
ls -1t a b c > out || fail=1
# Skip this test unless "." is on a file system with useful d_type info.
# FIXME: This uses "ls -p" to decide whether to test "ls" with other options,
# but if ls's d_type code is buggy then "ls -p" might be buggy too.
-mkdir -p c/d || framework_failure
-chmod a-x c || framework_failure
+mkdir -p c/d || framework_failure_
+chmod a-x c || framework_failure_
if test "X`ls -p c 2>&1`" != Xd/; then
skip_ "'.' is not on a suitable file system for this test"
fi
-mkdir d || framework_failure
-ln -s / d/s || framework_failure
-chmod 600 d || framework_failure
+mkdir d || framework_failure_
+ln -s / d/s || framework_failure_
+chmod 600 d || framework_failure_
-mkdir -p e/a2345 e/b || framework_failure
-chmod 600 e || framework_failure
+mkdir -p e/a2345 e/b || framework_failure_
+chmod 600 e || framework_failure_
ls --file-type d > out || fail=1
print_ver_ ls
skip_if_root_
-mkdir d || framework_failure
-ln -s / d/s || framework_failure
-chmod 600 d || framework_failure
+mkdir d || framework_failure_
+ln -s / d/s || framework_failure_
+chmod 600 d || framework_failure_
ls -Log d > out
print_ver_ ls
require_strace_ stat
-touch x || framework_failure
-chmod a+x x || framework_failure
-ln -s x link-to-x || framework_failure
+touch x || framework_failure_
+chmod a+x x || framework_failure_
+ln -s x link-to-x || framework_failure_
# ls from coreutils 6.9 would unnecessarily stat a symlink in an unusual case:
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ ls
-mkdir dir || framework_failure
-ln -s dir symlink || framework_failure
+mkdir dir || framework_failure_
+ln -s dir symlink || framework_failure_
set `ls -l symlink/`
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ ls
-mkdir subdir || framework_failure
-touch subdir/b || framework_failure
-touch subdir/a || framework_failure
+mkdir subdir || framework_failure_
+touch subdir/b || framework_failure_
+touch subdir/a || framework_failure_
# Coreutils 6.8 and 6.9 would output this in the wrong order.
require_selinux_
skip_if_mcstransd_is_running_
-mkdir -p d/sub/s2 || framework_failure
-touch f g d/sub/1 d/sub/2 || framework_failure
+mkdir -p d/sub/s2 || framework_failure_
+touch f g d/sub/1 d/sub/2 || framework_failure_
# Set to a specified context.
env -u a -i -u a -- > out || fail=1
test -s out && fail=1
env -i -- a=b > out || fail=1
-echo a=b > exp || framework_failure
+echo a=b > exp || framework_failure_
compare exp out || fail=1
# These tests verify exact status of internal failure.
ENV_TEST1=a
export ENV_TEST1
-: >out || framework_failure
+: >out || framework_failure_
env ENV_TEST2= > all || fail=1
-grep '^ENV_TEST' all | LC_ALL=C sort >> out || framework_failure
+grep '^ENV_TEST' all | LC_ALL=C sort >> out || framework_failure_
env -u ENV_TEST1 ENV_TEST3=c > all || fail=1
-grep '^ENV_TEST' all | LC_ALL=C sort >> out || framework_failure
+grep '^ENV_TEST' all | LC_ALL=C sort >> out || framework_failure_
env ENV_TEST1=b > all || fail=1
-grep '^ENV_TEST' all | LC_ALL=C sort >> out || framework_failure
+grep '^ENV_TEST' all | LC_ALL=C sort >> out || framework_failure_
env ENV_TEST2= env > all || fail=1
-grep '^ENV_TEST' all | LC_ALL=C sort >> out || framework_failure
+grep '^ENV_TEST' all | LC_ALL=C sort >> out || framework_failure_
env -u ENV_TEST1 ENV_TEST3=c env > all || fail=1
-grep '^ENV_TEST' all | LC_ALL=C sort >> out || framework_failure
+grep '^ENV_TEST' all | LC_ALL=C sort >> out || framework_failure_
env ENV_TEST1=b env > all || fail=1
-grep '^ENV_TEST' all | LC_ALL=C sort >> out || framework_failure
-cat <<EOF >exp || framework_failure
+grep '^ENV_TEST' all | LC_ALL=C sort >> out || framework_failure_
+cat <<EOF >exp || framework_failure_
ENV_TEST1=a
ENV_TEST2=
ENV_TEST3=c
compare exp out || fail=1
# PATH modifications affect exec.
-mkdir unlikely_name || framework_failure
-cat <<EOF > unlikely_name/also_unlikely || framework_failure
+mkdir unlikely_name || framework_failure_
+cat <<EOF > unlikely_name/also_unlikely || framework_failure_
#!/bin/sh
echo pass
EOF
-chmod +x unlikely_name/also_unlikely || framework_failure
+chmod +x unlikely_name/also_unlikely || framework_failure_
env also_unlikely && fail=1
test x`PATH=$PATH:unlikely_name env also_unlikely` = xpass || fail=1
test x`env PATH="$PATH":unlikely_name also_unlikely` = xpass || fail=1
# '/bin/sh -i', rather than '/bin/sh -- -i', which doesn't do what we want.
# Avoid the issue by using an executable rather than a script.
# Test -u, rather than -i, to minimize PATH problems.
-ln -s "$abs_top_builddir/src/echo" ./-u || framework_failure
+ln -s "$abs_top_builddir/src/echo" ./-u || framework_failure_
case `env -u echo echo good` in
good) ;;
*) fail=1 ;;
# After options have ended, the first argument not containing = is a program.
env a=b -- true
test $? = 127 || fail=1
-ln -s "$abs_top_builddir/src/echo" ./-- || framework_failure
+ln -s "$abs_top_builddir/src/echo" ./-- || framework_failure_
case `env a=b -- true || echo fail` in
true) ;;
*) fail=1 ;;
esac
# No way to directly invoke program name containing =.
-cat <<EOF >./c=d || framework_failure
+cat <<EOF >./c=d || framework_failure_
#!/bin/sh
echo pass
EOF
-chmod +x c=d || framework_failure
+chmod +x c=d || framework_failure_
test "x`env c=d echo fail`" = xfail || fail=1
test "x`env -- c=d echo fail`" = xfail || fail=1
test "x`env ./c=d echo fail`" = xfail || fail=1
test -s out && fail=1
# Test env -0 on a one-variable environment.
-printf 'a=b\nc=\0' > exp || framework_failure
+printf 'a=b\nc=\0' > exp || framework_failure_
env -i -0 "$(printf 'a=b\nc=')" > out || fail=1
compare exp out || fail=1
# Test printenv -0 on particular values.
-printf 'b\nc=\0' > exp || framework_failure
+printf 'b\nc=\0' > exp || framework_failure_
env "$(printf 'a=b\nc=')" printenv -0 a > out || fail=1
compare exp out || fail=1
env -u a printenv -0 a > out
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ fmt
-printf '%2030s\n' ' '|sed 's/../ y/g' > in || framework_failure
+printf '%2030s\n' ' '|sed 's/../ y/g' > in || framework_failure_
-cat <<\EOF > exp || framework_failure
+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
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
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
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ head
-echo abc > in || framework_failure
+echo abc > in || framework_failure_
(head -c1; head -c1) < in > out || fail=1
case "`cat out`" in
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ head
-(echo a; echo b) > in || framework_failure
+(echo a; echo b) > in || framework_failure_
(head -n 1 >/dev/null; cat) < in > out || fail=1
cat <<EOF > exp
u2='1998-01-14 12:00'
u3='1998-01-14 13:00'
-touch -m -d "$t3" a || framework_failure
-touch -m -d "$t2" b || framework_failure
-touch -m -d "$t1" c || framework_failure
+touch -m -d "$t3" a || framework_failure_
+touch -m -d "$t2" b || framework_failure_
+touch -m -d "$t1" c || framework_failure_
-touch -a -d "$u3" c || framework_failure
-touch -a -d "$u2" b || framework_failure
+touch -a -d "$u3" c || framework_failure_
+touch -a -d "$u2" b || framework_failure_
# Make sure A has ctime at least 1 second more recent than C's.
sleep 2
-touch -a -d "$u1" a || framework_failure
+touch -a -d "$u1" a || framework_failure_
# A has ctime more recent than C.
sleep 2
# Create a link, updating c's ctime.
-ln c d || framework_failure
+ln c d || framework_failure_
# Before we go any further, verify that touch's -m option works.
set -- `ls --full -l a`
EOF
#`
ls --full -l a
- framework_failure
+ framework_failure_
;;
esac
# unprivileged user - warn about failure to change
nice -n -1 true 2> err || fail=1
test -s err || fail=1
- mv err exp || framework_failure
+ mv err exp || framework_failure_
nice --1 true 2> err || fail=1
compare exp err || fail=1
# Failure to write advisory message is fatal. Buggy through coreutils 8.0.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ od
-echo abcdefg > in || framework_failure
+echo abcdefg > in || framework_failure_
(od -An -N3 -c; od -An -N3 -c) < in > out
# on x86: sometimes there was no space between the columns.
set x $(echo aaaabaaa | tr ab '\376\377' | od -t fF) ||
- framework_failure
+ framework_failure_
case "$*" in
*0-*) fail=1;;
esac
esac
set x $(echo aaaaaaaabaaaaaaa | tr ab '\376\377' | od -t fD) ||
- framework_failure
+ framework_failure_
case "$*" in
*0-*) fail=1;;
esac
esac
set x $(echo aaaaaaaaaaaaaaaabaaaaaaaaaaaaaaa | tr ab '\376\377' | od -t fL) ||
- framework_failure
+ framework_failure_
case "$*" in
*0-*) fail=1;;
esac
# Choose 48 bytes for the input, as that is lcm for 1, 2, 4, 8, 12, 16;
# we don't anticipate any other native object size on modern hardware.
-seq 19 > in || framework_failure
-test `wc -c < in` -eq 48 || framework_failure
+seq 19 > in || framework_failure_
+test `wc -c < in` -eq 48 || framework_failure_
list='a c dC dS dI dL oC oS oI oL uC uS uI uL xC xS xI xL fF fD fL'
od -t x8 /dev/null >/dev/null ||
skip_ "od lacks support for 8-byte quantities"
-echo abcdefgh |tr -d '\n' > in || framework_failure
+echo abcdefgh |tr -d '\n' > in || framework_failure_
od -An -t x8 in > out-raw || fail=1
print_ver_ pathchk
skip_if_root_
-touch file || framework_failure
+touch file || framework_failure_
# This should exit nonzero. Before 2.0.13, it gave a diagnostic,
# printenv as a builtin, so we must invoke it via "env".
# But beware of $_, set by many shells to the last command run.
# Also, filter out LD_PRELOAD, which is set when running under valgrind.
-env | grep -Ev '^(_|LD_PRELOAD=)' > exp || framework_failure
+env | grep -Ev '^(_|LD_PRELOAD=)' > exp || framework_failure_
env -- printenv | grep -Ev '^(_|LD_PRELOAD=)' > out || fail=1
compare exp out || fail=1
env -- printenv ENV_TEST > out
test $? = 1 || fail=1
test -s out && fail=1
-echo a > exp || framework_failure
+echo a > exp || framework_failure_
ENV_TEST=a env -- printenv ENV_TEST > out || fail=1
compare exp out || fail=1
ENV_TEST1=a ENV_TEST2=b env -- printenv ENV_TEST2 ENV_TEST1 ENV_TEST2 > out \
|| fail=1
ENV_TEST1=a ENV_TEST2=b env -- printenv ENV_TEST1 ENV_TEST2 >> out || fail=1
-cat <<EOF > exp || framework_failure
+cat <<EOF > exp || framework_failure_
b
a
b
test $? = 1 || fail=1
ENV_TEST1=a env -- printenv ENV_TEST1 ENV_TEST2 >> out
test $? = 1 || fail=1
-cat <<EOF > exp || framework_failure
+cat <<EOF > exp || framework_failure_
a
a
EOF
# Non-standard environment variable name. Shells won't create it, but
# env can, and printenv must be able to deal with it.
-echo b > exp || framework_failure
+echo b > exp || framework_failure_
env -- -a=b printenv -- -a > out || fail=1
compare exp out || fail=1
# Using a long file name makes an abort more likely.
# Even with no file name, valgrind detects the buffer overrun.
f=01234567890123456789012345678901234567890123456789
-touch $f empty || framework_failure
+touch $f empty || framework_failure_
# Specifying a regular expression ending in a lone backslash
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ pwd
-mkdir -p a/b || framework_failure
-ln -s a/b c || framework_failure
+mkdir -p a/b || framework_failure_
+ln -s a/b c || framework_failure_
base=$(env -- pwd)
# Remove any logical paths from $PWD.
-cd "$base" || framework_failure
-test "x$PWD" = "x$base" || framework_failure
+cd "$base" || framework_failure_
+test "x$PWD" = "x$base" || framework_failure_
# Enter a logical directory.
-cd c || framework_failure
+cd c || framework_failure_
test "x$PWD" = "x$base/c" || skip_ "cd does not properly update \$PWD"
env -- pwd -L > out || fail=1
# two different times with no actual loop. In addition, arrange
# so that the second and fourth calls to readlink operate on S.
-ln -s s p || framework_failure
-ln -s d s || framework_failure
-mkdir d || framework_failure
-echo 2 > d/2 || framework_failure
-ln -s ../s/2 d/1 || framework_failure
+ln -s s p || framework_failure_
+ln -s d s || framework_failure_
+mkdir d || framework_failure_
+echo 2 > d/2 || framework_failure_
+ln -s ../s/2 d/1 || framework_failure_
# With coreutils-6.9, this would fail with ELOOP.
readlink -v -e p/1 > out || fail=1
compare out exp || fail=1
# Construct a real loop and make sure readlink still detects it.
-ln -sf ../s/1 d/2 || framework_failure
+ln -sf ../s/1 d/2 || framework_failure_
readlink -v -e p/1 2> out && fail=1
readlink_msg=$(cat out)
case $readlink_msg in
symlink_loop_msg=${readlink_msg#'readlink: p/1: '}
# Exercise the hash table code.
-ln -nsf ../s/3 d/2 || framework_failure
-ln -nsf ../p/4 d/3 || framework_failure
-ln -nsf ../p/5 d/4 || framework_failure
-ln -nsf ../p/6 d/5 || framework_failure
-ln -nsf ../p/7 d/6 || framework_failure
-ln -nsf ../p/8 d/7 || framework_failure
-echo x > d/8 || framework_failure
+ln -nsf ../s/3 d/2 || framework_failure_
+ln -nsf ../p/4 d/3 || framework_failure_
+ln -nsf ../p/5 d/4 || framework_failure_
+ln -nsf ../p/6 d/5 || framework_failure_
+ln -nsf ../p/7 d/6 || framework_failure_
+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
compare out exp || 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
+echo "readlink: loop: $symlink_loop_msg" > exp || framework_failure_
compare out exp || fail=1
Exit $fail
print_ver_ runcon
diag='runcon: runcon may be used only on a SELinux kernel'
-echo "$diag" > exp || framework_failure
+echo "$diag" > exp || framework_failure_
# This test works even on systems without SELinux.
skip_if_mcstransd_is_running_
# Create a regular file, dir, fifo.
-touch f || framework_failure
-mkdir d s1 s2 || framework_failure
+touch f || framework_failure_
+mkdir d s1 s2 || framework_failure_
mkfifo_or_skip_ p
# shred a single letter, zero length file which should result in
# 3 random passes and a single rename.
-touch f || framework_failure
+touch f || framework_failure_
echo "\
shred: f: pass 1/3 (random)...
shred: f: pass 2/3 (random)...
shred: f: pass 3/3 (random)...
shred: f: removing
shred: f: renamed to 0
-shred: f: removed" > exp || framework_failure
+shred: f: removed" > exp || framework_failure_
shred -v -u f 2>out || fail=1
# In this case, shred would try to rename the file 256^10 times
# before terminating.
file=0123456789
-touch $file || framework_failure
-chmod u-w $file || framework_failure
+touch $file || framework_failure_
+chmod u-w $file || framework_failure_
# This would take so long that it appears to infloop
print_ver_ shuf
getlimits_
-seq 100 > in || framework_failure
+seq 100 > in || framework_failure_
shuf in >out || fail=1
# coreutils-6.12 and earlier would output a newline terminator, not \0.
shuf --zero-terminated -i 1-1 > out || fail=1
-printf '1\0' > exp || framework_failure
+printf '1\0' > exp || framework_failure_
cmp out exp || { fail=1; echo "missing NUL terminator?" 1>&2; }
# Ensure shuf -n operates efficiently for small n. Before coreutils-8.13
printf "%c", 32 + rand(94);
}
print "\n";
-}' > in || framework_failure
+}' > in || framework_failure_
# We need to generate a lot of data for sort to show a noticeable
# improvement in performance. Sorting it in PERL may take awhile.
my @list = <FILE>;
print sort(@list);
close (FILE);
-' > exp || framework_failure
+' > exp || framework_failure_
time sort in > out || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ sort
-seq -w 2000 > exp || framework_failure
-tac exp > in || framework_failure
+seq -w 2000 > exp || framework_failure_
+tac exp > in || framework_failure_
# This should force the use of temp files
sort -S 1k in > out || fail=1
print_ver_ sort
very_expensive_
-cat <<\EOF >compress || framework_failure
+cat <<\EOF >compress || framework_failure_
#!/bin/sh
tr 41 14 || exit
touch ok
# This compressor's behavior is adjustable via environment variables.
export PRE_COMPRESS=
export POST_COMPRESS=
-cat <<\EOF >compress || framework_failure
+cat <<\EOF >compress || framework_failure_
#!/bin/sh
eval "$PRE_COMPRESS"
tr 41 14 || exit
|| skip_ 'fd-limited sort failed; are you running under valgrind?'
for i in $(seq 31); do
- echo $i | tee -a in > __test.$i || framework_failure
+ echo $i | tee -a in > __test.$i || framework_failure_
done
print_ver_ sort
require_ulimit_
-mkdir in err || framework_failure
+mkdir in err || framework_failure_
for i in `seq 17`; do
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ sort
-seq 100 > in || framework_failure
+seq 100 > in || framework_failure_
sort --random-sort in > out || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ stat
-printf -- '-\n' > exp || framework_failure
-touch f || framework_failure
+printf -- '-\n' > exp || framework_failure_
+touch f || framework_failure_
stat --format=%n - < f > out || fail=1
stat -f - < f && fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ stat
-touch file || framework_failure
-mkdir dir || framework_failure
-ln -s file link1 || framework_failure
-ln -s dir link2 || framework_failure
+touch file || framework_failure_
+mkdir dir || framework_failure_
+ln -s file link1 || framework_failure_
+ln -s dir link2 || framework_failure_
-cat <<EOF > exp || framework_failure
+cat <<EOF > exp || framework_failure_
link1
symbolic link
directory
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ tee
-echo line >sample || framework_failure
-nums=`seq 9` || framework_failure
+echo line >sample || framework_failure_
+nums=`seq 9` || framework_failure_
for n in 0 $nums; do
files=`seq $n`
group_num=$(id -g $NON_ROOT_USERNAME)
# Create a file owned by root, and writable by $NON_ROOT_USERNAME.
-echo > root-owned || framework_failure
-chgrp +$group_num . root-owned || framework_failure
+echo > root-owned || framework_failure_
+chgrp +$group_num . root-owned || framework_failure_
chmod g+w root-owned
# Ensure that the current directory is searchable by $NON_ROOT_USERNAME.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ wc
-echo 2 > 2b || framework_failure
-echo 2 words > 2w || framework_failure
-printf '2b\n2w\n' |tr '\n' '\0' > names || framework_failure
+echo 2 > 2b || framework_failure_
+echo 2 words > 2w || framework_failure_
+printf '2b\n2w\n' |tr '\n' '\0' > names || framework_failure_
wc --files0-from=names > out || fail=1
print_ver_ cp mv ginstall
# Skip this test if cp was built without xattr support:
-touch src dest || framework_failure
+touch src dest || framework_failure_
cp --preserve=xattr -n src dest \
|| skip_ "coreutils built without xattr support"
cleanup_() { rm -rf "$other_partition_tmpdir"; }
. "$abs_srcdir/other-fs-tmpdir"
b_other="$other_partition_tmpdir/b"
-rm -f "$b_other" || framework_failure
+rm -f "$b_other" || framework_failure_
# testing xattr name-value pair
xattr_name="user.foo"
xattr_pair="$xattr_name=\"$xattr_value\""
# create new file and check its xattrs
-touch a || framework_failure
+touch a || framework_failure_
getfattr -d a >out_a || skip_ "failed to get xattr of file"
-grep -F "$xattr_pair" out_a && framework_failure
+grep -F "$xattr_pair" out_a && framework_failure_
# try to set user xattr on file
setfattr -n "$xattr_name" -v "$xattr_value" a >out_a \
grep -F "$xattr_pair" out_d || fail=1
# test if --preserve=xattr works even for files without write access
-chmod a-w a || framework_failure
+chmod a-w a || framework_failure_
rm -f e
cp --preserve=xattr a e || fail=1
getfattr -d e >out_e || skip_ "failed to get xattr of file"
dst_perm=$(stat --format=%a e)
test "$dst_perm" = "$src_perm" || fail=1
-chmod u+w a || framework_failure
+chmod u+w a || framework_failure_
-rm b || framework_failure
+rm b || framework_failure_
# install should never preserve xattr
ginstall a b || fail=1
# try to set user xattr on file on other partition
test_mv=1
-touch "$b_other" || framework_failure
+touch "$b_other" || framework_failure_
setfattr -n "$xattr_name" -v "$xattr_value" "$b_other" >out_a \
|| test_mv=0
getfattr -d "$b_other" >out_b || test_mv=0
grep -F "$xattr_pair" out_b || test_mv=0
-rm -f "$b_other" || framework_failure
+rm -f "$b_other" || framework_failure_
if test $test_mv -eq 1; then
# mv should preserve xattr when copying content from one partition to another
print_ver_ mkdir
skip_if_root_
-mkdir no-access || framework_failure
-mkdir no-acce2s || framework_failure
-mkdir -p no-acce3s/d || framework_failure
+mkdir no-access || framework_failure_
+mkdir no-acce2s || framework_failure_
+mkdir -p no-acce3s/d || framework_failure_
p=`pwd`
(cd no-access && chmod 0 . && mkdir -p "$p/a/b" u/v) 2> /dev/null && fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ mkdir
-ln -s . slink || framework_failure
+ln -s . slink || framework_failure_
mkdir -p slink/x || fail=1
test -d x || fail=1
print_ver_ mkdir
skip_if_setgid_
-mkdir -m 700 e-dir || framework_failure
+mkdir -m 700 e-dir || framework_failure_
# Make sure `mkdir -p existing-dir' succeeds
cleanup_() { rm -rf "$other_partition_tmpdir"; }
. "$abs_srcdir/other-fs-tmpdir"
-touch file || framework_failure
+touch file || framework_failure_
t1=$other_partition_tmpdir/t1
-touch $t1 || framework_failure
+touch $t1 || framework_failure_
skip_partition=none
# Ensure that setfacl and getfacl work on this file system.
# move the access acl of a file
mv file "$other_partition_tmpdir" || fail=1
-acl2=`cd "$other_partition_tmpdir" && getfacl file` || framework_failure
+acl2=`cd "$other_partition_tmpdir" && getfacl file` || framework_failure_
test "$acl1" = "$acl2" || fail=1
# move the access acl of a directory
-mkdir dir || framework_failure
-setfacl -m user:bin:rw dir || framework_failure
-acl1=`getfacl dir` || framework_failure
+mkdir dir || framework_failure_
+setfacl -m user:bin:rw dir || framework_failure_
+acl1=`getfacl dir` || framework_failure_
mv dir "$other_partition_tmpdir" || fail=1
-acl2=`cd "$other_partition_tmpdir" && getfacl dir` || framework_failure
+acl2=`cd "$other_partition_tmpdir" && getfacl dir` || framework_failure_
test "$acl1" = "$acl2" || fail=1
# move the default acl of a directory
-mkdir dir2 || framework_failure
-setfacl -d -m user:bin:rw dir2 || framework_failure
-acl1=`getfacl dir2` || framework_failure
+mkdir dir2 || framework_failure_
+setfacl -d -m user:bin:rw dir2 || framework_failure_
+acl1=`getfacl dir2` || framework_failure_
mv dir2 "$other_partition_tmpdir" || fail=1
-acl2=`cd "$other_partition_tmpdir" && getfacl dir2` || framework_failure
+acl2=`cd "$other_partition_tmpdir" && getfacl dir2` || framework_failure_
test "$acl1" = "$acl2" || fail=1
Exit $fail
# $ strace -qe unlink ./mv -T s1 s2
# $
-ln -s t1 s1 || framework_failure
-ln -s t2 s2 || framework_failure
+ln -s t1 s1 || framework_failure_
+ln -s t2 s2 || framework_failure_
strace -qe unlink mv -T s1 s2 > out 2>&1 || fail=1
# $ rm -f a b b2; touch a b; ln b b2; strace -e unlink ./mv a b
# $
-touch a b || framework_failure
-ln b b2 || framework_failure
+touch a b || framework_failure_
+ln b b2 || framework_failure_
strace -qe unlink mv a b > out 2>&1 || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ mv
-mkdir A B || framework_failure
-touch X Y || framework_failure
+mkdir A B || framework_failure_
+touch X Y || framework_failure_
# Before coreutils-6.2, the " (backup: `B.~1~')" suffix was not printed.
a="$other_partition_tmpdir/a"
a2="$other_partition_tmpdir/a~"
-rm -f "$a" "$a2" || framework_failure
-echo a > "$a" || framework_failure
-echo a2 > "$a2" || framework_failure
+rm -f "$a" "$a2" || framework_failure_
+echo a > "$a" || framework_failure_
+echo a2 > "$a2" || framework_failure_
# This mv command should exit nonzero.
mv --b=simple "$a2" "$a" > out 2>&1 && fail=1
skip_if_root_
-mkdir a b c || framework_failure
-echo a > a/f || framework_failure
-echo b > b/f || framework_failure
+mkdir a b c || framework_failure_
+echo a > a/f || framework_failure_
+echo b > b/f || framework_failure_
cp a/f b/f c 2> /dev/null && fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ mv
-touch f1 || framework_failure
-touch f2 || framework_failure
-touch d || framework_failure
+touch f1 || framework_failure_
+touch f2 || framework_failure_
+touch d || framework_failure_
# These mv commands should all exit nonzero.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ mv
-mkdir -p dir/file || framework_failure
-> file || framework_failure
+mkdir -p dir/file || framework_failure_
+> file || framework_failure_
# These should both fail, but until fileutils-4.0q only the second one did.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ mv
-mkdir -p a/t b/t || framework_failure
-touch a/t/f || framework_failure
+mkdir -p a/t b/t || framework_failure_
+touch a/t/f || framework_failure_
# Expect this to fail with the expected diagnostic.
ff=mvforce
ff2=mvforce2
-echo force-contents > $ff || framework_failure
-ln $ff $ff2 || framework_failure
+echo force-contents > $ff || framework_failure_
+ln $ff $ff2 || framework_failure_
# This mv command should exit nonzero.
mv $ff $ff > out 2>&1 && fail=1
skip_if_root_
-mkdir dst || framework_failure
-(cd dst && touch a b c) || framework_failure
-touch a || framework_failure
-ln a b || framework_failure
-ln a c || framework_failure
+mkdir dst || framework_failure_
+(cd dst && touch a b c) || framework_failure_
+touch a || framework_failure_
+ln a b || framework_failure_
+ln a c || framework_failure_
# ======================================
print_ver_ cp
skip_if_root_
-mkdir -p x dst/x || framework_failure
-touch dst/x/b || framework_failure
+mkdir -p x dst/x || framework_failure_
+touch dst/x/b || framework_failure_
chmod a-w dst/x
-touch a || framework_failure
-ln a x/b || framework_failure
-ln a c || framework_failure
+touch a || framework_failure_
+ln a x/b || framework_failure_
+ln a c || framework_failure_
# ======================================
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ mv
-touch a || framework_failure
-ln a b || framework_failure
+touch a || framework_failure_
+ln a b || framework_failure_
mv a b || fail=1
dir=hlink
-mkdir $dir || framework_failure
-> $dir/a || framework_failure
-ln $dir/a $dir/b || framework_failure
+mkdir $dir || framework_failure_
+> $dir/a || framework_failure_
+ln $dir/a $dir/b || framework_failure_
mv $dir "$other_partition_tmpdir" || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ mv
-touch x || framework_failure
-ln x y || framework_failure
+touch x || framework_failure_
+ln x y || framework_failure_
mv --verbose x y > out || fail=1
skip_if_root_
for i in a b c d e f g h; do
- echo $i > $i || framework_failure
+ echo $i > $i || framework_failure_
done
-chmod 0 b d f h || framework_failure
-echo y > y || framework_failure
+chmod 0 b d f h || framework_failure_
+echo y > y || framework_failure_
mv -if a b || fail=1
mv -fi c d < y >/dev/null 2>&1 || fail=1
test "$(uname -s)" = FreeBSD && skip_ "known spurious failure on FreeBSD"
-touch f g h i || framework_failure
-chmod 0 g i || framework_failure
+touch f g h i || framework_failure_
+chmod 0 g i || framework_failure_
ls /dev/stdin >/dev/null 2>&1 \
print_ver_ mv
for i in a b; do
- echo $i > $i || framework_failure
+ echo $i > $i || framework_failure_
done
-echo y > y || framework_failure
+echo y > y || framework_failure_
mv -i a b < y >/dev/null 2>&1 || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ mv
-mkdir a || framework_failure
-touch b || framework_failure
+mkdir a || framework_failure_
+touch b || framework_failure_
# coreutils 6.2 mv would neglect to prompt in this case.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ mv
-mkdir a b || framework_failure
-echo foo > a/foo || framework_failure
-ln a/foo a/bar || framework_failure
-echo FUBAR > b/FUBAR || framework_failure
-ln b/FUBAR b/bar || framework_failure
-chmod a-w b/bar || framework_failure
-echo n > no || framework_failure
+mkdir a b || framework_failure_
+echo foo > a/foo || framework_failure_
+ln a/foo a/bar || framework_failure_
+echo FUBAR > b/FUBAR || framework_failure_
+ln b/FUBAR b/bar || framework_failure_
+chmod a-w b/bar || framework_failure_
+echo n > no || framework_failure_
mv a/bar a/foo b < no > out 2> err || fail=1
dir=toself-dir
file=toself-file
-rm -rf $dir $file || framework_failure
-mkdir -p $dir/a/b || framework_failure
-touch $file || framework_failure
+rm -rf $dir $file || framework_failure_
+mkdir -p $dir/a/b || framework_failure_
+touch $file || framework_failure_
# This mv command should fail.
symlink=symlink
-echo whatever > $file || framework_failure
-ln -s $file $symlink || framework_failure
+echo whatever > $file || framework_failure_
+ln -s $file $symlink || framework_failure_
# This mv command should exit nonzero.
mv $symlink $file > out 2>&1 && fail=1
dir1=is3-dir1
dir2=is3-dir2
-mkdir $dir1 $dir2 || framework_failure
+mkdir $dir1 $dir2 || framework_failure_
# This mv command should exit nonzero.
mv $dir1 $dir2 $dir2 > out 2>&1 && fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ mv
-touch file || framework_failure
-ln -s file s || framework_failure
+touch file || framework_failure_
+ln -s file s || framework_failure_
# This must fail.
echo $i$j
done
done > .dirs
-mkdir `cat .dirs` || framework_failure
+mkdir `cat .dirs` || framework_failure_
sed 's,$,/f,' .dirs | xargs touch
last_file=`tail -n1 .dirs`/f
-test -f $last_file || framework_failure
+test -f $last_file || framework_failure_
mv * "$other_partition_tmpdir" || fail=1
# test miscellaneous combinations of -f -i -n parameters
-touch a b || framework_failure
+touch a b || framework_failure_
echo "\`a' -> \`b'" > out_move
> out_empty
# ask for overwrite, answer no
-touch a b || framework_failure
+touch a b || framework_failure_
echo n | mv -vi a b 2>/dev/null > out1 || fail=1
compare out1 out_empty || fail=1
# ask for overwrite, answer yes
-touch a b || framework_failure
+touch a b || framework_failure_
echo y | mv -vi a b 2>/dev/null > out2 || fail=1
compare out2 out_move || fail=1
# -n wins (as the last option)
-touch a b || framework_failure
+touch a b || framework_failure_
echo y | mv -vin a b 2>/dev/null > out3 || fail=1
compare out3 out_empty || fail=1
# -n wins (as the last option)
-touch a b || framework_failure
+touch a b || framework_failure_
echo y | mv -vfn a b 2>/dev/null > out4 || fail=1
compare out4 out_empty || fail=1
# -n wins (as the last option)
-touch a b || framework_failure
+touch a b || framework_failure_
echo y | mv -vifn a b 2>/dev/null > out5 || fail=1
compare out5 out_empty || fail=1
# options --backup and --no-clobber are mutually exclusive
-touch a || framework_failure
+touch a || framework_failure_
mv -bn a b 2>/dev/null && fail=1
Exit $fail
null=mv-null
dir=mv-dir
-rm -f $null || framework_failure
-mknod $null p || framework_failure
-test -p $null || framework_failure
-mkdir -p $dir/a/b/c $dir/d/e/f || framework_failure
-touch $dir/a/b/c/file1 $dir/d/e/f/file2 || framework_failure
+rm -f $null || framework_failure_
+mknod $null p || framework_failure_
+test -p $null || framework_failure_
+mkdir -p $dir/a/b/c $dir/d/e/f || framework_failure_
+touch $dir/a/b/c/file1 $dir/d/e/f/file2 || framework_failure_
# We used to...
# exit 77 here to indicate that we couldn't run the test.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ mv
-mkdir -p d/sub empty src d2/sub e2 || framework_failure
-touch f || framework_failure
+mkdir -p d/sub empty src d2/sub e2 || framework_failure_
+touch f || framework_failure_
# Skip this test if there's an underlying kernel bug.
-mkdir a b b/a || framework_failure
+mkdir a b b/a || framework_failure_
mv a b ||
skip_ "your kernel's rename syscall is buggy"
cleanup_() { t=$other_partition_tmpdir; chmod -R 700 "$t"; rm -rf "$t"; }
. "$abs_srcdir/other-fs-tmpdir"
-touch k "$other_partition_tmpdir/k" || framework_failure
-chmod u-w "$other_partition_tmpdir" || framework_failure
+touch k "$other_partition_tmpdir/k" || framework_failure_
+chmod u-w "$other_partition_tmpdir" || framework_failure_
mv -f k "$other_partition_tmpdir" 2> out && fail=1
cleanup_() { rm -rf "$other_partition_tmpdir"; }
. "$abs_srcdir/other-fs-tmpdir"
-touch f || framework_failure
-ln f g || framework_failure
-mkdir a b || framework_failure
-touch a/1 || framework_failure
-ln a/1 b/1 || framework_failure
+touch f || framework_failure_
+ln f g || framework_failure_
+mkdir a b || framework_failure_
+touch a/1 || framework_failure_
+ln a/1 b/1 || framework_failure_
mv f g "$other_partition_tmpdir" || fail=1
cleanup_() { rm -rf "$other_partition_tmpdir"; }
. "$abs_srcdir/other-fs-tmpdir"
-mkdir foo || framework_failure
+mkdir foo || framework_failure_
mv foo/ "$other_partition_tmpdir/bar" || fail=1
print_ver_ mv
skip_if_root_
-mkdir -p no-write/dir || framework_failure
-chmod u-w no-write || framework_failure
+mkdir -p no-write/dir || framework_failure_
+chmod u-w no-write || framework_failure_
mv no-write/dir . > out 2>&1 && fail=1
# file from a sticky tmpdir to a directory owned by that user on
# a different partition.
-mkdir t || framework_failure
-chmod a=rwx,o+t t || framework_failure
-echo > t/root-owned || framework_failure
-chmod a+r t/root-owned || framework_failure
-chown "$NON_ROOT_USERNAME" "$other_partition_tmpdir" || framework_failure
+mkdir t || framework_failure_
+chmod a=rwx,o+t t || framework_failure_
+echo > t/root-owned || framework_failure_
+chmod a+r t/root-owned || framework_failure_
+chown "$NON_ROOT_USERNAME" "$other_partition_tmpdir" || framework_failure_
# We have to allow $NON_ROOT_USERNAME access to ".".
-chmod go+x . || framework_failure
+chmod go+x . || framework_failure_
# Ensure that $NON_ROOT_USERNAME can access the required version of mv.
rem_symlink="$other_partition_tmpdir/symlink"
file=to-sym
-echo local > $file || framework_failure
-echo remote > $rem_file || framework_failure
-ln -s $rem_file $rem_symlink || framework_failure
+echo local > $file || framework_failure_
+echo remote > $rem_file || framework_failure_
+ln -s $rem_file $rem_symlink || framework_failure_
# This mv command should succeed, unlinking the symlink
# before copying.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ mv
-mkdir foo || framework_failure
+mkdir foo || framework_failure_
mv foo/ bar || fail=1
# mv and cp would misbehave for coreutils versions [5.3.0..5.97], 6.0 and 6.1
for cmd in mv 'cp -r'; do
for opt in '' -T -u; do
- rm -rf d e || framework_failure
- mkdir d || framework_failure
+ rm -rf d e || framework_failure_
+ mkdir d || framework_failure_
$cmd $opt d e/ || fail=1
if test "$cmd" = mv; then
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ cp mv
-echo old > old || framework_failure
-touch -d yesterday old || framework_failure
-echo new > new || framework_failure
+echo old > old || framework_failure_
+touch -d yesterday old || framework_failure_
+echo new > new || framework_failure_
for interactive in '' -i; do
my_pwd=$("$abs_top_builddir/src/pwd")
tmp=d
-mkdir $tmp || framework_failure
-cd $tmp || framework_failure
+mkdir $tmp || framework_failure_
+cd $tmp || framework_failure_
-mkdir subdir removed || framework_failure
-touch regfile || framework_failure
+mkdir subdir removed || framework_failure_
+touch regfile || framework_failure_
-ln -s regfile link1 || framework_failure
-ln -s subdir link2 || framework_failure
-ln -s missing link3 || framework_failure
-ln -s subdir/missing link4 || framework_failure
+ln -s regfile link1 || framework_failure_
+ln -s subdir link2 || framework_failure_
+ln -s missing link3 || framework_failure_
+ln -s subdir/missing link4 || framework_failure_
-cd "$pwd/$tmp/removed" || framework_failure
+cd "$pwd/$tmp/removed" || framework_failure_
# Skip this test if the system doesn't let you remove the working directory.
if rmdir ../removed 2>/dev/null; then
my_pwd=$("$abs_top_builddir/src/pwd")
tmp=d
-mkdir $tmp || framework_failure
-cd $tmp || framework_failure
+mkdir $tmp || framework_failure_
+cd $tmp || framework_failure_
-mkdir subdir removed || framework_failure
-touch regfile || framework_failure
+mkdir subdir removed || framework_failure_
+touch regfile || framework_failure_
-ln -s regfile link1 || framework_failure
-ln -s subdir link2 || framework_failure
-ln -s missing link3 || framework_failure
-ln -s subdir/missing link4 || framework_failure
-ln -s link5 link5 || framework_failure
+ln -s regfile link1 || framework_failure_
+ln -s subdir link2 || framework_failure_
+ln -s missing link3 || framework_failure_
+ln -s subdir/missing link4 || framework_failure_
+ln -s link5 link5 || framework_failure_
-cd "$pwd/$tmp/removed" || framework_failure
+cd "$pwd/$tmp/removed" || framework_failure_
# Skip this test if the system doesn't let you remove the working directory.
if rmdir ../removed 2>/dev/null; then
my_pwd=$("$abs_top_builddir/src/pwd")
tmp=d
-mkdir $tmp || framework_failure
-cd $tmp || framework_failure
+mkdir $tmp || framework_failure_
+cd $tmp || framework_failure_
-mkdir subdir removed || framework_failure
-touch regfile || framework_failure
+mkdir subdir removed || framework_failure_
+touch regfile || framework_failure_
-ln -s regfile link1 || framework_failure
-ln -s subdir link2 || framework_failure
-ln -s missing link3 || framework_failure
-ln -s subdir/missing link4 || framework_failure
+ln -s regfile link1 || framework_failure_
+ln -s subdir link2 || framework_failure_
+ln -s missing link3 || framework_failure_
+ln -s subdir/missing link4 || framework_failure_
-cd "$pwd/$tmp/removed" || framework_failure
+cd "$pwd/$tmp/removed" || framework_failure_
# Skip this test if the system doesn't let you remove the working directory.
if rmdir ../removed 2>/dev/null; then
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ readlink
-mkdir subdir || framework_failure
-touch regfile || framework_failure
-ln -s regfile link1 || framework_failure
-ln -s missing link2 || framework_failure
+mkdir subdir || framework_failure_
+touch regfile || framework_failure_
+ln -s regfile link1 || framework_failure_
+ln -s missing link2 || framework_failure_
v=`readlink link1` || fail=1
# the offending euidaccess_stat call.
skip_if_root_
-mkdir x || framework_failure
-cd x || framework_failure
+mkdir x || framework_failure_
+cd x || framework_failure_
# Construct a hierarchy containing a relative file with a name
: ${PERL=perl}
$PERL \
-e 'my $d = "x" x 200; foreach my $i (1..52)' \
-e ' { mkdir ($d, 0700) && chdir $d or die "$!" }' \
- || framework_failure
+ || framework_failure_
-cd .. || framework_failure
-echo n > no || framework_failure
+cd .. || framework_failure_
+echo n > no || framework_failure_
rm ---presume-input-tty -r x < no > out || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
-mkdir --mode=0500 unwritable-dir || framework_failure
+mkdir --mode=0500 unwritable-dir || framework_failure_
# For rm from coreutils-5.0.1, this would prompt.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
-mkdir d || framework_failure
+mkdir d || framework_failure_
rm d 2> out && fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
-mkdir a b || framework_failure
-touch a/f b/f || framework_failure
+mkdir a b || framework_failure_
+touch a/f b/f || framework_failure_
rm -r a b || fail=1
print_ver_ rm
skip_if_root_
-mkdir -m0 inacc || framework_failure
+mkdir -m0 inacc || framework_failure_
# Also exercise the different code path that's taken for a directory
# that is empty (hence removable) and unreadable.
|| skip_ 'this test runs only on an ext3 or ext4 file system'
# Skip if there are too few inodes free. Require some slack.
-free_inodes=$(stat -f --format=%d .) || framework_failure
+free_inodes=$(stat -f --format=%d .) || framework_failure_
min_free_inodes=$(expr 12 \* $n / 10)
test $min_free_inodes -lt $free_inodes \
|| skip_ "too few free inodes on '.': $free_inodes;" \
test -f $n &&
cd .. &&
ok=1
-test $ok = 1 || framework_failure
+test $ok = 1 || framework_failure_
setup_duration=$(expr $(date +%s) - $start)
echo creating a $n-entry directory took $setup_duration seconds
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
-mkdir -p d || framework_failure
+mkdir -p d || framework_failure_
rm -f d/no-such-file || fail=1
# The containing directory must be owned by the user who eventually runs rm.
chown $NON_ROOT_USERNAME .
-mkdir a || framework_failure
-chmod 1777 a || framework_failure
-touch a/b || framework_failure
+mkdir a || framework_failure_
+chmod 1777 a || framework_failure_
+touch a/b || framework_failure_
# Try to ensure that $NON_ROOT_USERNAME can access
ln -s f d/slink &&
chmod a-w d &&
ok=1
-test $ok = 1 || framework_failure
+test $ok = 1 || framework_failure_
mkdir e &&
ln -s f e/slink &&
chmod a-w e &&
ok=1
-test $ok = 1 || framework_failure
+test $ok = 1 || framework_failure_
rm -rf d/f 2> out && fail=1
y=`seq 1 150|tr -sc '\n' y|tr '\n' /`
for i in 1 2 3; do
for j in a b c d e f g h i j k l m n o p q r s t u v w x y z; do
- mkdir -p t/$i/$j/$y || framework_failure
+ mkdir -p t/$i/$j/$y || framework_failure_
done
done
print_ver_ rm
t=t
-mkdir -p $t || framework_failure
-echo > $t/a || framework_failure
-test -f $t/a || framework_failure
+mkdir -p $t || framework_failure_
+echo > $t/a || framework_failure_
+test -f $t/a || framework_failure_
echo y > $t/$test.Iy
echo n > $t/$test.In
print_ver_ rm
skip_if_root_
-touch f || framework_failure
-chmod 0 f || framework_failure
-touch exp || framework_failure
+touch f || framework_failure_
+chmod 0 f || framework_failure_
+touch exp || framework_failure_
rm --interactive=never f > out || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
-mkdir dir || framework_failure
-echo y > y || framework_failure
+mkdir dir || framework_failure_
+echo y > y || framework_failure_
# This must fail.
print_ver_ rm
skip_if_root_
-touch existing-non-dir || framework_failure
+touch existing-non-dir || framework_failure_
# With coreutils-6.3, this would exit nonzero. It should not.
skip_if_root_
p=`pwd`
-mkdir abs1 abs2 no-access || framework_failure
+mkdir abs1 abs2 no-access || framework_failure_
set +x
print_ver_ rm
touch file1-1 file1-2 file2-1 file2-2 file3-1 file3-2 file4-1 file4-2 \
- || framework_failure
+ || framework_failure_
# If asked, answer no to first question, then yes to second.
echo 'n
-y' > $test.I || framework_failure
-rm -f out err || framework_failure
+y' > $test.I || framework_failure_
+rm -f out err || framework_failure_
# The prompt has a trailing space, and no newline, so an extra
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
-mkdir -p dir1-1 dir2-1 dir2-2 || framework_failure
+mkdir -p dir1-1 dir2-1 dir2-2 || framework_failure_
touch file1-1 file2-1 file2-2 file2-3 file3-1 file3-2 file3-3 file3-4 \
- || framework_failure
-echo y > $test.Iy || framework_failure
-echo n > $test.In || framework_failure
-rm -f out err || framework_failure
+ || framework_failure_
+echo y > $test.Iy || framework_failure_
+echo n > $test.In || framework_failure_
+rm -f out err || framework_failure_
# The prompt has a trailing space, and no newline, so an extra
print_ver_ rm
t=t
-mkdir -p $t $t/a $t/b $t/c || framework_failure
-> $t/a/a || framework_failure
-> $t/b/bb || framework_failure
-> $t/c/cc || framework_failure
+mkdir -p $t $t/a $t/b $t/c || framework_failure_
+> $t/a/a || framework_failure_
+> $t/b/bb || framework_failure_
+> $t/c/cc || framework_failure_
cat <<EOF > $test.I
y
print_ver_ rm
require_root_
-mkdir d || framework_failure
-touch d/f || framework_failure
-chown -R $NON_ROOT_USERNAME d || framework_failure
+mkdir d || framework_failure_
+touch d/f || framework_failure_
+chown -R $NON_ROOT_USERNAME d || framework_failure_
# Ensure that non-root can access files in root-owned ".".
-chmod go=x . || framework_failure
+chmod go=x . || framework_failure_
# This must fail, since `.' is not writable by $NON_ROOT_USERNAME.
mount --bind $t a/b \
|| skip_ "This test requires mount with a working --bind option."
-cat <<\EOF > exp || framework_failure
+cat <<\EOF > exp || framework_failure_
rm: skipping `a/b', since it's on a different device
EOF
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
-mkdir a a/a || framework_failure
-> b || framework_failure
+mkdir a a/a || framework_failure_
+> b || framework_failure_
-cat <<\EOF > $test.E || framework_failure
+cat <<\EOF > $test.E || framework_failure_
removed directory: `a/a'
removed directory: `a'
removed `b'
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
-mkdir t t/a t/a/b || framework_failure
-> t/a/f || framework_failure
-> t/a/b/g || framework_failure
+mkdir t t/a t/a/b || framework_failure_
+> t/a/f || framework_failure_
+> t/a/b/g || framework_failure_
# FIXME: if this fails, it's a framework failure
-cat <<\EOF | sort > t/E || framework_failure
+cat <<\EOF | sort > t/E || framework_failure_
removed directory: `t/a'
removed directory: `t/a/b'
removed `t/a/b/g'
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
-mkdir t || framework_failure
-cd t || framework_failure
+mkdir t || framework_failure_
+cd t || framework_failure_
# Create 500 files (20 * 25).
for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j; do
for j in a b c d e f g h i j k l m n o p q r s t u v w x y; do
files="$files $i$j"
done
- touch $files || framework_failure
+ touch $files || framework_failure_
done
-test -f 0a || framework_failure
-test -f by || framework_failure
-cd .. || framework_failure
+test -f 0a || framework_failure_
+test -f by || framework_failure_
+cd .. || framework_failure_
rm -rf t || fail=1
test -d t && fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
-mkdir d || framework_failure
-touch d/a || framework_failure
+mkdir d || framework_failure_
+touch d/a || framework_failure_
rm -fr d/. 2>/dev/null && fail=1
rm -fr d/./ 2>/dev/null && fail=1
# What counts is a combination of the number of files and
# the lengths of their names. For details, see
# http://lists.gnu.org/archive/html/bug-coreutils/2006-09/msg00326.html
-mkdir b || framework_failure
-cd b || framework_failure
+mkdir b || framework_failure_
+cd b || framework_failure_
for i in `seq 1 250`; do
- touch `printf %040d $i` || framework_failure
+ touch `printf %040d $i` || framework_failure_
done
-cd .. || framework_failure
+cd .. || framework_failure_
# On a buggy system, this would fail with the diagnostic,
print_ver_ rm
skip_if_root_
-mkdir -p b/a/p b/c b/d || framework_failure
-chmod u-w b/a || framework_failure
+mkdir -p b/a/p b/c b/d || framework_failure_
+chmod u-w b/a || framework_failure_
# This should fail.
print_ver_ rm
skip_if_root_
-mkdir -p a/0 || framework_failure
-mkdir -p a/1/2 b/3 || framework_failure
-mkdir a/2 a/3 || framework_failure
-chmod u-x a/1 b || framework_failure
+mkdir -p a/0 || framework_failure_
+mkdir -p a/1/2 b/3 || framework_failure_
+mkdir a/2 a/3 || framework_failure_
+chmod u-x a/1 b || framework_failure_
# Exercise two separate code paths -- though both result
print_ver_ rm
skip_if_root_
-mkdir -p z || framework_failure
-cd z || framework_failure
-touch empty empty-u || framework_failure
+mkdir -p z || framework_failure_
+cd z || framework_failure_
+touch empty empty-u || framework_failure_
echo not-empty > fu
ln -s empty-f slink
ln -s . slinkdot
-mkdir d du || framework_failure
-chmod u-w fu du empty-u || framework_failure
+mkdir d du || framework_failure_
+chmod u-w fu du empty-u || framework_failure_
cd ..
print_ver_ rm
skip_if_root_
-mkdir dir || framework_failure
+mkdir dir || framework_failure_
# This should fail.
print_ver_ rm
skip_if_root_
-mkdir -p d/e || framework_failure
-cat <<EOF > in || framework_failure
+mkdir -p d/e || framework_failure_
+cat <<EOF > in || framework_failure_
y
y
y
EOF
-cat <<\EOF > exp || framework_failure
+cat <<\EOF > exp || framework_failure_
rm: descend into directory `d'
rm: remove directory `d/e'
rm: remove directory `d'
print_ver_ rm
skip_if_root_
-mkdir -p a/b || framework_failure
+mkdir -p a/b || framework_failure_
chmod u-r a
print_ver_ rm
skip_if_root_
-mkdir -p a/1 b c d/2 e/3 || framework_failure
+mkdir -p a/1 b c d/2 e/3 || framework_failure_
t=`pwd`
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rm
-mkdir a || framework_failure
-touch a/x || framework_failure
+mkdir a || framework_failure_
+touch a/x || framework_failure_
rm --verbose -r a/// > out || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rmdir
-mkdir d d/e d/e/f || framework_failure
-chmod a-w d || framework_failure
+mkdir d d/e d/e/f || framework_failure_
+chmod a-w d || framework_failure_
# This rmdir command outputs two diagnostics.
print_ver_ rmdir
cwd=`pwd`
-mkdir -p "$cwd/a/b/c" "$cwd/a/x" || framework_failure
+mkdir -p "$cwd/a/b/c" "$cwd/a/x" || framework_failure_
rmdir -p --ignore-fail-on-non-empty "$cwd/a/b/c" || fail=1
# $cwd/a/x should remain
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ rmdir
-mkdir dir || framework_failure
+mkdir dir || framework_failure_
# Prior to coreutils-4.5.2, this would fail with the following:
split -e -n 10 /dev/null || fail=1
stat x?? 2>/dev/null && fail=1
-printf '1\n2\n3\n4\n5\n' > in || framework_failure
+printf '1\n2\n3\n4\n5\n' > in || framework_failure_
split -n 3 in > out || fail=1
split -n 1/3 in > b1 || fail=1
print_ver_ split
getlimits_
-touch in || framework_failure
+touch in || framework_failure_
split -a 0 in 2> /dev/null || fail=1
lines=\
12345~1~12345~1~12345~1~12345~1~12345~~~12345~1~12345~1~12345~1~12345~1~12345~1~
-printf "%s" "$lines" | tr '~' '\n' > in || framework_failure
+printf "%s" "$lines" | tr '~' '\n' > in || framework_failure_
echo 'split: 16: invalid chunk number' > exp
split -n l/16/15 in 2>err && fail=1
06 08 08 02 06 08 08 02 06 08 08 10
06 08 02 06 08 00 08 02 06 08 02 06 08 00 10
06 00 08 00 02 06 00 02 06 00 08 00 01 07 00 02 06 00 08 00 02 16
-" > exp || framework_failure
+" > exp || framework_failure_
-sed 's/00 *//g' exp > exp.elide_empty || framework_failure
+sed 's/00 *//g' exp > exp.elide_empty || framework_failure_
DEBUGGING=
test "$DEBUGGING" && test "$VERBOSE" && set +x
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ split
-printf '1\n2\n3\n4\n5\n' > in || framework_failure
+printf '1\n2\n3\n4\n5\n' > in || framework_failure_
split --lines=2 in > out || fail=1
cat <<\EOF > exp-1
split -e -n r/10 /dev/null || fail=1
stat x?? 2>/dev/null && fail=1
-printf '1\n2\n3\n4\n5\n' > in || framework_failure
+printf '1\n2\n3\n4\n5\n' > in || framework_failure_
split -n r/3 in > out || fail=1
test -s out && fail=1
a_z='a b c d e f g h i j k l m n o p q r s t u v w x y z'
# Generate a 27-byte file
-printf %s $a_z 0 |tr -d ' ' > in || framework_failure
+printf %s $a_z 0 |tr -d ' ' > in || framework_failure_
files=
for i in $a_z; do
for f in $files; do
printf 'creating file `%s'\''\n' $f
-done > exp || framework_failure
+done > exp || framework_failure_
echo split: output file suffixes exhausted \
- > exp-too-short || framework_failure
+ > exp-too-short || framework_failure_
# This should fail.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ tail
-touch a b || framework_failure
+touch a b || framework_failure_
debug='---disable-inotify'
debug=
# at the beginning and another set of 8 bytes at the end.
# The rest will be NUL bytes. On most modern systems, the following
# creates a file that takes up only a few KB. Here, du -sh says 16K.
-echo abcdefgh | tr -d '\n' > big || framework_failure
-echo 87654321 | tr -d '\n' > tmp || framework_failure
+echo abcdefgh | tr -d '\n' > big || framework_failure_
+echo 87654321 | tr -d '\n' > tmp || framework_failure_
# Seek 4GB - 8
dd bs=1 seek=4294967288 if=tmp of=big 2> err || dd_failed=1
if test "$dd_failed" = 1; then
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ tail
-echo line > exp || framework_failure
-echo line > in || framework_failure
+echo line > exp || framework_failure_
+echo line > in || framework_failure_
timeout 1 tail -f < in > out 2> err
# 9 is a magic number, related to internal details of tail.c and hash.c
n=9
-seq $n | xargs touch || framework_failure
+seq $n | xargs touch || framework_failure_
debug='---disable-inotify'
debug=
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ tail
-touch f || framework_failure
+touch f || framework_failure_
debug='---disable-inotify -s .001'
debug=
# cleanup and exit correctly when it receives a SIGTERM, thus hanging the test.
very_expensive_
-touch file || framework_failure
-touch tail.out || framework_failure
+touch file || framework_failure_
+touch tail.out || framework_failure_
( timeout 10s gdb --version ) > gdb.out 2>&1
case $(cat gdb.out) in
print_ver_ tail
getlimits_
-touch empty here || framework_failure
+touch empty here || framework_failure_
for inotify in ---disable-inotify ''; do
mkfifo_or_skip_ fifo
echo 1 > fifo &
-echo 1 > exp || framework_failure
+echo 1 > exp || framework_failure_
timeout 10 tail -f fifo > out
test $? = 124 || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ tail
-(echo 1; echo 2) > k || framework_failure
+(echo 1; echo 2) > k || framework_failure_
sh -c 'read x; tail' < k > out || fail=1
require_proc_pid_status_
-touch empty || framework_failure
-echo anything > nonempty || framework_failure
+touch empty || framework_failure_
+echo anything > nonempty || framework_failure_
for inotify in ---disable-inotify ''; do
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ tail
-touch here || framework_failure
-{ touch unreadable && chmod a-r unreadable; } || framework_failure
+touch here || framework_failure_
+{ touch unreadable && chmod a-r unreadable; } || framework_failure_
for inotify in ---disable-inotify ''; do
{
local delay="$1"
- touch k || framework_failure
+ touch k || framework_failure_
tail -s.1 --max-unchanged-stats=2 -F $inotify k > tail.out &
pid=$!
sleep $delay
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ touch
-echo 60.000000000 > exp || framework_failure
+echo 60.000000000 > exp || framework_failure_
# Before coreutils-7.7, this would fail, complaining of
for d in $TOUCH_DIR_LIST; do
rm -rf $d/a $d/b $d/c
- > $d/a || framework_failure
- test -f $d/a || framework_failure
- > $d/b || framework_failure
- test -f $d/b || framework_failure
- > $d/c || framework_failure
- test -f $d/c || framework_failure
+ > $d/a || framework_failure_
+ test -f $d/a || framework_failure_
+ > $d/b || framework_failure_
+ test -f $d/b || framework_failure_
+ > $d/c || framework_failure_
+ test -f $d/c || framework_failure_
done
echo sleeping for $SLEEP_SECONDS seconds...
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ touch
-ln -s nowhere dangling || framework_failure
-touch file || framework_failure
-ln -s file link || framework_failure
+ln -s nowhere dangling || framework_failure_
+touch file || framework_failure_
+ln -s file link || framework_failure_
# These first tests should work on every platform.
print_ver_ touch
# Make sure t2 is newer than t1.
-touch -d '2000-01-01 00:00' t1 || framework_failure
-touch -d '2000-01-02 00:00' t2 || framework_failure
+touch -d '2000-01-01 00:00' t1 || framework_failure_
+touch -d '2000-01-02 00:00' t2 || framework_failure_
set x `ls -t t1 t2`
-test "$*" = "x t2 t1" || framework_failure
+test "$*" = "x t2 t1" || framework_failure_
chmod 0 t1
group_num=$(id -g $NON_ROOT_USERNAME)
# Create a file owned by root, and writable by $NON_ROOT_USERNAME.
-echo > root-owned || framework_failure
-chgrp +$group_num . root-owned || framework_failure
+echo > root-owned || framework_failure_
+chgrp +$group_num . root-owned || framework_failure_
chmod g+w root-owned
# Ensure that the current directory is searchable by $NON_ROOT_USERNAME.
print_ver_ touch
skip_if_root_
-: > read-only || framework_failure
-chmod 444 read-only || framework_failure
+: > read-only || framework_failure_
+chmod 444 read-only || framework_failure_
touch read-only || fail=1
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ touch
-TZ=UTC0 touch --date='2004-01-16 12:00 +0000' f || framework_failure
+TZ=UTC0 touch --date='2004-01-16 12:00 +0000' f || framework_failure_
# Set times back by 5 days.
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ touch
-ln -s nowhere dangling || framework_failure
-ln -s loop loop || framework_failure
-touch file || framework_failure
-ln -s file link1 || framework_failure
-mkdir dir || framework_failure
-ln -s dir link2 || framework_failure
+ln -s nowhere dangling || framework_failure_
+ln -s loop loop || framework_failure_
+touch file || framework_failure_
+ln -s file link1 || framework_failure_
+mkdir dir || framework_failure_
+ln -s dir link2 || framework_failure_
# Trailing slash can only appear on directory or symlink-to-directory.