File: ssh-basic.test

package info (click to toggle)
rsync 3.4.1%2Bds1-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,388 kB
  • sloc: ansic: 35,682; sh: 6,538; python: 1,759; asm: 829; perl: 479; makefile: 365; cpp: 298; awk: 191
file content (34 lines) | stat: -rw-r--r-- 1,012 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh

# Copyright (C) 1998,1999 Philip Hands <phil@hands.com>
# Copyright (C) 2001 by Martin Pool <mbp@samba.org>

# This program is distributable under the terms of the GNU GPL (see
# COPYING)

# This script tests ssh, if possible.  It's called by runtests.sh

. "$suitedir/rsync.fns"

SSH="$scratchdir/src/support/lsh.sh"

if test x"$rsync_enable_ssh_tests" = xyes; then
    if type ssh >/dev/null; then
	SSH=ssh
    fi
fi

if [ "`$SSH -o'BatchMode yes' localhost echo yes`" != "yes" ]; then
    test_skipped "Skipping SSH tests because ssh connection to localhost not authorised"
fi

echo "Using remote shell: $SSH"

# Create some files for rsync to copy
hands_setup

runtest "ssh: basic test" 'checkit "$RSYNC -avH -e \"$SSH\" --rsync-path=\"$RSYNC\" \"$fromdir/\" \"localhost:$todir\"" "$fromdir/" "$todir"'

mv "$todir/text" "$todir/ThisShouldGo"

runtest "ssh: renamed file" 'checkit "$RSYNC --delete -avH -e \"$SSH\" --rsync-path=\"$RSYNC\" \"$fromdir/\" \"localhost:$todir\"" "$fromdir/" "$todir"'