Commit | Line | Data |
---|---|---|
3fedd74b MP |
1 | #!/bin/sh |
2 | ||
3 | # Copyright (C) 1998,1999 Philip Hands <phil@hands.com> | |
4 | # Copyright (C) 2001 by Martin Pool <mbp@samba.org> | |
5 | ||
6 | # This program is distributable under the terms of the GNU GPL (see | |
7 | # COPYING) | |
8 | ||
9 | # This script tests ssh, if possible. It's called by runtests.sh | |
10 | ||
11 | . "$suitedir/rsync.fns" | |
12 | ||
55bdb416 MP |
13 | if [ "x$rsync_enable_ssh_tests" != xyes ] |
14 | then | |
79c9d8a1 | 15 | test_skipped "Skipping SSH tests because \$rsync_enable_ssh_tests is not set" |
55bdb416 MP |
16 | fi |
17 | ||
9d682a8d | 18 | if ! type ssh >/dev/null ; then |
79c9d8a1 | 19 | test_skipped "Skipping SSH tests because ssh is not in the path" |
3fedd74b MP |
20 | fi |
21 | ||
9d682a8d | 22 | if ! [ "`ssh -o'BatchMode yes' localhost echo yes`" = "yes" ]; then |
79c9d8a1 | 23 | test_skipped "Skipping SSH tests because ssh conection to localhost not authorised" |
3fedd74b MP |
24 | fi |
25 | ||
5702bc12 | 26 | # Added by Steve Bonds Feb 2 2003 |
8624daa7 | 27 | # Without this, there are no files in the $fromdir directory, so rsync has |
5702bc12 PG |
28 | # nothing to do. |
29 | hands_setup | |
30 | ||
8624daa7 | 31 | runtest "ssh: basic test" 'checkit "$RSYNC -avH -e ssh --rsync-path=$RSYNC \"$fromdir/\" \"localhost:$todir\"" "$fromdir/" "$todir"' |
3fedd74b | 32 | |
5702bc12 PG |
33 | # Added by Steve Bonds Feb 2 2003 |
34 | # I assumed that "F1" was intended to hold a single file for testing if | |
35 | # rsync could detect a renamed file over ssh. Without this line below | |
36 | # it was unset so the "mv" tried to move a parent directory into a | |
37 | # subdirectory of itself. There is probably a better way of pulling out | |
38 | # a sample file to rename. | |
8624daa7 | 39 | F1=`ls "$todir" | head -5 | tail -1` |
5702bc12 | 40 | |
8624daa7 | 41 | mv "$todir/$F1" "$todir/ThisShouldGo" |
3fedd74b | 42 | |
8624daa7 | 43 | runtest "ssh: renamed file" 'checkit "$RSYNC --delete -avH -e ssh --rsync-path=$RSYNC \"$fromdir/\" \"localhost:$todir\"" "$fromdir/" "$todir"' |