Report all socket connection errors if we fail.
[rsync/qnx.git] / testsuite / batch-mode.test
blob7f92e4821ea362d02a1db82cc73cff5f5f50df8a
1 #! /bin/sh
3 # Copyright (C) 2004 by Chris Shoemaker <c.shoemaker@cox.net>
5 # This program is distributable under the terms of the GNU GPL (see
6 # COPYING).
8 # Test rsync's --write-batch and --read-batch options
10 . "$suitedir/rsync.fns"
12 hands_setup
14 cd "$tmpdir"
16 # Build chkdir for the daemon tests using a normal rsync and an --exclude.
17 $RSYNC -av --exclude=foobar.baz "$fromdir/" "$chkdir/"
19 $RSYNC -av --only-write-batch=BATCH --exclude=foobar.baz "$fromdir/" "$todir/missing/"
20 test -d "$todir/missing" && test_fail "--only-write-batch should not have created destination dir"
22 runtest "--read-batch (only)" 'checkit "$RSYNC -av --read-batch=BATCH \"$todir\"" "$chkdir" "$todir"'
24 rm -rf "$todir" BATCH*
25 runtest "local --write-batch" 'checkit "$RSYNC -av --write-batch=BATCH \"$fromdir/\" \"$todir\"" "$fromdir" "$todir"'
27 rm -rf "$todir"
28 runtest "--read-batch" 'checkit "$RSYNC -av --read-batch=BATCH \"$todir\"" "$fromdir" "$todir"'
30 build_rsyncd_conf
32 RSYNC_CONNECT_PROG="$RSYNC --config=$conf --daemon"
33 export RSYNC_CONNECT_PROG
35 rm -rf "$todir"
36 runtest "daemon sender --write-batch" 'checkit "$RSYNC -av --write-batch=BATCH rsync://localhost/test-from/ \"$todir\"" "$chkdir" "$todir"'
38 rm -rf "$todir"
39 runtest "--read-batch from daemon" 'checkit "$RSYNC -av --read-batch=BATCH \"$todir\"" "$chkdir" "$todir"'
41 rm -rf "$todir"
42 runtest "BATCH.sh use of --read-batch" 'checkit "./BATCH.sh" "$chkdir" "$todir"'
44 runtest "do-nothing re-run of batch" 'checkit "./BATCH.sh" "$chkdir" "$todir"'
46 rm -rf "$todir"
47 mkdir "$todir" || test_fail "failed to restore empty destination directory"
48 runtest "daemon recv --write-batch" 'checkit "\"$ignore23\" $RSYNC -av --write-batch=BATCH \"$fromdir/\" rsync://localhost/test-to" "$chkdir" "$todir"'
50 # The script would have aborted on error, so getting here means we pass.
51 exit 0