Fixed the interaction of --fake-super with --link-dest & --xattrs.
[rsync/rsync.git] / testsuite / ssh-basic.test
... / ...
CommitLineData
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
13SSH="$scratchdir/pretend-ssh"
14
15cat >"$SSH" <<'EOT'
16while : ; do
17 case "$1" in
18 -*) shift ;;
19 localhost) shift; break ;;
20 *) exit 1 ;;
21 esac
22done
23
24eval "${@}"
25EOT
26chmod +x "$SSH"
27
28if test x"$rsync_enable_ssh_tests" = xyes; then
29 if type ssh >/dev/null ; then
30 SSH=ssh
31 fi
32fi
33
34if ! [ "`"$SSH" -o'BatchMode yes' localhost echo yes`" = "yes" ]; then
35 test_skipped "Skipping SSH tests because ssh conection to localhost not authorised"
36fi
37
38echo "Using remote shell: $SSH"
39
40# Create some files for rsync to copy
41hands_setup
42
43runtest "ssh: basic test" 'checkit "$RSYNC -avH -e \"$SSH\" --rsync-path=\"$RSYNC\" \"$fromdir/\" \"localhost:$todir\"" "$fromdir/" "$todir"'
44
45mv "$todir/text" "$todir/ThisShouldGo"
46
47runtest "ssh: renamed file" 'checkit "$RSYNC --delete -avH -e \"$SSH\" --rsync-path=\"$RSYNC\" \"$fromdir/\" \"localhost:$todir\"" "$fromdir/" "$todir"'