blob: aec0e04ee74433ad1bc32271cc697b3193933f8b [file] [log] [blame]
Darren Tucker59d928d2013-05-17 15:32:29 +10001# $OpenBSD: putty-transfer.sh,v 1.3 2013/05/17 04:29:14 dtucker Exp $
Damien Milleraf784932008-03-13 00:17:00 +11002# Placed in the Public Domain.
3
4tid="putty transfer data"
5
Damien Milleraf784932008-03-13 00:17:00 +11006if test "x$REGRESS_INTEROP_PUTTY" != "xyes" ; then
Damien Miller3f94aaf2009-02-16 15:21:39 +11007 echo "putty interop tests not enabled"
8 exit 0
Damien Milleraf784932008-03-13 00:17:00 +11009fi
10
11# XXX support protocol 1 too
12for 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
39done
40rm -f ${COPY}
41