2 # Exercise mv's file-descriptor-leak bug, reported against coreutils-5.2.1
3 # and fixed (properly) on 2004-10-21.
5 # This test is relatively expensive, and might well evoke a
6 # framework-failure on systems with a smaller command-line length
7 # limit so don't run it by default.
10 if test "$VERBOSE" = yes; then
16 . $srcdir/../envvar-check
17 PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
20 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
21 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
22 trap '(exit $?); exit $?' 1 2 13 15
24 if test -z "$other_partition_tmpdir"; then
27 t0="$t0 $other_partition_tmpdir"
30 mkdir -p $tmp || framework_failure=1
31 cd $tmp || framework_failure=1
33 b="0 1 2 3 4 5 6 7 8 9
34 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
35 _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"
37 for i in `echo $b`; do
43 mkdir `cat .dirs` || framework_failure=1
44 sed 's,$,/f,' .dirs | xargs touch
46 last_file=`tail -n1 .dirs`/f
47 test -f $last_file || framework_failure=1
49 if test $framework_failure = 1; then
50 echo "$0: failure in testing framework" 1>&2
56 mv * $other_partition_tmpdir || fail=1
57 test -f $last_file/f && fail=1
60 ls -A > ../out || fail=1
61 test -s ../out && fail=1
63 (exit $fail); exit $fail