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