ssh-com-sftp.sh revision 180718
112694SHai-May.Chao@Sun.COM# $OpenBSD: ssh-com-sftp.sh,v 1.5 2004/02/24 17:06:52 markus Exp $ 212694SHai-May.Chao@Sun.COM# Placed in the Public Domain. 312694SHai-May.Chao@Sun.COM 412694SHai-May.Chao@Sun.COMtid="basic sftp put/get with ssh.com server" 512694SHai-May.Chao@Sun.COM 612694SHai-May.Chao@Sun.COMDATA=/bin/ls${EXEEXT} 712694SHai-May.Chao@Sun.COMCOPY=${OBJ}/copy 812694SHai-May.Chao@Sun.COMSFTPCMDFILE=${OBJ}/batch 912694SHai-May.Chao@Sun.COM 1012694SHai-May.Chao@Sun.COMcat >$SFTPCMDFILE <<EOF 1112694SHai-May.Chao@Sun.COMversion 1212694SHai-May.Chao@Sun.COMget $DATA ${COPY}.1 1312694SHai-May.Chao@Sun.COMput $DATA ${COPY}.2 1412694SHai-May.Chao@Sun.COMEOF 1512694SHai-May.Chao@Sun.COM 1612694SHai-May.Chao@Sun.COMBUFFERSIZE="5 1000 32000 64000" 1712694SHai-May.Chao@Sun.COMREQUESTS="1 2 10" 1812694SHai-May.Chao@Sun.COM 1912694SHai-May.Chao@Sun.COM#TEST_COMBASE=/path/to/ssh/com/binaries 2012694SHai-May.Chao@Sun.COMif [ "X${TEST_COMBASE}" = "X" ]; then 2112694SHai-May.Chao@Sun.COM fatal '$TEST_COMBASE is not set' 2212694SHai-May.Chao@Sun.COMfi 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