summaryrefslogtreecommitdiff
path: root/regress/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/sftp.sh
parent2f09289e741582871ff068f8697b924a257fb703 (diff)
- (djm) Import OpenBSD regression tests. Requires BSD make to run
Diffstat (limited to 'regress/sftp.sh')
-rw-r--r--regress/sftp.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/regress/sftp.sh b/regress/sftp.sh
new file mode 100644
index 000000000..e8d473123
--- /dev/null
+++ b/regress/sftp.sh
@@ -0,0 +1,29 @@
1# $OpenBSD: sftp.sh,v 1.2 2002/03/27 22:39:52 markus Exp $
2# Placed in the Public Domain.
3
4tid="basic sftp put/get"
5
6DATA=/bin/ls
7COPY=${OBJ}/copy
8
9BUFFERSIZE="5 1000 32000 64000"
10REQUESTS="1 2 10"
11
12for B in ${BUFFERSIZE}; do
13 for R in ${REQUESTS}; do
14 verbose "test $tid: buffer_size $B num_requests $R"
15 rm -f ${COPY}.1 ${COPY}.2
16 ${SFTP} -P ${SFTPSERVER} -B $B -R $R -b /dev/stdin \
17 > /dev/null 2>&1 << EOF
18 version
19 get $DATA ${COPY}.1
20 put $DATA ${COPY}.2
21EOF
22 r=$?
23 if [ $r -ne 0 ]; then
24 fail "sftp failed with $r"
25 fi
26 cmp $DATA ${COPY}.1 || fail "corrupted copy after get"
27 cmp $DATA ${COPY}.2 || fail "corrupted copy after put"
28 done
29done