executability.test 944 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #! /bin/sh
  2. # This program is distributable under the terms of the GNU GPL (see
  3. # COPYING).
  4. # Test the --executability or -E option. -- Matt McCutchen
  5. . $srcdir/testsuite/rsync.fns
  6. # Put some files in the From directory
  7. mkdir "$fromdir"
  8. cat <<EOF >"$fromdir/1"
  9. #!/bin/sh
  10. echo 'Program One!'
  11. EOF
  12. cat <<EOF >"$fromdir/2"
  13. #!/bin/sh
  14. echo 'Program Two!'
  15. EOF
  16. chmod 1700 "$fromdir/1" || test_skipped "Can't chmod"
  17. chmod 600 "$fromdir/2"
  18. $RSYNC -rvv "$fromdir/" "$todir/"
  19. check_perms "$todir/1" rwx------ 1
  20. check_perms "$todir/2" rw------- 1
  21. # Mix up the permissions a bit
  22. chmod 600 "$fromdir/1"
  23. chmod 601 "$fromdir/2"
  24. chmod 604 "$todir/2"
  25. $RSYNC -rvv "$fromdir/" "$todir/"
  26. # No -E, so nothing should have changed
  27. check_perms "$todir/1" rwx------ 2
  28. check_perms "$todir/2" rw----r-- 2
  29. $RSYNC -rvvE "$fromdir/" "$todir/"
  30. # Now things should have happened!
  31. check_perms "$todir/1" rw------- 3
  32. check_perms "$todir/2" rwx---r-x 3
  33. # Hooray
  34. exit 0