From b41ab84baa3224254c5677272801f6d9809a1c1a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 13 Dec 2000 22:25:42 +0000 Subject: *** empty log message *** --- tests/chgrp/deref | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'tests/chgrp') diff --git a/tests/chgrp/deref b/tests/chgrp/deref index 0134d091b..6b7c47001 100755 --- a/tests/chgrp/deref +++ b/tests/chgrp/deref @@ -35,8 +35,6 @@ set _ $groups; shift g1=$1 g2=$2 -fail=0 - touch f ln -s f symlink @@ -51,25 +49,28 @@ EOF (exit 77); exit } -( - chgrp -c $g1 f - chgrp $g2 symlink 2> /dev/null - # This should not change the group of f. - chgrp -c $g2 symlink 2> /dev/null - chgrp -c $g2 f +fail=0 + +chgrp $g1 f +set _ `ls -l f`; g=$5; test "$g" = $g1 || fail=1 - # This *should* change the group of f. - # Though note that the diagnostic is misleading in that - # it says the `group of `symlink'' has been changed. - chgrp --dereference -c $g1 symlink -) 2>&1 | sed "s/ $g1$/ G1/;s/ $g2$/ G2/" > actual +chgrp $g2 symlink || fail=1 +set _ `ls -l f`; g=$5; test "$g" = $g1 || fail=1 +set _ `ls -l symlink`; g=$5; test "$g" = $g2 || fail=1 -cat <<\EOF > expected -group of `f' changed to G2 -group of `symlink' changed to G1 -EOF +# This should not change the group of f. +chgrp $g2 symlink || fail=1 +set _ `ls -l f`; g=$5; test "$g" = $g1 || fail=1 +set _ `ls -l symlink`; g=$5; test "$g" = $g2 || fail=1 + +chgrp $g2 f +set _ `ls -l f`; g=$5; test "$g" = $g2 || fail=1 -cmp expected actual \ - || { diff -u expected actual 1>&2; fail=1; } +# This *should* change the group of f. +# Though note that the diagnostic is misleading in that +# it says the `group of `symlink'' has been changed. +chgrp --dereference $g1 symlink +set _ `ls -l f`; g=$5; test "$g" = $g1 || fail=1 +set _ `ls -l symlink`; g=$5; test "$g" = $g2 || fail=1 (exit $fail); exit -- cgit v1.2.3-54-g00ecf