Fixed an "Internal abbrev error" when dealing with an xattr value
[rsync/rsync.git] / testsuite / unsafe-links.test
index cdf4089..058269e 100644 (file)
@@ -2,7 +2,7 @@
 
 # Originally by VladimĂ­r Michl <Vladimir.Michl@hlubocky.del.cz>
 
-. $srcdir/testsuite/rsync.fns
+. "$suitedir/rsync.fns"
 
 test_symlink() {
        is_a_link "$1" || test_fail "File $1 is not a symlink"
@@ -14,13 +14,7 @@ test_regular() {
        fi;
 };
 
-test_copy() {
-       test_symlink dest/links/file1
-       test_symlink dest/links/file2
-       test_regular dest/links/unsafefile
-}
-
-cd "$TMP"
+cd "$tmpdir"
 
 mkdir from
 
@@ -38,21 +32,35 @@ ln -s ../files/file1 "from/safe/links/"
 ln -s ../files/file2 "from/safe/links/"
 ln -s ../../unsafe/unsafefile "from/safe/links/"
 
-#next rsync copy correctly
-set -x
-echo "rsync with relative path";
-rsync -avv --copy-unsafe-links from/safe/ to
-test_copy;
+echo "rsync with relative path and just -a";
+$RSYNC -avv from/safe/ to
+test_symlink to/links/file1
+test_symlink to/links/file2
+test_symlink to/links/unsafefile
+
+echo "rsync with relative path and -a --copy-links"
+$RSYNC -avv --copy-links from/safe/ to
+test_regular to/links/file1
+test_regular to/links/file2
+test_regular to/links/unsafefile
+
+echo "rsync with relative path and --copy-unsafe-links";
+$RSYNC -avv --copy-unsafe-links from/safe/ to
+test_symlink to/links/file1
+test_symlink to/links/file2
+test_regular to/links/unsafefile
 
 rm -rf to
-#next rsync copy uncorectly - links are copied as files not as links
 echo "rsync with relative2 path";
-(cd from; rsync -avv --copy-unsafe-links safe/ ../to)
-test_copy;
+(cd from; $RSYNC -avv --copy-unsafe-links safe/ ../to)
+test_symlink to/links/file1
+test_symlink to/links/file2
+test_regular to/links/unsafefile
 
 rm -rf to
-#next rsync copy uncorectly - all links are copied
 echo "rsync with absolute path";
-rsync -avv --copy-unsafe-links `pwd`/from/safe/ to
-test_copy;
+$RSYNC -avv --copy-unsafe-links `pwd`/from/safe/ to
+test_symlink to/links/file1
+test_symlink to/links/file2
+test_regular to/links/unsafefile