summaryrefslogtreecommitdiff
path: root/tests/chgrp/deref
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-12-13 22:25:42 +0000
committerJim Meyering <jim@meyering.net>2000-12-13 22:25:42 +0000
commitb41ab84baa3224254c5677272801f6d9809a1c1a (patch)
tree0029e9848f67a1c58b991b6062c420a7aed67fd9 /tests/chgrp/deref
parentaf996c06d030b875e5e988c0c72a3fa18e2f9112 (diff)
downloadcoreutils-b41ab84baa3224254c5677272801f6d9809a1c1a.tar.xz
*** empty log message ***
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