Commit | Line | Data |
---|---|---|
3cd2af41 MP |
1 | #! /bin/sh |
2 | ||
3 | # Copyright (C) 2001 by Martin Pool <mbp@samba.org> | |
4 | ||
5 | # This program is distributable under the terms of the GNU GPL (see | |
6 | # COPYING). | |
7 | ||
8 | # Test rsync's somewhat over-featured symlink control: the default | |
9 | # behaviour is that symlinks should not be copied at all. | |
10 | ||
e920830e | 11 | . "$suitedir/rsync.fns" |
3cd2af41 | 12 | |
c45f3133 | 13 | build_symlinks || test_fail "failed to build symlinks" |
3cd2af41 MP |
14 | |
15 | # Copy recursively, but without -l or -L or -a, and all the symlinks | |
16 | # should be missing. | |
06464f55 | 17 | $RSYNC -r "$fromdir/" "$todir" || test_fail "$RSYNC returned $?" |
3cd2af41 | 18 | |
e920830e WD |
19 | [ -f "$todir/referent" ] || test_fail "referent was not copied" |
20 | [ -d "$todir/from" ] && test_fail "extra level of directories" | |
21 | if is_a_link "$todir/dangling" | |
78ece130 MP |
22 | then |
23 | test_fail "dangling symlink was copied" | |
24 | fi | |
25 | ||
e920830e | 26 | if is_a_link "$todir/relative" |
78ece130 MP |
27 | then |
28 | test_fail "relative symlink was copied" | |
29 | fi | |
30 | ||
e920830e | 31 | if is_a_link "$todir/absolute" |
78ece130 MP |
32 | then |
33 | test_fail "absolute symlink was copied" | |
34 | fi | |
60514d45 | 35 | |
05118158 | 36 | # The script would have aborted on error, so getting here means we've won. |
60514d45 | 37 | exit 0 |