2 # ad-hoc tests of chgrp with -R and -H or -L and symlinks
4 if test "$VERBOSE" = yes; then
9 . $srcdir/../group-names
13 trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
14 trap '(exit $?); exit' 1 2 13 15
17 mkdir $tmp || framework_failure=1
18 cd $tmp || framework_failure=1
20 if test $framework_failure = 1; then
21 echo 'failure in testing framework' 1>&2
31 # chgrp -R should not traverse a symlink to a directory.
35 chgrp -R $g1 e/ee || fail=1
36 # This should not should change the group of e/ee
38 set _ `ls -ln e/ee`; g=$5; test "$g" = $g1 || fail=1
39 # This must change the group of e/ee, since -L makes
40 # chgrp traverse the symlink from d/s into e.
42 set _ `ls -ln e/ee`; g=$5; test "$g" = $g2 || fail=1
44 # This must *not* change the group of e/ee
46 set _ `ls -ln e/ee`; g=$5; test "$g" = $g2 || fail=1
50 # This shouldn't change the group of e/ee either.
51 chgrp -H -R $g1 link || fail=1
52 set _ `ls -ln e/ee`; g=$5; test "$g" = $g2 || fail=1
53 # But it *should* change d/dd.
54 set _ `ls -ln d/dd`; g=$5; test "$g" = $g1 || fail=1
56 (exit $fail); exit $fail