summaryrefslogtreecommitdiff
path: root/regress/ssh-com-sftp.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/ssh-com-sftp.sh')
-rw-r--r--regress/ssh-com-sftp.sh28
1 files changed, 18 insertions, 10 deletions
diff --git a/regress/ssh-com-sftp.sh b/regress/ssh-com-sftp.sh
index f08018b84..6ca7dad51 100644
--- a/regress/ssh-com-sftp.sh
+++ b/regress/ssh-com-sftp.sh
@@ -1,10 +1,17 @@
1# $OpenBSD: ssh-com-sftp.sh,v 1.3 2002/07/16 08:58:16 markus Exp $ 1# $OpenBSD: ssh-com-sftp.sh,v 1.4 2003/05/14 22:08:27 markus Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="basic sftp put/get with ssh.com server" 4tid="basic sftp put/get with ssh.com server"
5 5
6DATA=/bin/ls 6DATA=/bin/ls${EXEEXT}
7COPY=${OBJ}/copy 7COPY=${OBJ}/copy
8SFTPCMDFILE=${OBJ}/batch
9
10cat >$SFTPCMDFILE <<EOF
11version
12get $DATA ${COPY}.1
13put $DATA ${COPY}.2
14EOF
8 15
9BUFFERSIZE="5 1000 32000 64000" 16BUFFERSIZE="5 1000 32000 64000"
10REQUESTS="1 2 10" 17REQUESTS="1 2 10"
@@ -26,6 +33,8 @@ VERSIONS="
26 3.0.0 33 3.0.0
27 3.1.0 34 3.1.0
28 3.2.0 35 3.2.0
36 3.2.2
37 3.2.3
29 3.3.0" 38 3.3.0"
30 39
31# go for it 40# go for it
@@ -39,18 +48,17 @@ for v in ${VERSIONS}; do
39 for R in ${REQUESTS}; do 48 for R in ${REQUESTS}; do
40 verbose "test $tid: buffer_size $B num_requests $R" 49 verbose "test $tid: buffer_size $B num_requests $R"
41 rm -f ${COPY}.1 ${COPY}.2 50 rm -f ${COPY}.1 ${COPY}.2
42 ${SFTP} -P ${server} -B $B -R $R -b /dev/stdin \ 51 ${SFTP} -P ${server} -B $B -R $R -b $SFTPCMDFILE \
43 > /dev/null 2>&1 << EOF 52 > /dev/null 2>&1
44 version
45 get $DATA ${COPY}.1
46 put $DATA ${COPY}.2
47EOF
48 r=$? 53 r=$?
49 if [ $r -ne 0 ]; then 54 if [ $r -ne 0 ]; then
50 fail "sftp failed with $r" 55 fail "sftp failed with $r"
56 else
57 cmp $DATA ${COPY}.1 || fail "corrupted copy after get"
58 cmp $DATA ${COPY}.2 || fail "corrupted copy after put"
51 fi 59 fi
52 cmp $DATA ${COPY}.1 || fail "corrupted copy after get"
53 cmp $DATA ${COPY}.2 || fail "corrupted copy after put"
54 done 60 done
55 done 61 done
56done 62done
63rm -f ${COPY}.1 ${COPY}.2
64rm -f $SFTPCMDFILE