summaryrefslogtreecommitdiff
path: root/regress/usr.bin/ssh/ssh-com-sftp.sh
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2002-04-01 22:15:09 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2002-04-01 22:15:09 +0000
commitcfa68422dd027476309a783a2d563bafee8d24fb (patch)
treea76fe6032a719e637d83a08d184bb441879d2e5c /regress/usr.bin/ssh/ssh-com-sftp.sh
parente9935e63086cc39022a1b657d5062d7f33765768 (diff)
sftp interop w/ ssh.com servers
Diffstat (limited to 'regress/usr.bin/ssh/ssh-com-sftp.sh')
-rw-r--r--regress/usr.bin/ssh/ssh-com-sftp.sh61
1 files changed, 61 insertions, 0 deletions
diff --git a/regress/usr.bin/ssh/ssh-com-sftp.sh b/regress/usr.bin/ssh/ssh-com-sftp.sh
new file mode 100644
index 00000000000..7350960f0b1
--- /dev/null
+++ b/regress/usr.bin/ssh/ssh-com-sftp.sh
@@ -0,0 +1,61 @@
+# $OpenBSD: ssh-com-sftp.sh,v 1.1 2002/04/01 22:15:08 markus Exp $
+# Placed in the Public Domain.
+
+tid="basic sftp put/get with ssh.com server"
+
+DATA=/bin/ls
+COPY=${OBJ}/copy
+
+BUFFERSIZE="5 1000 32000 64000"
+REQUESTS="1 2 10"
+
+#TEST_COMBASE=/path/to/ssh/com/binaries
+if [ "X${TEST_COMBASE}" = "X" ]; then
+ fatal '$TEST_COMBASE is not set'
+fi
+
+VERSIONS="
+ 2.0.10
+ 2.0.12
+ 2.0.13
+ 2.1.0
+ 2.2.0
+ 2.3.0
+ 2.3.1
+ 2.4.0
+ 3.0.0
+ 3.1.0"
+
+# go for it
+for v in ${VERSIONS}; do
+ server=${TEST_COMBASE}/${v}/sftp-server2
+ if [ ! -x ${server} ]; then
+ continue
+ fi
+ verbose "sftp-server $v"
+ for B in ${BUFFERSIZE}; do
+ if [ $B -ge 32000 ] ; then
+ case $v in
+ 2.0.1[012])
+ echo continue
+ ;;
+ esac
+ fi
+ for R in ${REQUESTS}; do
+ verbose "test $tid: buffer_size $B num_requests $R"
+ rm -f ${COPY}.1 ${COPY}.2
+ ${SFTP} -P ${server} -B $B -R $R -b /dev/stdin \
+ > /dev/null 2>&1 << EOF
+ version
+ get $DATA ${COPY}.1
+ put $DATA ${COPY}.2
+EOF
+ r=$?
+ if [ $r -ne 0 ]; then
+ fail "sftp failed with $r"
+ fi
+ cmp $DATA ${COPY}.1 || fail "corrupted copy after get"
+ cmp $DATA ${COPY}.2 || fail "corrupted copy after put"
+ done
+ done
+done