If system won't let us set chmod bits, fall back to testing without
[rsync/rsync.git] / testsuite / chmod.test
CommitLineData
6558854d
WD
1#! /bin/sh
2
3# Copyright (C) 2004 by Wayne Davison <wayned@samba.org>
4
5# This program is distributable under the terms of the GNU GPL see
6# COPYING).
7
8# Test that various read-only and set[ug]id permissions work properly,
9# even when using a --temp-dir option (which we try to point at a
10# different filesystem than the destination dir).
11
12. "$suitedir/rsync.fns"
13
14set -x
15
16hands_setup
17
18chmod 440 "$fromdir/text"
19chmod 500 "$fromdir/dir/text"
d66d07e8
WD
20e="$fromdir/dir/subdir/foobar.baz"
21chmod 6450 "$e" || chmod 2450 "$e" || chmod 1450 "$e" || chmod 450 "$e"
22e="$fromdir/dir/subdir/subsubdir/etc-ltr-list"
23chmod 2670 "$e" || chmod 1670 "$e" || chmod 670 "$e"
6558854d
WD
24
25# First a normal copy.
26runtest "normal copy" 'checkit "$RSYNC -avv \"$fromdir/\" \"$todir\"" "$fromdir" "$todir"'
27
28# Then we update all the files.
29runtest "update copy" 'checkit "$RSYNC -avvI --no-whole-file \"$fromdir/\" \"$todir\"" "$fromdir" "$todir"'
30
31# The script would have aborted on error, so getting here means we've won.
32exit 0