blob: 4928d4533f6b628388306552b379e8251c02a9af [file] [log] [blame]
djm@openbsd.org73282b62018-02-23 03:03:00 +00001# $OpenBSD: putty-transfer.sh,v 1.6 2018/02/23 03:03:00 djm 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
djm@openbsd.orgdd369322017-04-30 23:34:55 +000011for c in 0 1 ; do
12 verbose "$tid: compression $c"
13 rm -f ${COPY}
14 cp ${OBJ}/.putty/sessions/localhost_proxy \
15 ${OBJ}/.putty/sessions/compression_$c
16 echo "Compression=$c" >> ${OBJ}/.putty/sessions/kex_$k
17 env HOME=$PWD ${PLINK} -load compression_$c -batch \
Darren Tuckerb5974de2018-03-23 13:21:14 +110018 -i ${OBJ}/putty.rsa2 cat ${DATA} > ${COPY}
djm@openbsd.orgdd369322017-04-30 23:34:55 +000019 if [ $? -ne 0 ]; then
20 fail "ssh cat $DATA failed"
21 fi
22 cmp ${DATA} ${COPY} || fail "corrupted copy"
23
24 for s in 10 100 1k 32k 64k 128k 256k; do
25 trace "compression $c dd-size ${s}"
Damien Milleraf784932008-03-13 00:17:00 +110026 rm -f ${COPY}
djm@openbsd.orgdd369322017-04-30 23:34:55 +000027 dd if=$DATA obs=${s} 2> /dev/null | \
28 env HOME=$PWD ${PLINK} -load compression_$c \
Darren Tuckerb5974de2018-03-23 13:21:14 +110029 -batch -i ${OBJ}/putty.rsa2 \
djm@openbsd.orgdd369322017-04-30 23:34:55 +000030 "cat > ${COPY}"
Damien Milleraf784932008-03-13 00:17:00 +110031 if [ $? -ne 0 ]; then
32 fail "ssh cat $DATA failed"
33 fi
djm@openbsd.orgdd369322017-04-30 23:34:55 +000034 cmp $DATA ${COPY} || fail "corrupted copy"
Damien Milleraf784932008-03-13 00:17:00 +110035 done
36done
37rm -f ${COPY}
38