summaryrefslogtreecommitdiff
path: root/regress/ssh-com-sftp.sh
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-05-01 13:17:33 +1000
committerDamien Miller <djm@mindrot.org>2002-05-01 13:17:33 +1000
commit38cd4358921bd674cace17d6bae71143b716027d (patch)
tree6c5a048f13a0a413821bf75b8ad1346b7408447a /regress/ssh-com-sftp.sh
parent2f09289e741582871ff068f8697b924a257fb703 (diff)
- (djm) Import OpenBSD regression tests. Requires BSD make to run
Diffstat (limited to 'regress/ssh-com-sftp.sh')
-rw-r--r--regress/ssh-com-sftp.sh54
1 files changed, 54 insertions, 0 deletions
diff --git a/regress/ssh-com-sftp.sh b/regress/ssh-com-sftp.sh
new file mode 100644
index 000000000..231efa132
--- /dev/null
+++ b/regress/ssh-com-sftp.sh
@@ -0,0 +1,54 @@
1# $OpenBSD: ssh-com-sftp.sh,v 1.2 2002/04/10 08:45:30 markus Exp $
2# Placed in the Public Domain.
3
4tid="basic sftp put/get with ssh.com server"
5
6DATA=/bin/ls
7COPY=${OBJ}/copy
8
9BUFFERSIZE="5 1000 32000 64000"
10REQUESTS="1 2 10"
11
12#TEST_COMBASE=/path/to/ssh/com/binaries
13if [ "X${TEST_COMBASE}" = "X" ]; then
14 fatal '$TEST_COMBASE is not set'
15fi
16
17VERSIONS="
18 2.0.10
19 2.0.12
20 2.0.13
21 2.1.0
22 2.2.0
23 2.3.0
24 2.3.1
25 2.4.0
26 3.0.0
27 3.1.0"
28
29# go for it
30for v in ${VERSIONS}; do
31 server=${TEST_COMBASE}/${v}/sftp-server2
32 if [ ! -x ${server} ]; then
33 continue
34 fi
35 verbose "sftp-server $v"
36 for B in ${BUFFERSIZE}; do
37 for R in ${REQUESTS}; do
38 verbose "test $tid: buffer_size $B num_requests $R"
39 rm -f ${COPY}.1 ${COPY}.2
40 ${SFTP} -P ${server} -B $B -R $R -b /dev/stdin \
41 > /dev/null 2>&1 << EOF
42 version
43 get $DATA ${COPY}.1
44 put $DATA ${COPY}.2
45EOF
46 r=$?
47 if [ $r -ne 0 ]; then
48 fail "sftp failed with $r"
49 fi
50 cmp $DATA ${COPY}.1 || fail "corrupted copy after get"
51 cmp $DATA ${COPY}.2 || fail "corrupted copy after put"
52 done
53 done
54done