chgrp.test 689 B

12345678910111213141516171819202122232425262728293031
  1. #! /bin/sh
  2. # Copyright (C) 2002 by Martin Pool <mbp@samba.org>
  3. # This program is distributable under the terms of the GNU GPL (see
  4. # COPYING).
  5. # Test that rsync with -gr will preserve groups when the user running
  6. # the test is a member of them. Hopefully they're in at least one
  7. # test.
  8. . "$suitedir/rsync.fns"
  9. # Build some hardlinks
  10. mygrps="`rsync_getgroups`" || fail "Can't get groups"
  11. mkdir "$fromdir"
  12. for g in $mygrps
  13. do
  14. name="$fromdir/foo-$g"
  15. date > "$name"
  16. chgrp "$g" "$name" || fail "Can't chgrp"
  17. done
  18. sleep 2
  19. checkit "$RSYNC -rtgpvvv '$fromdir/' '$todir/'" "$fromdir" "$todir"
  20. # The script would have aborted on error, so getting here means we've won.
  21. exit 0