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
18 $TOOLDIR/tls "$1" | grep "$2" >/dev/null
21 # Put some files in the From directory
23 cat <<EOF >"$fromdir/1"
27 cat <<EOF >"$fromdir/2"
32 chmod 700 "$fromdir/1" || test_skipped "Can't chmod"
33 chmod 600 "$fromdir/2"
35 $RSYNC -rvv "$fromdir/" "$todir/"
37 check_perms "$todir/1" $P700 || test_fail "After initial transfer: to/1 should have 700 permissions"
38 check_perms "$todir/2" $P600 || test_fail "After initial transfer: to/2 should have 600 permissions"
40 # Mix up the permissions a bit
41 chmod 600 "$fromdir/1"
42 chmod 601 "$fromdir/2"
45 $RSYNC -rvv "$fromdir/" "$todir/"
47 # No -E, so nothing should have changed
48 check_perms "$todir/1" $P700 || test_fail "After update without -E: to/1 should still have 700 permissions"
49 check_perms "$todir/2" $P604 || test_fail "After update without -E: to/2 should still have 604 permissions"
51 $RSYNC -rvvE "$fromdir/" "$todir/"
53 # Now things should have happened!
54 check_perms "$todir/1" $P600 || test_fail "After update with -E: to/1 should now have 600 permissions"
55 check_perms "$todir/2" $P705 || test_fail "After update with -E: to/2 should now have 705 permissions"