*** empty log message ***
[coreutils.git] / tests / rm / rm4
blob289f3e7ab9be9bf3d4a6d26e6ef821a5c8b5960e
1 #!/bin/sh
2 # ensure that `rm dir' fails without --recursive
4 if test "$VERBOSE" = yes; then
5 set -x
6 rm --version
7 fi
9 . $srcdir/../envvar-check
10 . $srcdir/../lang-default
11 PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
13 pwd=`pwd`
14 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
15 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
16 trap '(exit $?); exit' 1 2 13 15
18 framework_failure=0
19 mkdir -p $tmp || framework_failure=1
20 cd $tmp || framework_failure=1
21 mkdir dir || framework_failure=1
23 if test $framework_failure = 1; then
24 echo "$0: failure in testing framework" 1>&2
25 (exit 1); exit
28 fail=0
30 # This should fail.
31 rm dir > /dev/null 2>&1 && fail=1
33 test -d dir || fail=1
35 (exit $fail); exit