Added tests for multiple --compare-dest options and --copy-dest.
[rsync/rsync.git] / testsuite / compare-dest.test
CommitLineData
dce70db3
WD
1#! /bin/sh
2
0abda1b1 3# Copyright (C) 2004 by Wayne Davison <wayned@samba.org>
dce70db3
WD
4
5# This program is distributable under the terms of the GNU GPL see
6# COPYING).
7
0abda1b1 8# Test rsync handling of the --compare-dest option.
dce70db3
WD
9
10. "$suitedir/rsync.fns"
11
12set -x
13
1e609696
WD
14alt1dir="$tmpdir/alt1"
15alt2dir="$tmpdir/alt2"
dce70db3
WD
16
17# Build some files/dirs/links to copy
18
19hands_setup
20
3381b77d 21# Setup the alt and chk dirs
1e609696
WD
22$RSYNC -av --include=text --include='*/' --exclude='*' "$fromdir/" "$alt1dir/"
23$RSYNC -av --include=etc-ltr-list --include='*/' --exclude='*' "$fromdir/" "$alt2dir/"
dce70db3 24
3381b77d
WD
25sleep 1
26touch "$fromdir/dir/text"
27
1e609696 28$RSYNC -av --exclude=/text --exclude=etc-ltr-list "$fromdir/" "$chkdir/"
3381b77d
WD
29
30# Let's do it!
1e609696
WD
31checkit "$RSYNC -avv --no-whole-file \
32 --compare-dest=\"$alt1dir\" --compare-dest=\"$alt2dir\" \
3381b77d 33 \"$fromdir/\" \"$todir/\"" "$chkdir" "$todir"
1e609696
WD
34checkit "$RSYNC -avv --no-whole-file \
35 --copy-dest=\"$alt1dir\" --copy-dest=\"$alt2dir\" \
36 \"$fromdir/\" \"$todir/\"" "$fromdir" "$todir"
dce70db3
WD
37
38# The script would have aborted on error, so getting here means we've won.
39exit 0