3 # This program is distributable under the terms of the GNU GPL see
6 # Test the --executability or -E option. -- Matt McCutchen
8 . $srcdir/testsuite/rsync.fns
12 # Put some files in the From directory
14 cat <<EOF >"$fromdir/1"
18 cat <<EOF >"$fromdir/2"
23 chmod 700 "$fromdir/1" || test_skipped "Can't chmod"
24 chmod 600 "$fromdir/2"
26 $RSYNC -rvv "$fromdir/" "$todir/"
28 check_perms "$todir/1" rwx------ || test_fail "After initial transfer: to/1 should have 700 permissions"
29 check_perms "$todir/2" rw------- || test_fail "After initial transfer: to/2 should have 600 permissions"
31 # Mix up the permissions a bit
32 chmod 600 "$fromdir/1"
33 chmod 601 "$fromdir/2"
36 $RSYNC -rvv "$fromdir/" "$todir/"
38 # No -E, so nothing should have changed
39 check_perms "$todir/1" rwx------ || test_fail "After update without -E: to/1 should still have 700 permissions"
40 check_perms "$todir/2" rw----r-- || test_fail "After update without -E: to/2 should still have 604 permissions"
42 $RSYNC -rvvE "$fromdir/" "$todir/"
44 # Now things should have happened!
45 check_perms "$todir/1" rw------- || test_fail "After update with -E: to/1 should now have 600 permissions"
46 check_perms "$todir/2" rwx---r-x || test_fail "After update with -E: to/2 should now have 705 permissions"