3 # Copyright (C) 2002 by Martin Pool <mbp@samba.org>
5 # This program is distributable under the terms of the GNU GPL (see
8 # Test that the --chmod option functions correctly.
10 . $srcdir/testsuite/rsync.fns
16 fromdir="$scratchdir/from"
17 todir="$scratchdir/to"
18 checkdir="$scratchdir/check"
21 name1="$fromdir/name1"
22 name2="$fromdir/name2"
25 echo "This is the file" > "$name1"
26 echo "This is the other file" > "$name2"
29 chmod 4700 "$name1" || test_skipped "Can't chmod"
33 # Copy the files we've created over to another directory
34 checkit "$RSYNC -avv \"$fromdir/\" \"$checkdir/\"" "$fromdir" "$checkdir"
36 # And then manually make the changes which should occur
38 chmod ug-s,a+rX "$checkdir"/*
39 chmod +w "$checkdir" "$checkdir"/dir*
41 checkit "$RSYNC -avv --chmod ug-s,a+rX,D+w \"$fromdir/\" \"$todir/\"" "$checkdir" "$todir"
43 # The script would have aborted on error, so getting here means we've won.