mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-05-24 14:55:46 -04:00
- use `grep -E` and `grep -F` (`egrep` and `fgrep` are non-standard) - use same hashbang style for all test scripts - use explicit comparisons in test scripts - remove redundant ; from test scripts - make test script not executable, just like all the other scripts - unify codestyle across all test scripts - make openssl license exception clearer by having it at the top - use modern links in COPYING. The text now matches: https://www.gnu.org/licenses/gpl-3.0.txt - fix typo
66 lines
1.5 KiB
Bash
66 lines
1.5 KiB
Bash
#!/bin/sh
|
|
|
|
# Originally by Vladimír Michl <Vladimir.Michl@hlubocky.del.cz>
|
|
|
|
. "$suitedir/rsync.fns"
|
|
|
|
test_symlink() {
|
|
is_a_link "$1" || test_fail "File $1 is not a symlink"
|
|
}
|
|
|
|
test_regular() {
|
|
if [ ! -f "$1" ]; then
|
|
test_fail "File $1 is not regular file or not exists"
|
|
fi
|
|
}
|
|
|
|
cd "$tmpdir"
|
|
|
|
mkdir from
|
|
|
|
mkdir "from/safe"
|
|
mkdir "from/unsafe"
|
|
|
|
mkdir "from/safe/files"
|
|
mkdir "from/safe/links"
|
|
|
|
touch "from/safe/files/file1"
|
|
touch "from/safe/files/file2"
|
|
touch "from/unsafe/unsafefile"
|
|
|
|
ln -s ../files/file1 "from/safe/links/"
|
|
ln -s ../files/file2 "from/safe/links/"
|
|
ln -s ../../unsafe/unsafefile "from/safe/links/"
|
|
|
|
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
|
|
echo "rsync with relative2 path"
|
|
(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
|
|
echo "rsync with absolute path"
|
|
$RSYNC -avv --copy-unsafe-links `pwd`/from/safe/ to
|
|
test_symlink to/links/file1
|
|
test_symlink to/links/file2
|
|
test_regular to/links/unsafefile
|