If tests are skipped, explain why.
[rsync/rsync.git] / testsuite / ssh-basic.test
CommitLineData
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
13if [ "x$rsync_enable_ssh_tests" != xyes ]
14then
f5ad6eb1 15 echo "Skipping SSH tests because \$rsync_enable_ssh_tests is not set"
55bdb416
MP
16 exit 77
17fi
18
9d682a8d 19if ! type ssh >/dev/null ; then
3fedd74b
MP
20 echo "Skipping SSH tests because ssh is not in the path"
21 exit 77
22fi
23
9d682a8d 24if ! [ "`ssh -o'BatchMode yes' localhost echo yes`" = "yes" ]; then
3fedd74b
MP
25 echo "Skipping SSH tests because ssh conection to localhost not authorised"
26 exit 77
27fi
28
29runtest "ssh: basic test" 'checkit "$RSYNC -avH -e ssh --rsync-path=$RSYNC ${FROM}/ localhost:${TO}" ${FROM}/ ${TO}'
30
31mv ${TO}/${F1} ${TO}/ThisShouldGo
32
33runtest "ssh: renamed file" 'checkit "$RSYNC --delete -avH -e ssh --rsync-path=$RSYNC ${FROM}/ localhost:${TO}" ${FROM}/ ${TO}'