2 # Ensure that tac processes all command line arguments, even
3 # when it encounters an error with say the first one.
4 # With coreutils-5.2.1 and earlier, this test would fail.
6 if test "$VERBOSE" = yes; then
11 . $srcdir/../lang-default
13 # See if the envvar is defined.
14 if test x = "x$FULL_PARTITION_TMPDIR"; then
15 echo "$0: FULL_PARTITION_TMPDIR not defined; skipping this test" 1>&2
19 if ! test -d "$FULL_PARTITION_TMPDIR"; then
20 echo "$0: $FULL_PARTITION_TMPDIR:" \
21 "\$FULL_PARTITION_TMPDIR does not specify a directory" 1>&2
26 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
27 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
28 trap '(exit $?); exit $?' 1 2 13 15
31 mkdir -p $tmp || framework_failure=1
32 cd $tmp || framework_failure=1
34 fp_tmp="$FULL_PARTITION_TMPDIR/tac-cont-$$"
36 # Make sure we can create an empty file there (i.e. no shortage of inodes).
37 if ! touch $fp_tmp; then
38 echo "$0: $fp_tmp: cannot create empty file" 1>&2
42 # Make sure that we fail when trying to create a file large enough
43 # to consume a non-inode block.
44 if seq 1000 > $fp_tmp 2>/dev/null; then
45 echo "$0: $FULL_PARTITION_TMPDIR: not a full partition" 1>&2
51 if test $framework_failure = 1; then
52 echo "$0: failure in testing framework" 1>&2
58 # Give tac a fifo command line argument.
59 # This makes it try to create a temporary file in $TMPDIR.
62 TMPDIR=$FULL_PARTITION_TMPDIR tac fifo in >out 2>err && fail=1
64 cat <<\EOF > exp || fail=1
73 test $fail = 1 && diff out exp 2> /dev/null
75 (exit $fail); exit $fail