Ignore exit-code 23 when we expect a daemon-excluded file to be excluded.
authorWayne Davison <wayned@samba.org>
Sun, 10 Feb 2008 05:30:49 +0000 (21:30 -0800)
committerWayne Davison <wayned@samba.org>
Sun, 10 Feb 2008 05:30:49 +0000 (21:30 -0800)
testsuite/batch-mode.test
testsuite/daemon-gzip-upload.test
testsuite/rsync.fns

index 01df67f858e911bef40a47ecc18e42c6b739069f..6b32ca540e4e0a4ccb51c67cb4ff607fdae0661b 100644 (file)
@@ -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
index d290228d8856f7bbc31af4932a6267301efedcb4..11c52bad3d79e51fa78cf1e5f00d2e2e853dfe34 100644 (file)
@@ -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
index 926a42e544c2313fabf400d4e83caebc7d3a90cb..ac7920da7dc6d0760b54bc89129836e4e0c830b2 100644 (file)
@@ -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"
 }