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