Improved to test --link-dest (when hard-linking of devices works).
[rsync/rsync.git] / testsuite / itemize.test
index c77ace5..1614fb9 100644 (file)
@@ -29,6 +29,7 @@ ln "$fromdir/foo/config1" "$fromdir/foo/extra"
 $RSYNC -iplr "$fromdir/" "$todir/" \
     | tee "$outfile"
 cat <<EOT >"$chkfile"
+cd+++++++ ./
 cd+++++++ bar/
 cd+++++++ bar/baz/
 >f+++++++ bar/baz/rsync
@@ -130,11 +131,11 @@ EOT
 diff $diffopt "$chkfile" "$outfile" || test_fail "test 7 failed"
 
 mv "$todir" "$lddir"
-$RSYNC -ivvplrtH --copy-dest="$lddir" "$fromdir/" "$todir/" \
+$RSYNC -ivvplrtH --copy-dest=../ld "$fromdir/" "$todir/" \
     | tee "$outfile"
 filter_outfile
 cat <<EOT >"$chkfile"
-.d..t.... ./
+cd+++++++ ./
 cd+++++++ bar/
 cd+++++++ bar/baz/
 cf        bar/baz/rsync
@@ -147,10 +148,10 @@ EOT
 diff $diffopt "$chkfile" "$outfile" || test_fail "test 8 failed"
 
 rm -rf "$todir"
-$RSYNC -iplrtH --copy-dest="$lddir" "$fromdir/" "$todir/" \
+$RSYNC -iplrtH --copy-dest=../ld "$fromdir/" "$todir/" \
     | tee "$outfile"
 cat <<EOT >"$chkfile"
-.d..t.... ./
+cd+++++++ ./
 cd+++++++ bar/
 cd+++++++ bar/baz/
 cd+++++++ foo/
@@ -181,7 +182,7 @@ $RSYNC -ivvplrtH --link-dest="$lddir" "$fromdir/" "$todir/" \
     | tee "$outfile"
 filter_outfile
 cat <<EOT >"$chkfile"
-.d..t.... ./
+cd+++++++ ./
 cd+++++++ bar/
 cd+++++++ bar/baz/
 hf        bar/baz/rsync
@@ -194,16 +195,27 @@ EOT
 diff $diffopt "$chkfile" "$outfile" || test_fail "test 11 failed"
 
 rm -rf "$todir"
-$RSYNC -iplrtH --link-dest="$lddir" "$fromdir/" "$todir/" \
+$RSYNC -iplrtH --dry-run --link-dest=../ld "$fromdir/" "$todir/" \
     | tee "$outfile"
 cat <<EOT >"$chkfile"
-.d..t.... ./
+cd+++++++ ./
 cd+++++++ bar/
 cd+++++++ bar/baz/
 cd+++++++ foo/
 EOT
 diff $diffopt "$chkfile" "$outfile" || test_fail "test 12 failed"
 
+rm -rf "$todir"
+$RSYNC -iplrtH --link-dest=../ld "$fromdir/" "$todir/" \
+    | tee "$outfile"
+cat <<EOT >"$chkfile"
+cd+++++++ ./
+cd+++++++ bar/
+cd+++++++ bar/baz/
+cd+++++++ foo/
+EOT
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 13 failed"
+
 rm -rf "$todir"
 $RSYNC -vvplrtH --link-dest="$lddir" "$fromdir/" "$todir/" \
     | tee "$outfile"
@@ -219,7 +231,7 @@ foo/config2 is uptodate
 "foo/extra" is a hard link
 foo/sym is uptodate
 EOT
-diff $diffopt "$chkfile" "$outfile" || test_fail "test 13 failed"
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 14 failed"
 
 rm -rf "$todir"
 $RSYNC -ivvplrtH --compare-dest="$lddir" "$fromdir/" "$todir/" \
@@ -228,7 +240,7 @@ filter_outfile
 # TODO fix really-old problem when combining -H with --compare-dest:
 # missing output for foo/extra hard-link (and it might not be updated)!
 cat <<EOT >"$chkfile"
-.d..t.... ./
+cd+++++++ ./
 cd+++++++ bar/
 cd+++++++ bar/baz/
 .f        bar/baz/rsync
@@ -237,18 +249,18 @@ cd+++++++ foo/
 .f        foo/config2
 .L        foo/sym -> ../bar/baz/rsync
 EOT
-diff $diffopt "$chkfile" "$outfile" || test_fail "test 14 failed"
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 15 failed"
 
 rm -rf "$todir"
 $RSYNC -iplrtH --compare-dest="$lddir" "$fromdir/" "$todir/" \
     | tee "$outfile"
 cat <<EOT >"$chkfile"
-.d..t.... ./
+cd+++++++ ./
 cd+++++++ bar/
 cd+++++++ bar/baz/
 cd+++++++ foo/
 EOT
-diff $diffopt "$chkfile" "$outfile" || test_fail "test 15 failed"
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 16 failed"
 
 rm -rf "$todir"
 $RSYNC -vvplrtH --compare-dest="$lddir" "$fromdir/" "$todir/" \
@@ -265,7 +277,7 @@ foo/config2 is uptodate
 "foo/extra" is a hard link
 foo/sym is uptodate
 EOT
-diff $diffopt "$chkfile" "$outfile" || test_fail "test 16 failed"
+diff $diffopt "$chkfile" "$outfile" || test_fail "test 17 failed"
 
 # The script would have aborted on error, so getting here means we've won.
 exit 0