From: Wayne Davison Date: Thu, 20 Oct 2022 02:18:20 +0000 (-0700) Subject: Re-run the exclude test using lsh.sh pull. X-Git-Tag: v3.2.7~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de6848ed97760de988e2a41af4d66bc4fd0f1995;p=thirdparty%2Frsync.git Re-run the exclude test using lsh.sh pull. The exclude.test file continues to run local copies (which are a special kind of "push") while the exclude-lsh.test symlink runs a a "pull" using the lsh.sh script as the "remote" shell. --- diff --git a/testsuite/exclude-lsh.test b/testsuite/exclude-lsh.test new file mode 120000 index 00000000..84bc98ac --- /dev/null +++ b/testsuite/exclude-lsh.test @@ -0,0 +1 @@ +exclude.test \ No newline at end of file diff --git a/testsuite/exclude.test b/testsuite/exclude.test index 9b487b60..56b68b8c 100644 --- a/testsuite/exclude.test +++ b/testsuite/exclude.test @@ -15,6 +15,19 @@ CVSIGNORE='*.junk' export CVSIGNORE +case $0 in +*-lsh.*) + RSYNC_RSH="$scratchdir/src/support/lsh.sh" + export RSYNC_RSH + rpath=" --rsync-path='$RSYNC'" + host='lh:' + ;; +*) + rpath='' + host='' + ;; +esac + # Build some files/dirs/links to copy makepath "$fromdir/foo/down/to/you" @@ -106,8 +119,8 @@ home-cvs-exclude EOF # Start with a check of --prune-empty-dirs: -$RSYNC -av -f -_foo/too/ -f -_foo/down/ -f -_foo/and/ -f -_new/ "$fromdir/" "$chkdir/" -checkit "$RSYNC -av --prune-empty-dirs '$fromdir/' '$todir/'" "$chkdir" "$todir" +$RSYNC -av --rsync-path="$RSYNC" -f -_foo/too/ -f -_foo/down/ -f -_foo/and/ -f -_new/ "$host$fromdir/" "$chkdir/" +checkit "$RSYNC -av$rpath --prune-empty-dirs '$host$fromdir/' '$todir/'" "$chkdir" "$todir" rm -rf "$todir" # Add a directory symlink. @@ -120,7 +133,7 @@ touch "$scratchdir/up1/same-newness" "$scratchdir/up2/same-newness" touch "$scratchdir/up1/extra-src" "$scratchdir/up2/extra-dest" # Create chkdir with what we expect to be excluded. -checkit "$RSYNC -avv '$fromdir/' '$chkdir/'" "$fromdir" "$chkdir" +checkit "$RSYNC -avv$rpath '$host$fromdir/' '$chkdir/'" "$fromdir" "$chkdir" sleep 1 # Ensures that the rm commands will tweak the directory times. rm -r "$chkdir"/foo/down rm -r "$chkdir"/mid/for/foo/and @@ -135,12 +148,12 @@ touch "$scratchdir/up1/src-newness" "$scratchdir/up2/dst-newness" # Un-tweak the directory times in our first (weak) exclude test (though # it's a good test of the --existing option). -$RSYNC -av --existing --include='*/' --exclude='*' "$fromdir/" "$chkdir/" +$RSYNC -av --rsync-path="$RSYNC" --existing --include='*/' --exclude='*' "$host$fromdir/" "$chkdir/" # Now, test if rsync excludes the same files. -checkit "$RSYNC -avv --exclude-from='$excl' \ - --delete-during '$fromdir/' '$todir/'" "$chkdir" "$todir" +checkit "$RSYNC -avv$rpath --exclude-from='$excl' \ + --delete-during '$host$fromdir/' '$todir/'" "$chkdir" "$todir" # Modify the chk dir by removing cvs-ignored files and then tweaking the dir times. @@ -150,13 +163,15 @@ rm "$chkdir"/bar/down/to/foo/*.junk rm "$chkdir"/bar/down/to/home-cvs-exclude rm "$chkdir"/mid/one-in-one-out -$RSYNC -av --existing --filter='exclude,! */' "$fromdir/" "$chkdir/" +$RSYNC -av --rsync-path="$RSYNC" --existing --filter='exclude,! */' "$host$fromdir/" "$chkdir/" # Now, test if rsync excludes the same files, this time with --cvs-exclude # and --delete-excluded. -checkit "$RSYNC -avvC --filter='merge $excl' --delete-excluded \ - --delete-during '$fromdir/' '$todir/'" "$chkdir" "$todir" +# The -C option gets applied in a different order when pushing & pulling, so we instead +# add the 2 --cvs-exclude filter rules (":C" & "-C") via -f to keep the order the same. +checkit "$RSYNC -avv$rpath --filter='merge $excl' -f:C -f-C --delete-excluded \ + --delete-during '$host$fromdir/' '$todir/'" "$chkdir" "$todir" # Modify the chk dir for our merge-exclude test and then tweak the dir times. @@ -165,19 +180,19 @@ rm "$chkdir"/bar/down/to/bar/baz/*.deep cp_touch "$fromdir"/bar/down/to/foo/*.junk "$chkdir"/bar/down/to/foo cp_touch "$fromdir"/bar/down/to/foo/to "$chkdir"/bar/down/to/foo -$RSYNC -av --existing -f 'show .filt*' -f 'hide,! */' --del "$fromdir/" "$todir/" +$RSYNC -av --rsync-path="$RSYNC" --existing -f 'show .filt*' -f 'hide,! */' --del "$host$fromdir/" "$todir/" echo retained >"$todir"/bar/down/to/bar/baz/nodel.deep cp_touch "$todir"/bar/down/to/bar/baz/nodel.deep "$chkdir"/bar/down/to/bar/baz -$RSYNC -av --existing --filter='-! */' "$fromdir/" "$chkdir/" +$RSYNC -av --rsync-path="$RSYNC" --existing --filter='-! */' "$host$fromdir/" "$chkdir/" # Now, test if rsync excludes the same files, this time with a merge-exclude # file. checkit "sed '/!/d' '$excl' | - $RSYNC -avv -f dir-merge_.filt -f merge_- \ - --delete-during '$fromdir/' '$todir/'" "$chkdir" "$todir" + $RSYNC -avv$rpath -f dir-merge_.filt -f merge_- \ + --delete-during '$host$fromdir/' '$todir/'" "$chkdir" "$todir" # Remove the files that will be deleted. @@ -188,14 +203,14 @@ rm "$chkdir"/bar/down/to/foo/.filt2 rm "$chkdir"/bar/down/to/bar/.filt2 rm "$chkdir"/mid/.filt -$RSYNC -av --existing --include='*/' --exclude='*' "$fromdir/" "$chkdir/" +$RSYNC -av --rsync-path="$RSYNC" --existing --include='*/' --exclude='*' "$host$fromdir/" "$chkdir/" # Now, try the prior command with --delete-before and some side-specific # rules. checkit "sed '/!/d' '$excl' | - $RSYNC -avv -f :s_.filt -f .s_- -f P_nodel.deep \ - --delete-before '$fromdir/' '$todir/'" "$chkdir" "$todir" + $RSYNC -avv$rpath -f :s_.filt -f .s_- -f P_nodel.deep \ + --delete-before '$host$fromdir/' '$todir/'" "$chkdir" "$todir" # Next, we'll test some rule-restricted filter files. @@ -206,26 +221,26 @@ cat >"$fromdir/bar/down/to/foo/.excl" <f$all_plus extra-src