summaryrefslogtreecommitdiff
path: root/tests/chgrp/deref
diff options
context:
space:
mode:
Diffstat (limited to 'tests/chgrp/deref')
-rwxr-xr-xtests/chgrp/deref39
1 files changed, 20 insertions, 19 deletions
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