A daemon needs to set dry_run with --only-write-batch.
[rsync.git] / testsuite / executability.test
blobb11e672227e8e515c62bf715a60aec4e3fd7d22e
1 #! /bin/sh
3 # This program is distributable under the terms of the GNU GPL (see
4 # COPYING).
6 # Test the --executability or -E option. -- Matt McCutchen
8 . $srcdir/testsuite/rsync.fns
10 # Put some files in the From directory
11 mkdir "$fromdir"
12 cat <<EOF >"$fromdir/1"
13 #!/bin/sh
14 echo 'Program One!'
15 EOF
16 cat <<EOF >"$fromdir/2"
17 #!/bin/sh
18 echo 'Program Two!'
19 EOF
21 chmod 1700 "$fromdir/1" || test_skipped "Can't chmod"
22 chmod 600 "$fromdir/2"
24 $RSYNC -rvv "$fromdir/" "$todir/"
26 check_perms "$todir/1" rwx------ 1
27 check_perms "$todir/2" rw------- 1
29 # Mix up the permissions a bit
30 chmod 600 "$fromdir/1"
31 chmod 601 "$fromdir/2"
32 chmod 604 "$todir/2"
34 $RSYNC -rvv "$fromdir/" "$todir/"
36 # No -E, so nothing should have changed
37 check_perms "$todir/1" rwx------ 2
38 check_perms "$todir/2" rw----r-- 2
40 $RSYNC -rvvE "$fromdir/" "$todir/"
42 # Now things should have happened!
43 check_perms "$todir/1" rw------- 3
44 check_perms "$todir/2" rwx---r-x 3
46 # Hooray
47 exit 0