2 # Test POSIX-mandated -H option.
4 # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 if test "$VERBOSE" = yes; then
26 . $srcdir/../group-names
32 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
33 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
34 trap '(exit $?); exit $?' 1 2 13 15
37 mkdir -p $tmp || framework_failure=1
38 cd $tmp || framework_failure=1
40 mkdir 1 2 3 || framework_failure=1
41 touch 1/1F 2/2F 3/3F || framework_failure=1
42 ln -s 1 1s || framework_failure=1
43 ln -s ../3 2/2s || framework_failure=1
44 chgrp -R $g1 1 2 3 || framework_failure=1
46 if test $framework_failure = 1; then
47 echo "$0: failure in testing framework" 1>&2
53 chgrp -H -R $g2 1s 2 || fail=1
55 # These must have group $g2.
56 # =========================
65 # Filter out symlinks (entries that end in `s'), since it's not
66 # possible to change their group/owner information on some systems.
67 case $i in *s) continue;; esac
68 set _ `ls -dgn $i`; shift
70 test $group = $g2 || fail=1
73 # These must have group $g1.
74 # =========================
80 for i in $not_changed; do
81 # Filter out symlinks (entries that end in `s'), since it's not
82 # possible to change their group/owner information on some systems.
83 case $i in *s) continue;; esac
84 set _ `ls -dgn $i`; shift
86 test $group = $g1 || fail=1
89 (exit $fail); exit $fail