diff options
Diffstat (limited to 'tests/chgrp')
-rwxr-xr-x | tests/chgrp/basic | 8 | ||||
-rwxr-xr-x | tests/chgrp/deref | 18 | ||||
-rwxr-xr-x | tests/chgrp/posix-H | 4 | ||||
-rwxr-xr-x | tests/chgrp/recurse | 10 |
4 files changed, 22 insertions, 18 deletions
diff --git a/tests/chgrp/basic b/tests/chgrp/basic index de3d1aef0..de43573ba 100755 --- a/tests/chgrp/basic +++ b/tests/chgrp/basic @@ -84,7 +84,11 @@ test "$VERBOSE" = yes && set +x chgrp '' f ls -c -t f g -) 2>&1 | sed "s/\([ :]\)$g1$/\1G1/;s/\([ :]\)$g2$/\1G2/" > actual +) 2>&1 | sed " + s/' to .*[^0-9:].*/' to SOMENAME/ + s/\([ :]\)$g1$/\1G1/ + s/\([ :]\)$g2$/\1G2/ +" > actual cat <<\EOF > expected changed group of `f' to G1 @@ -92,7 +96,7 @@ changed group of `f' to G2 ownership of `f' retained changed group of `f' to G1 group of `f' retained as G1 -changed group of `f' to G2 +changed group of `f' to SOMENAME changed group of `d/f3' to G2 changed group of `d' to G2 changed group of `d/f3' to G1 diff --git a/tests/chgrp/deref b/tests/chgrp/deref index 5e605bfa6..ff215125c 100755 --- a/tests/chgrp/deref +++ b/tests/chgrp/deref @@ -30,7 +30,7 @@ touch f ln -s f symlink chgrp -h $g2 symlink 2> /dev/null -set _ `ls -l symlink` +set _ `ls -ln symlink` g=$5 test "$g" = $g2 || { cat <<EOF 1>&2 @@ -43,25 +43,25 @@ EOF fail=0 chgrp $g1 f -set _ `ls -l f`; g=$5; test "$g" = $g1 || fail=1 +set _ `ls -ln f`; g=$5; test "$g" = $g1 || fail=1 chgrp -h $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 +set _ `ls -ln f`; g=$5; test "$g" = $g1 || fail=1 +set _ `ls -ln symlink`; g=$5; test "$g" = $g2 || fail=1 # This should not change the group of f. chgrp -h $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 +set _ `ls -ln f`; g=$5; test "$g" = $g1 || fail=1 +set _ `ls -ln symlink`; g=$5; test "$g" = $g2 || fail=1 chgrp $g2 f -set _ `ls -l f`; g=$5; test "$g" = $g2 || fail=1 +set _ `ls -ln f`; g=$5; test "$g" = $g2 || fail=1 # This *should* change the group of f. # Though note that the diagnostic you'd get with -c 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 +set _ `ls -ln f`; g=$5; test "$g" = $g1 || fail=1 +set _ `ls -ln symlink`; g=$5; test "$g" = $g2 || fail=1 (exit $fail); exit $fail diff --git a/tests/chgrp/posix-H b/tests/chgrp/posix-H index 92a2cd0c0..e9736968d 100755 --- a/tests/chgrp/posix-H +++ b/tests/chgrp/posix-H @@ -48,7 +48,7 @@ for i in $changed; do # Filter out symlinks (entries that end in `s'), since it's not # possible to change their group/owner information on some systems. case $i in *s) continue;; esac - set _ `ls -dg $i`; shift + set _ `ls -dgn $i`; shift group=$3 test $group = $g2 || fail=1 done @@ -64,7 +64,7 @@ for i in $not_changed; do # Filter out symlinks (entries that end in `s'), since it's not # possible to change their group/owner information on some systems. case $i in *s) continue;; esac - set _ `ls -dg $i`; shift + set _ `ls -dgn $i`; shift group=$3 test $group = $g1 || fail=1 done diff --git a/tests/chgrp/recurse b/tests/chgrp/recurse index 05aaa08d4..7cd1648e2 100755 --- a/tests/chgrp/recurse +++ b/tests/chgrp/recurse @@ -35,22 +35,22 @@ ln -s ../e d/s chgrp -R $g1 e/ee || fail=1 # This should not should change the group of e/ee chgrp -R $g2 d -set _ `ls -l e/ee`; g=$5; test "$g" = $g1 || fail=1 +set _ `ls -ln e/ee`; g=$5; test "$g" = $g1 || fail=1 # This must change the group of e/ee, since -L makes # chgrp traverse the symlink from d/s into e. chgrp -L -R $g2 d -set _ `ls -l e/ee`; g=$5; test "$g" = $g2 || fail=1 +set _ `ls -ln e/ee`; g=$5; test "$g" = $g2 || fail=1 # This must *not* change the group of e/ee chgrp -H -R $g1 d -set _ `ls -l e/ee`; g=$5; test "$g" = $g2 || fail=1 +set _ `ls -ln e/ee`; g=$5; test "$g" = $g2 || fail=1 ln -s d link # This shouldn't change the group of e/ee either. chgrp -H -R $g1 link || fail=1 -set _ `ls -l e/ee`; g=$5; test "$g" = $g2 || fail=1 +set _ `ls -ln e/ee`; g=$5; test "$g" = $g2 || fail=1 # But it *should* change d/dd. -set _ `ls -l d/dd`; g=$5; test "$g" = $g1 || fail=1 +set _ `ls -ln d/dd`; g=$5; test "$g" = $g1 || fail=1 (exit $fail); exit $fail |