Fixed the interaction of --fake-super with --link-dest & --xattrs.
[rsync/rsync.git] / testsuite / executability.test
CommitLineData
c6fbd563
WD
1#! /bin/sh
2
114bafe0 3# This program is distributable under the terms of the GNU GPL (see
c6fbd563
WD
4# COPYING).
5
6# Test the --executability or -E option. -- Matt McCutchen
7
8. $srcdir/testsuite/rsync.fns
9
c6fbd563
WD
10# Put some files in the From directory
11mkdir "$fromdir"
12cat <<EOF >"$fromdir/1"
13#!/bin/sh
14echo 'Program One!'
15EOF
16cat <<EOF >"$fromdir/2"
17#!/bin/sh
18echo 'Program Two!'
19EOF
20
114bafe0 21chmod 1700 "$fromdir/1" || test_skipped "Can't chmod"
c6fbd563
WD
22chmod 600 "$fromdir/2"
23
24$RSYNC -rvv "$fromdir/" "$todir/"
25
6b439248
WD
26check_perms "$todir/1" rwx------ 1
27check_perms "$todir/2" rw------- 1
c6fbd563
WD
28
29# Mix up the permissions a bit
30chmod 600 "$fromdir/1"
31chmod 601 "$fromdir/2"
32chmod 604 "$todir/2"
33
34$RSYNC -rvv "$fromdir/" "$todir/"
35
36# No -E, so nothing should have changed
6b439248
WD
37check_perms "$todir/1" rwx------ 2
38check_perms "$todir/2" rw----r-- 2
c6fbd563
WD
39
40$RSYNC -rvvE "$fromdir/" "$todir/"
41
42# Now things should have happened!
6b439248
WD
43check_perms "$todir/1" rw------- 3
44check_perms "$todir/2" rwx---r-x 3
c6fbd563
WD
45
46# Hooray
47exit 0