* tests/mv/no-target-dir: Likewise.
* tests/other-fs-tmpdir: Likewise.
* tests/rm/empty-name: Likewise.
* tests/rm/fail-eperm: Likewise.
* tests/rm/inaccessible: Likewise.
* tests/rm/isatty: Likewise.
* tests/rm/unreadable: Likewise.
* tests/setgid-check: Likewise.
* tests/sparse-file: Likewise.
* tests/strace: Likewise.
* tests/tail-2/append-only: Likewise.
* tests/tail-2/big-4gb: Likewise.
* tests/tail-2/tail-n0f: Likewise.
* tests/touch/dangling-symlink: Likewise.
* tests/touch/fifo: Likewise.
* tests/touch/not-owner: Likewise.
* tests/mv/i-3: Likewise.
* tests/umask-check: Likewise.
* tests/mv/acl: Likewise.
* tests/cp/acl: Likewise.
* tests/chgrp/deref: Likewise.
* tests/chmod/setgid: Likewise.
* tests/cp/existing-perm-race: Likewise.
* tests/cp/file-perm-race: Likewise.
* tests/cp/parent-perm-race: Likewise.
* tests/du/2g: Likewise.
* tests/du/8gb: Likewise.
* tests/du/long-from-unreadable: Likewise.
* tests/du/long-sloop: Likewise.
* tests/du/slink: Likewise.
* tests/ls/nameless-uid: Likewise.
* tests/ls/stat-dtype: Likewise.
* tests/misc/cat-proc: Likewise.
* tests/misc/md5sum-newline: Likewise.
* tests/misc/nice: Likewise.
* tests/misc/od-x8: Likewise.
* tests/misc/pwd-unreadable-parent: Likewise.
* tests/misc/selinux: Likewise.
* tests/misc/stty-row-col: Likewise.
* tests/misc/tac-continue: Likewise.
* tests/misc/arch: Likewise, and source $srcdir/../test-lib.sh *before*
the use of skip_test_.
chgrp -h $g2 symlink 2> /dev/null
set _ `ls -ln symlink`
g=$5
-test "$g" = $g2 || {
- cat <<EOF 1>&2
-$0: skipping this test; your system doesn't support changing
-the owner or group of a symbolic link.
-EOF
- (exit 77); exit 77
-}
+test "$g" = $g2 ||
+ skip_test_ "your system doesn't support changing the owner or group" \
+ "of a symbolic link."
fail=0
}
# "chmod g+s d" does nothing on some NFS file systems.
-"$test" -g d || {
- echo 1>&2 "$0: cannot create setgid directories," \
- "so can't run this test"
- exit 77
-}
+"$test" -g d ||
+ skip_test_ 'cannot create setgid directories'
fail=0
. $srcdir/../lang-default
# Skip this test if cp was built without ACL support:
-grep '^#define USE_ACL 0' $CONFIG_HEADER > /dev/null && \
- {
- echo 1>&2 "$0: insufficient ACL support, so skipping this test"
- (exit 77); exit 77
- }
+grep '^#define USE_ACL 0' $CONFIG_HEADER > /dev/null &&
+ skip_test_ "insufficient ACL support"
if test "$VERBOSE" = yes; then
set -x
|| skip=yes
test $skip = yes &&
- {
- echo "$0: '.' is not on a suitable file system for this test" 1>&2
- echo "$0: skipping this test" 1>&2
- (exit 77); exit 77
- }
+ skip_test_ "'.' is not on a suitable file system for this test"
# copy a file without preserving permissions
cp a/file b/ || fail=1
fail=0
umask 077
-mkfifo fifo || {
- echo "$0: fifos not supported; skipping this test." 1>&2
- (exit 77); exit 77
-}
+mkfifo fifo ||
+ skip_test_ "fifos not supported"
touch fifo-copy &&
chgrp $g1 fifo &&
. $srcdir/../test-lib.sh
umask 022
-mkfifo fifo || {
- echo "$0: fifos not supported; skipping this test." 1>&2
- (exit 77); exit 77
-}
+mkfifo fifo ||
+ skip_test_ "fifos not supported"
# Copy a fifo's contents. That way, we can examine the
# destination permissions before they're finalized.
for attr in mode ownership
do
- mkfifo $attr/fifo || {
- echo "$0: fifos not supported; skipping this test." 1>&2
- (exit 77); exit 77
- }
+ mkfifo $attr/fifo ||
+ skip_test_ "fifos not supported"
# Copy a fifo's contents. That way, we can examine d/$attr's
# state while cp is running.
free_kb=`df -kP .|tail -1|sed 's/ [0-9][0-9]*%.*//;s/ *$//;s/.* //'`
case "$free_kb" in
[0-9]*) ;;
- *) echo "invalid size from df: $free_kb" 1>&2; (exit 77); exit 77;;
+ *) skip_test_ "invalid size from df: $free_kb";;
esac
# Require about 3GB free.
min_kb=3000000
test $min_kb -lt $free_kb ||
{
- echo "$0: skipping this test:"
- echo "too little free space on current partition: $free_kb (need $min_kb KB)" \
- 1>&2;
- (exit 77); exit 77
+ skip_test_ "too little free space on current partition: $free_kb (need $min_kb KB)"
}
big=big
dd bs=1 seek=8G of=big < /dev/null 2> /dev/null
if test $? != 0; then
- echo "$0: cannot create a file large enough for this test; possibly" 1>&2
- echo "$0: because file offsets are only 32 bits on this file system" 1>&2
- (exit 77); exit 77
+ skip_test_ 'cannot create a file large enough for this test; possibly
+because file offsets are only 32 bits on this file system'
fi
# FIXME: this should be a test of dd.
set x `ls -gG big`
size=$4
if test "$size" = 0; then
- echo "$0: cannot create a file large enough for this test;" 1>&2
- echo "$0: possibly because this system's NFS support is buggy;" 1>&2
- echo "$0: Consider rerunning this test on a different file system." 1>&2
- (exit 77); exit 77
+ skip_test_ "cannot create a file large enough for this test
+possibly because this system's NFS support is buggy
+Consider rerunning this test on a different file system."
fi
fail=0
proc_file=/proc/self/fd
if test ! -d $proc_file; then
- cat <<EOF >&2
-$0: Skipping this test.
-It would fail, since your system lacks /proc support.
-EOF
- (exit 77); exit 77
+ skip_test_ 'This test would fail, since your system lacks /proc support.'
fi
dir=`printf '%200s\n' ' '|tr ' ' x`
# renders it as `Number of symbolic links encountered during path
# name traversal exceeds MAXSYMLINKS'.
-cat $file > /dev/null 2> err && \
- {
- cat <<EOF >&2
-$0: Your system appears to be able to handle more than $n symlinks
-in file name resolution, so skipping this test.
-EOF
- (exit 77); exit 77
- }
+cat $file > /dev/null 2> err &&
+ skip_test_ 'Your system appears to be able to handle more than $n symlinks
+in file name resolution'
too_many=`sed 's/.*: //' err`
fail=0
if df --local . >/dev/null 2>&1; then
: # Ok.
else
- echo "$0: skipping this test, since \`.' is on a non-local file system" 1>&2
- (exit 77); exit 77
+ skip_test_ "\`.' is on a non-local file system"
fi
if df --type=xfs . >/dev/null 2>&1; then
# At least on Irix-6.5.19, when using an xfs file system,
# each created symlink (name lengths up to 255) would have a size of `0'.
- echo "$0: skipping this test, since \`.' is on an XFS file system" 1>&2
- (exit 77); exit 77
+ skip_test_ "\`.' is on an XFS file system"
fi
if df --type=nfsv3 . >/dev/null 2>&1; then
# At least on OSF/1 4.0d, when using an nfsv3 file system,
# each created symlink can end up having a size of 0.
- echo "$0: skipping this test, since \`.' is on an NFS file system" 1>&2
- (exit 77); exit 77
+ skip_test_ "\`.' is on an NFS file system"
fi
fail=0
nameless_uid=`$PERL -e 'foreach my $i (1000..16*1024) { getpwuid $i or (print "$i\n"), exit }'`
if test x$nameless_uid = x; then
- echo "$0: couldn't find a nameless UID" 1>&2
- (exit 77); exit 77
+ skip_test_ "couldn't find a nameless UID"
fi
touch f || framework_failure
mkdir -p c/d || framework_failure
chmod a-x c || framework_failure
if test "X`ls -p c 2>&1`" != Xd/; then
- echo "$0: '.' is not on a suitable file system for this test" 1>&2
- echo "$0: skipping this test" 1>&2
- (exit 77); exit 77
+ skip_test_ "'.' is not on a suitable file system for this test"
fi
mkdir d || framework_failure
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+. $srcdir/../test-lib.sh
+
# skip this test if arch isn't being built.
case " $built_programs " in
*" arch "*) ;;
- *) (exit 77); exit 77 ;;
+ *) skip_test_ 'not building arch';;
esac
if test "$VERBOSE" = yes; then
arch --version
fi
-. $srcdir/../test-lib.sh
-
-
fail=0
arch > out || fail=1
# Ensure that cat -E produces same output as cat, module `$'s,
# even when applied to a file in /proc.
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
f=/proc/cpuinfo
test -f $f \
- || {
- echo "$0: no $f skipping this test" 1>&2
- (exit 77); exit 77
- }
+ || skip_test_ "no $f"
fail=0
b'
if test $filename_may_contain_newline = no; then
- echo 1>&2 "$0: can't create newline-containing file name," \
- "so can't run this test"
- exit 77
+ skip_test_ "failed to create newline-containing file name"
fi
me=`echo $0|sed 's,.*/,,'`
if test "$niceness" = 0; then
: ok
else
- echo "$0: this test must be run at nice level 0" 1>&2
- exit 77
+ skip_test_ "this test must be run at nice level 0"
fi
fail=0
. $srcdir/../test-lib.sh
-od -t x8 /dev/null >/dev/null || {
- echo >&2 "$0: 8-byte test skipped"
- exit 77
-}
+od -t x8 /dev/null >/dev/null ||
+ skip_test_ "od lacks support for 8-byte quantities"
echo abcdefgh |tr -d '\n' > in || framework_failure
. $srcdir/../test-lib.sh
test $host_os != linux-gnu &&
- {
- echo 1>&2 "$0: vendor getcwd may be inadequate; skipping this test"
- (exit 77); exit 77
- }
+ skip_test_ 'vendor getcwd may be inadequate'
# Linux ia64 has the gl_FUNC_GETCWD_ABORT_BUG, so we can't use
# the system getcwd.
test $REPLACE_GETCWD = 1 &&
- {
- echo 1>&2 "$0: can't use buggy system getcwd; skipping this test"
- (exit 77); exit 77
- }
+ skip_test_ "can't use buggy system getcwd; skipping this test"
mkdir -p a/b || framework_failure
cd a/b || framework_failure
ctx=root:object_r:tmp_t
# FIXME, what if $ctx is no different from the default. Not likely.
# give each a different context, via chcon
-chcon $ctx f d p 2>/dev/null || {
- echo 1>&2 'skipping this test: "chcon '$ctx' ..." failed'
- (exit 77); exit 77
-}
+chcon $ctx f d p 2>/dev/null ||
+ skip_test_ '"chcon '$ctx' ..." failed'
# inspect that context with both ls -Z and stat.
for i in d f p; do
set $tests
saved_size=`stty size` && test -n "$saved_size" \
- || { echo "$0: skipping this test: can't get window size" 1>&2;
- exit 77; exit; }
+ || skip_test_ "can't get window size"
fail=0
while :; do
# See if the envvar is defined.
if test x = "x$FULL_PARTITION_TMPDIR"; then
- echo "$0: FULL_PARTITION_TMPDIR not defined; skipping this test" 1>&2
- (exit 77); exit 77
+ skip_test_ "FULL_PARTITION_TMPDIR not defined"
fi
if ! test -d "$FULL_PARTITION_TMPDIR"; then
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Skip this test if cp was built without ACL support:
-grep '^#define USE_ACL 0' $CONFIG_HEADER > /dev/null && \
- {
- echo 1>&2 "$0: insufficient ACL support, so skipping this test"
- (exit 77); exit 77
- }
+grep '^#define USE_ACL 0' $CONFIG_HEADER > /dev/null &&
+ skip_test_ "insufficient ACL support"
if test "$VERBOSE" = yes; then
set -x
acl1=`getfacl file` || skip_partition=.
test $skip_partition != none &&
- {
- echo "$0: '$skip' is not on a suitable file system for this test" 1>&2
- echo "$0: skipping this test" 1>&2
- (exit 77); exit 77
- }
+ skip_test_ "'$skip' is not on a suitable file system for this test"
# move the access acl of a file
mv file $other_partition_tmpdir || fail=1
fail=0
ls /dev/stdin >/dev/null 2>&1 \
- || { (exit 77); exit; }
+ || skip_test_ 'there is no /dev/stdin file'
mv f g < /dev/stdin > out 2>&1 & pid=$!
sleep 1
# Skip this test if there's an underlying kernel bug.
mkdir a b b/a || framework_failure
-mv a b || {
- echo "$0: skipping this test: your kernel's rename syscall is buggy" 1>&2
- (exit 77); exit 77
-}
+mv a b ||
+ skip_test_ "your kernel's rename syscall is buggy"
fail=0
done
if test -z "$other_partition_tmpdir"; then
- cat <<EOF 1>&2
-**************************************
+ skip_test_ \
+"**************************************
This test requires a writable directory on a different
disk partition, and I couldn't find one. I tried these:
$CANDIDATE_TMP_DIRS
Set your environment variable CANDIDATE_TMP_DIRS to make
this test use a different list.
-**************************************
-EOF
- (exit 77); exit 77
+**************************************"
fi
test "$VERBOSE" = yes && set -x
: ${PERL=perl}
: ${srcdir=.}
-$PERL -e 'use warnings;' > /dev/null 2>&1 || {
- echo 1>&2 "$0: configure didn't find a usable version of Perl," \
- "so can't run this test"
- exit 77
-}
+$PERL -e 'use warnings;' > /dev/null 2>&1 ||
+ skip_test_ "configure didn't find a usable version of Perl"
me=`echo $0|sed 's,.*/,,'`
exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - << \EOF
: ${PERL=perl}
: ${srcdir=.}
-$PERL -e 1 > /dev/null 2>&1 || {
- echo 1>&2 "$0: configure didn't find a usable version of Perl," \
- "so can't run this test"
- (exit 77); exit 77
-}
+$PERL -e 1 > /dev/null 2>&1 ||
+ skip_test_ "configure didn't find a usable version of Perl"
ARGV_0=$0
export ARGV_0
grep '^#define HAVE_OPENAT' $CONFIG_HEADER > /dev/null && skip=no
test -d /proc/self/fd && skip=no
if test $skip = yes; then
- echo 1>&2 "$0: no openat support, so skipping this test"
- (exit 77); exit 77
+ skip_test_ 'this system lacks openat support'
fi
. $srcdir/../test-lib.sh
# Skip this test if there is no /dev/stdin file.
ls /dev/stdin >/dev/null 2>&1 \
- || { (exit 77); exit; }
+ || skip_test_ 'there is no /dev/stdin file'
touch f
chmod 0 f
: ${PERL=perl}
: ${srcdir=.}
-$PERL -e 'use warnings;' > /dev/null 2>&1 || {
- echo 1>&2 "$0: configure didn't find a usable version of Perl," \
- "so can't run this test"
- exit 77
-}
+$PERL -e 'use warnings;' > /dev/null 2>&1 ||
+ skip_test_ "configure didn't find a usable version of Perl"
me=`echo $0|sed 's,.*/,,'`
exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - << \EOF
# Disable the current test if the working directory seems to have
# the setgid bit set.
-# Copyright (C) 2000, 2002, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2002, 2004, 2005, 2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
*) cwd_is_setgid=yes;;
esac
if test $cwd_is_setgid = yes; then
- cat <<EOF >&2
-$0: Since it looks like you're running this test in a directory with
-the setgid bit set, we're skipping this test.
-EOF
- (exit 77); exit 77
+ skip_test_ 'this directory has the setgid bit set'
fi
# -*- sh -*-
# Does the current (working-dir.) file system support sparse files?
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
kb_size=$2
rm -f $t
if test $kb_size -ge 128; then
- echo "$0: skipping this test, since this file system doesn't support" \
- sparse files 1>&2
- (exit 77); exit 77
+ skip_test_ 'this file system does not support sparse files'
fi
# along with this program. If not, see <http://www.gnu.org/licenses/>.
strace -V < /dev/null > /dev/null 2>&1 ||
-{
- echo "$0: no strace program, so skipping this test" 1>&2
- (exit 77); exit 77
-}
+ skip_test_ 'no strace program'
strace -qe unlink echo > /dev/null 2>&1 ||
-{
- echo "$0: strace doesn't work, so skipping this test" 1>&2
- (exit 77); exit 77
-}
+ skip_test_ 'strace does not work'
echo x >> f || chattr_a_works=0
if test $chattr_a_works = 0; then
- echo "$0: chattr +a doesn't work on this file system; skipping this test " 1>&2
- (exit 77); exit 77
+ skip_test_ "chattr +a doesn't work on this file system"
fi
fail=0
dd bs=1 seek=4294967288 if=tmp of=big 2> err || dd_failed=1
if test "$dd_failed" = 1; then
cat err 1>&2
- echo "$0: cannot create a file large enough for this test," 1>&2
- echo "$0: possibly because this system doesn't support large files;" 1>&2
- echo "$0: Consider rerunning this test on a different file system." 1>&2
- (exit 77); exit 77
+ skip_test_ \
+'cannot create a file large enough for this test,
+possibly because this system does not support large files;
+Consider rerunning this test on a different file system.'
fi
fail=0
sleep 2 &
pid=$!
sleep .5
-grep '^State:[ ]*[S]' /proc/$pid/status > /dev/null 2>&1 || \
- {
- echo "$0:/proc/$pid/status: missing or 'different': skipping this test" 1>&2
- (exit 77); exit 77
- }
+grep '^State:[ ]*[S]' /proc/$pid/status > /dev/null 2>&1 ||
+ skip_test_ "/proc/$pid/status: missing or 'different'"
kill $pid
touch empty || framework_failure
*linux-gnu*)
case "`uname -r`" in
2.3.9[0-9]*)
- cat 1>&2 <<EOF
-====================================================
-$0: WARNING!!!
+ skip_test_ \
+'****************************************************
+WARNING!!!
This version of the Linux kernel causes touch to fail
when operating on dangling symlinks.
-====================================================
-EOF
- exit 77
+****************************************************'
;;
esac
;;
# failure as a test failure. However, in this case, when running on a SunOS
# system using a disk NFS mounted from OpenBSD, the above fails like this:
# mkfifo: cannot make fifo `fifo-10558': Not owner
- echo '********************************************'
- echo 'NOTICE: unable to create test prerequisites'
- echo '********************************************'
- exit 77
+ skip_test_ 'NOTICE: unable to create test prerequisites'
fi
fail=0
test=../../src/test
if $test -w /; then
- echo Skipping because you have write access to /.
- (exit 77); exit 77
+ skip_test_ you have write access to /.
fi
if $test -O / || $test -G /; then
- echo Skipping because you own /.
- (exit 77); exit 77
+ skip_test_ "you own /."
fi
. $srcdir/../test-lib.sh
# -*- sh -*-
# Disable the current test if umask doesn't work as usual.
-# Copyright (C) 2005 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
case $perms in
*'
-'*)
- cat <<EOF >&2
-$0: Since it looks like you're running this test in a directory with
-something other than the usual umask semantics, we're skipping this test.
-EOF
- (exit 77); exit 77
+'*) skip_test_ 'your build directory has unusual umask semantics'
esac