Fixed get_xattr_acl() -- it needed to zero *len_p.
[rsync.git] / testsuite / relative.test
blob4d578ed14ac84dd827101f76fc6991594bacb728
1 #!/bin/sh
3 # Copyright (C) 2005 by Wayne Davison <wayned@samba.org>
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 outfile="$scratchdir/rsync.out"
25 cd "$fromdir"
27 # Main script starts here
29 $RSYNC -ai --include=/down/ --exclude='/*' "$fromdir/" "$chkdir/"
31 sleep 1
32 runtest "basic relative" 'checkit "$RSYNC -avR ./$deepstr \"$todir\"" "$chkdir" "$todir"'
34 ln $deepstr/filelist $deepstr/dir
35 ln ../chk/$deepstr/filelist ../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