blob: fabfa4983704e849298a5593a3c33c7bc3dc42b2 [file] [log] [blame]
Darren Tucker59d928d2013-05-17 15:32:29 +10001# $OpenBSD: ssh-com-sftp.sh,v 1.7 2013/05/17 04:29:14 dtucker Exp $
Damien Miller38cd4352002-05-01 13:17:33 +10002# Placed in the Public Domain.
3
4tid="basic sftp put/get with ssh.com server"
5
Darren Tuckerbd056092003-09-04 15:26:57 +10006SFTPCMDFILE=${OBJ}/batch
7
8cat >$SFTPCMDFILE <<EOF
9version
10get $DATA ${COPY}.1
11put $DATA ${COPY}.2
12EOF
Damien Miller38cd4352002-05-01 13:17:33 +100013
14BUFFERSIZE="5 1000 32000 64000"
15REQUESTS="1 2 10"
16
17#TEST_COMBASE=/path/to/ssh/com/binaries
18if [ "X${TEST_COMBASE}" = "X" ]; then
19 fatal '$TEST_COMBASE is not set'
20fi
21
22VERSIONS="
23 2.0.10
24 2.0.12
25 2.0.13
26 2.1.0
27 2.2.0
28 2.3.0
29 2.3.1
30 2.4.0
31 3.0.0
Damien Miller8b9cde72003-01-22 17:53:16 +110032 3.1.0
33 3.2.0
Darren Tuckeree5f83d2003-06-18 22:36:48 +100034 3.2.2
35 3.2.3
Darren Tucker437a5f02004-02-29 20:33:51 +110036 3.2.5
37 3.2.9
38 3.2.9.1
Damien Miller8b9cde72003-01-22 17:53:16 +110039 3.3.0"
Damien Miller38cd4352002-05-01 13:17:33 +100040
41# go for it
42for v in ${VERSIONS}; do
43 server=${TEST_COMBASE}/${v}/sftp-server2
44 if [ ! -x ${server} ]; then
45 continue
46 fi
47 verbose "sftp-server $v"
48 for B in ${BUFFERSIZE}; do
49 for R in ${REQUESTS}; do
50 verbose "test $tid: buffer_size $B num_requests $R"
51 rm -f ${COPY}.1 ${COPY}.2
Darren Tuckerc8638952009-10-07 10:46:29 +110052 ${SFTP} -D ${server} -B $B -R $R -b $SFTPCMDFILE \
Darren Tuckerbd056092003-09-04 15:26:57 +100053 > /dev/null 2>&1
Damien Miller38cd4352002-05-01 13:17:33 +100054 r=$?
55 if [ $r -ne 0 ]; then
56 fail "sftp failed with $r"
Darren Tuckerbd056092003-09-04 15:26:57 +100057 else
58 cmp $DATA ${COPY}.1 || fail "corrupted copy after get"
59 cmp $DATA ${COPY}.2 || fail "corrupted copy after put"
Damien Miller38cd4352002-05-01 13:17:33 +100060 fi
Damien Miller38cd4352002-05-01 13:17:33 +100061 done
62 done
63done
Darren Tuckerbd056092003-09-04 15:26:57 +100064rm -f ${COPY}.1 ${COPY}.2
65rm -f $SFTPCMDFILE