2 # Make sure chmod mode arguments of the form A=B work properly.
3 # Before fileutils-4.1.2, some of them didn't.
4 # Also, before coreutils-5.3.1, =[ugo] sometimes didn't work.
6 # Copyright (C) 2001, 2002, 2004, 2005, 2006 Free Software Foundation,
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 if test "$VERBOSE" = yes; then
31 trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
32 trap '(exit $?); exit' 1 2 13 15
35 mkdir $tmp || framework_failure=1
36 cd $tmp || framework_failure=1
37 touch f || framework_failure=1
39 if test $framework_failure = 1; then
40 echo "$0: failure in testing framework" 1>&2
52 test $dest = $src && continue
53 chmod a=,$src=rwx,$dest=$src,$src= f || fail=1
54 set _ `ls -l f`; shift; actual_perms=$1
55 expected_perms=`eval 'echo \$expected_'$dest`
56 test "$actual_perms" = "$expected_perms" || fail=1
61 chmod a=,u=rwx,=u f || fail=1
62 set _ `ls -l f`; shift; actual_perms=$1
63 test "$actual_perms" = "-rwxr-x---" || fail=1
65 (exit $fail); exit $fail