[PATCH] Batch-mode rewrite

Chris Shoemaker c.shoemaker at cox.net
Thu Jul 22 20:10:41 GMT 2004


Wayne,

I took a crack a batch-mode test case, to try avoid batch-mode
regressions.  Does this look reasonable?

Also, I came across a confusing typo (I think.)  Also attached.

-chris

-------------- next part --------------
Index: testsuite/README.testsuite
===================================================================
RCS file: /cvsroot/rsync/testsuite/README.testsuite,v
retrieving revision 1.2
diff -u -r1.2 README.testsuite
--- testsuite/README.testsuite	12 Mar 2002 00:22:22 -0000	1.2
+++ testsuite/README.testsuite	23 Jul 2004 00:54:58 -0000
@@ -17,8 +17,8 @@
 path.
 
 If the tests pass, you should see a report to that effect.  Some tests
-require being root or some other precondition, and so will normally be
-checked -- look at the test scripts for more information.
+require being root or some other precondition, and so will normally not
+be checked -- look at the test scripts for more information.
 
 If the tests fail, you will see rather more output.  The scratch
 directory will remain in the build directory.  It would be useful if
-------------- next part --------------
#! /bin/sh

# Copyright (C) 2004 by Chris Shoemaker <c.shoemaker at cox.net>

# This program is distributable under the terms of the GNU GPL (see
# COPYING).

# Test rsync's --write-batch and --read-batch options

. "$suitedir/rsync.fns"

set -x

hands_setup || test_fail "failed to build test directories"

runtest "local --write-batch" 'checkit "$RSYNC -av --write-batch=BATCH \"$fromdir/\" \"$todir\"" "$fromdir/" "$todir"'

rm -rf "$todir" || test_fail "failed to remove destination directory"

runtest "--read-batch" 'checkit "$RSYNC -av --read-batch=BATCH \"$todir\"" "$fromdir/" "$todir"'

rm -rf "$todir" || test_fail "failed to remove destination directory"

build_rsyncd_conf
                                                                                
RSYNC_CONNECT_PROG="$RSYNC --config=$conf --daemon"
export RSYNC_CONNECT_PROG
                                                                                
runtest "daemon sender --write-batch" "$RSYNC -av --write-batch=BATCH rsync://localhost/test-from/  \"$todir\""

rm -rf tmptodir
mv "$todir" tmptodir || test_fail "failed to save copy of destination directory"
runtest "--read-batch from daemon" 'checkit "$RSYNC -av --read-batch=BATCH \"$todir\"" "$todir/" tmptodir'

rm -rf "$todir" || test_fail "failed to remove destination directory"
runtest "BATCH.sh use of --read-batch" 'checkit "./BATCH.sh" "$todir" tmptodir'

rm -rf "$todir" || test_fail "failed to remove destination directory"
mkdir $todir || test_fail "failed to restore empty destination directory"
runtest "daemon recv --write-batch" 'checkit "$RSYNC -av --write-batch=BATCH \"$fromdir/\" rsync://localhost/test-to" "$todir/" tmptodir'

if [ x"$preserve_scratch" != xyes ]
then
  rm -rf tmptodir BATCH BATCH.sh || test_fail "failed to remove batch files"
fi

# The script would have aborted on error, so getting here means we pass.
exit 0


More information about the rsync mailing list