Fix compile w/o openssl; disable sha256 & sha512 for --checksum.
[rsync.git] / testsuite / relative.test
blob5546291b61c35a5e5f881393929da67f64b235d7
1 #!/bin/sh
3 # Copyright (C) 2005-2020 Wayne Davison
5 # This program is distributable under the terms of the GNU GPL (see COPYING)
7 . "$suitedir/rsync.fns"
9 deepstr='down/3/deep'
10 deepdir="$fromdir/$deepstr"
11 extradir="$fromdir/extra"
12 makepath "$deepdir" "$extradir/$deepstr" "$chkdir"
14 fromdir="$deepdir"
15 hands_setup
16 fromdir="$tmpdir/from"
18 extrafile="$extradir/./$deepstr/extra.added.value"
19 echo wowza >"$extrafile"
21 $RSYNC -av --existing --include='*/' --exclude='*' "$fromdir/" "$extradir/"
23 cd "$fromdir"
25 # Main script starts here
27 $RSYNC -ai --include=/down/ --exclude='/*' "$fromdir/" "$chkdir/"
29 sleep 1
30 runtest "basic relative" 'checkit "$RSYNC -avR ./$deepstr \"$todir\"" "$chkdir" "$todir"'
32 ln $deepstr/filelist $deepstr/dir
33 ln ../chk/$deepstr/filelist ../chk/$deepstr/dir
34 # Work around time rounding/truncating issue by touching both dirs.
35 touch -r $deepstr/dir $deepstr/dir ../chk/$deepstr/dir
36 runtest "hard links" 'checkit "$RSYNC -avHR ./$deepstr/ \"$todir\"" "$chkdir" "$todir"'
38 cp "$deepdir/text" "$todir/$deepstr/ThisShouldGo"
39 cp "$deepdir/text" "$todir/$deepstr/dir/ThisShouldGoToo"
40 runtest "deletion" 'checkit "$RSYNC -avHR --del ./$deepstr/ \"$todir\"" "$chkdir" "$todir"'
42 runtest "non-deletion" 'checkit "$RSYNC -aiHR --del ./$deepstr/ \"$todir\"" "$chkdir" "$todir"' \
43 | tee "$outfile"
45 # Make sure no files were deleted
46 grep 'deleting ' "$outfile" && test_fail "Erroneous deletions occurred!"
48 # Relative with merging.
49 $RSYNC -ai "$extradir/down" "$chkdir/"
51 checkit "$RSYNC -aiR $deepstr '$extrafile' '$todir'" "$chkdir" "$todir"
53 checkit "$RSYNC -aiR --del $deepstr '$extrafile' '$todir'" "$chkdir" "$todir" \
54 | tee "$outfile"
56 # Make sure no files were deleted
57 grep 'deleting ' "$outfile" && test_fail "Erroneous deletions occurred! (2)"
59 # The script would have aborted on error, so getting here means we've won.
60 exit 0