1# $OpenBSD: ssh-com-sftp.sh,v 1.5 2004/02/24 17:06:52 markus Exp $ 2# Placed in the Public Domain. 3 4tid="basic sftp put/get with ssh.com server" 5 6DATA=/bin/ls${EXEEXT} 7COPY=${OBJ}/copy 8SFTPCMDFILE=${OBJ}/batch 9 10cat >$SFTPCMDFILE <<EOF 11version 12get $DATA ${COPY}.1 13put $DATA ${COPY}.2 14EOF 15 16BUFFERSIZE="5 1000 32000 64000" 17REQUESTS="1 2 10" 18 19#TEST_COMBASE=/path/to/ssh/com/binaries 20if [ "X${TEST_COMBASE}" = "X" ]; then 21 fatal '$TEST_COMBASE is not set' 22fi 23 24VERSIONS=" 25 2.0.10 26 2.0.12 27 2.0.13 28 2.1.0 29 2.2.0 30 2.3.0 31 2.3.1 32 2.4.0 33 3.0.0 34 3.1.0 35 3.2.0 36 3.2.2 37 3.2.3 38 3.2.5 39 3.2.9 40 3.2.9.1 41 3.3.0" 42 43# go for it 44for v in ${VERSIONS}; do 45 server=${TEST_COMBASE}/${v}/sftp-server2 46 if [ ! -x ${server} ]; then 47 continue 48 fi 49 verbose "sftp-server $v" 50 for B in ${BUFFERSIZE}; do 51 for R in ${REQUESTS}; do 52 verbose "test $tid: buffer_size $B num_requests $R" 53 rm -f ${COPY}.1 ${COPY}.2 54 ${SFTP} -P ${server} -B $B -R $R -b $SFTPCMDFILE \ 55 > /dev/null 2>&1 56 r=$? 57 if [ $r -ne 0 ]; then 58 fail "sftp failed with $r" 59 else 60 cmp $DATA ${COPY}.1 || fail "corrupted copy after get" 61 cmp $DATA ${COPY}.2 || fail "corrupted copy after put" 62 fi 63 done 64 done 65done 66rm -f ${COPY}.1 ${COPY}.2 67rm -f $SFTPCMDFILE 68