Handle new PATCH-$name files, improved $last_touch code,
[rsync.git] / testsuite / ssh-basic.test
blob7586ae5bd170ae62513db475af4e48274e7ed71a
1 #!/bin/sh
3 # Copyright (C) 1998,1999 Philip Hands <phil@hands.com>
4 # Copyright (C) 2001 by Martin Pool <mbp@samba.org>
6 # This program is distributable under the terms of the GNU GPL (see
7 # COPYING)
9 # This script tests ssh, if possible. It's called by runtests.sh
11 . "$suitedir/rsync.fns"
13 SSH="$scratchdir/pretend-ssh"
15 cat >"$SSH" <<'EOT'
16 while : ; do
17 case "$1" in
18 -*) shift ;;
19 localhost) shift; break ;;
20 *) exit 1 ;;
21 esac
22 done
24 eval "${@}"
25 EOT
26 chmod +x "$SSH"
28 if test x"$rsync_enable_ssh_tests" = xyes; then
29 if type ssh >/dev/null ; then
30 SSH=ssh
34 if ! [ "`"$SSH" -o'BatchMode yes' localhost echo yes`" = "yes" ]; then
35 test_skipped "Skipping SSH tests because ssh conection to localhost not authorised"
38 echo "Using remote shell: $SSH"
40 # Create some files for rsync to copy
41 hands_setup
43 runtest "ssh: basic test" 'checkit "$RSYNC -avH -e \"$SSH\" --rsync-path=\"$RSYNC\" \"$fromdir/\" \"localhost:$todir\"" "$fromdir/" "$todir"'
45 mv "$todir/text" "$todir/ThisShouldGo"
47 runtest "ssh: renamed file" 'checkit "$RSYNC --delete -avH -e \"$SSH\" --rsync-path=\"$RSYNC\" \"$fromdir/\" \"localhost:$todir\"" "$fromdir/" "$todir"'