diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 16:14:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 16:14:31 +0000 |
commit | 2d5707c7479eacb3b1ad98e01b53f56a88f8fb78 (patch) | |
tree | d9c334e83692851c02e3e1b8e65570c97bc82481 /testsuite/executability.test | |
parent | Initial commit. (diff) | |
download | rsync-2d5707c7479eacb3b1ad98e01b53f56a88f8fb78.tar.xz rsync-2d5707c7479eacb3b1ad98e01b53f56a88f8fb78.zip |
Adding upstream version 3.2.7.upstream/3.2.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testsuite/executability.test')
-rw-r--r-- | testsuite/executability.test | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/testsuite/executability.test b/testsuite/executability.test new file mode 100644 index 0000000..8f09d8f --- /dev/null +++ b/testsuite/executability.test @@ -0,0 +1,47 @@ +#!/bin/sh + +# This program is distributable under the terms of the GNU GPL (see +# COPYING). + +# Test the --executability or -E option. -- Matt McCutchen + +. $suitedir/rsync.fns + +# Put some files in the From directory +mkdir "$fromdir" +cat <<EOF >"$fromdir/1" +#!/bin/sh +echo 'Program One!' +EOF +cat <<EOF >"$fromdir/2" +#!/bin/sh +echo 'Program Two!' +EOF + +chmod 1700 "$fromdir/1" || test_skipped "Can't chmod" +chmod 600 "$fromdir/2" + +$RSYNC -rvv "$fromdir/" "$todir/" + +check_perms "$todir/1" rwx------ 1 +check_perms "$todir/2" rw------- 1 + +# Mix up the permissions a bit +chmod 600 "$fromdir/1" +chmod 601 "$fromdir/2" +chmod 604 "$todir/2" + +$RSYNC -rvv "$fromdir/" "$todir/" + +# No -E, so nothing should have changed +check_perms "$todir/1" rwx------ 2 +check_perms "$todir/2" rw----r-- 2 + +$RSYNC -rvvE "$fromdir/" "$todir/" + +# Now things should have happened! +check_perms "$todir/1" rw------- 3 +check_perms "$todir/2" rwx---r-x 3 + +# Hooray +exit 0 |