Damien Miller | af78493 | 2008-03-13 00:17:00 +1100 | [diff] [blame] | 1 | # $OpenBSD: putty-transfer.sh,v 1.1 2007/12/21 04:13:53 djm Exp $ |
| 2 | # Placed in the Public Domain. |
| 3 | |
| 4 | tid="putty transfer data" |
| 5 | |
| 6 | DATA=/bin/ls |
| 7 | COPY=${OBJ}/copy |
| 8 | |
| 9 | set -e |
| 10 | |
| 11 | if test "x$REGRESS_INTEROP_PUTTY" != "xyes" ; then |
| 12 | fatal "putty interop tests not enabled" |
| 13 | fi |
| 14 | |
| 15 | # XXX support protocol 1 too |
| 16 | for p in 2; do |
| 17 | for c in 0 1 ; do |
| 18 | verbose "$tid: proto $p compression $c" |
| 19 | rm -f ${COPY} |
| 20 | cp ${OBJ}/.putty/sessions/localhost_proxy \ |
| 21 | ${OBJ}/.putty/sessions/compression_$c |
| 22 | echo "Compression=$c" >> ${OBJ}/.putty/sessions/kex_$k |
| 23 | env HOME=$PWD ${PLINK} -load compression_$c -batch \ |
| 24 | -i putty.rsa$p 127.0.0.1 cat ${DATA} > ${COPY} |
| 25 | if [ $? -ne 0 ]; then |
| 26 | fail "ssh cat $DATA failed" |
| 27 | fi |
| 28 | cmp ${DATA} ${COPY} || fail "corrupted copy" |
| 29 | |
| 30 | for s in 10 100 1k 32k 64k 128k 256k; do |
| 31 | trace "proto $p compression $c dd-size ${s}" |
| 32 | rm -f ${COPY} |
| 33 | dd if=$DATA obs=${s} 2> /dev/null | \ |
| 34 | env HOME=$PWD ${PLINK} -load compression_$c \ |
| 35 | -batch -i putty.rsa$p 127.0.0.1 \ |
| 36 | "cat > ${COPY}" |
| 37 | if [ $? -ne 0 ]; then |
| 38 | fail "ssh cat $DATA failed" |
| 39 | fi |
| 40 | cmp $DATA ${COPY} || fail "corrupted copy" |
| 41 | done |
| 42 | done |
| 43 | done |
| 44 | rm -f ${COPY} |
| 45 | |