xref: /freebsd/crypto/openssh/regress/transfer.sh (revision 3a92d97ff0f22d21608e1c19b83104c4937523b6)
1#	$OpenBSD: transfer.sh,v 1.2 2013/05/17 04:29:14 dtucker Exp $
2#	Placed in the Public Domain.
3
4tid="transfer data"
5
6for p in 1 2; do
7	verbose "$tid: proto $p"
8	rm -f ${COPY}
9	${SSH} -n -q -$p -F $OBJ/ssh_proxy somehost cat ${DATA} > ${COPY}
10	if [ $? -ne 0 ]; then
11		fail "ssh cat $DATA failed"
12	fi
13	cmp ${DATA} ${COPY}		|| fail "corrupted copy"
14
15	for s in 10 100 1k 32k 64k 128k 256k; do
16		trace "proto $p dd-size ${s}"
17		rm -f ${COPY}
18		dd if=$DATA obs=${s} 2> /dev/null | \
19			${SSH} -q -$p -F $OBJ/ssh_proxy somehost "cat > ${COPY}"
20		if [ $? -ne 0 ]; then
21			fail "ssh cat $DATA failed"
22		fi
23		cmp $DATA ${COPY}		|| fail "corrupted copy"
24	done
25done
26rm -f ${COPY}
27