From 2d8f9b1df01e5919c8331f1eb84e80532252f72c Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 9 Feb 2008 21:30:49 -0800 Subject: [PATCH] Ignore exit-code 23 when we expect a daemon-excluded file to be excluded. --- testsuite/batch-mode.test | 2 +- testsuite/daemon-gzip-upload.test | 2 +- testsuite/rsync.fns | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/testsuite/batch-mode.test b/testsuite/batch-mode.test index 01df67f8..6b32ca54 100644 --- a/testsuite/batch-mode.test +++ b/testsuite/batch-mode.test @@ -43,7 +43,7 @@ runtest "BATCH.sh use of --read-batch" 'checkit "./BATCH.sh" "$chkdir" "$todir"' rm -rf "$todir" 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" "$chkdir" "$todir"' +runtest "daemon recv --write-batch" 'checkit "\"$ignore23\" $RSYNC -av --write-batch=BATCH \"$fromdir/\" rsync://localhost/test-to" "$chkdir" "$todir"' # The script would have aborted on error, so getting here means we pass. exit 0 diff --git a/testsuite/daemon-gzip-upload.test b/testsuite/daemon-gzip-upload.test index d290228d..11c52bad 100644 --- a/testsuite/daemon-gzip-upload.test +++ b/testsuite/daemon-gzip-upload.test @@ -25,7 +25,7 @@ hands_setup # Build chkdir with a normal rsync and an --exclude. $RSYNC -av --exclude=foobar.baz "$fromdir/" "$chkdir/" -checkit "$RSYNC -avvvvz '$fromdir/' localhost::test-to/" "$chkdir" "$todir" +checkit "'$ignore23' $RSYNC -avvvvz '$fromdir/' localhost::test-to/" "$chkdir" "$todir" # The script would have aborted on error, so getting here means we've won. exit 0 diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns index 926a42e5..ac7920da 100644 --- a/testsuite/rsync.fns +++ b/testsuite/rsync.fns @@ -256,6 +256,25 @@ gid = 0 path = $scratchdir read only = no EOF + + # Build a helper script to ignore exit code 23 + ignore23="$scratchdir/ignore23" + echo "building help script $ignore23" + + cat >"$ignore23" <<'EOT' +if "${@}"; then + exit +fi + +ret=$? + +if test $ret = 23; then + exit +fi + +exit $ret +EOT +chmod +x "$ignore23" } -- 2.34.1