xref: /freebsd/crypto/openssh/regress/transfer.sh (revision 4f52dfbb8d6c4d446500c5b097e3806ec219fbd4)
1*4f52dfbbSDag-Erling Smørgrav#	$OpenBSD: transfer.sh,v 1.4 2017/04/30 23:34:55 djm Exp $
2ce3adf43SDag-Erling Smørgrav#	Placed in the Public Domain.
3ce3adf43SDag-Erling Smørgrav
4ce3adf43SDag-Erling Smørgravtid="transfer data"
5ce3adf43SDag-Erling Smørgrav
6ce3adf43SDag-Erling Smørgravrm -f ${COPY}
7*4f52dfbbSDag-Erling Smørgrav${SSH} -n -q -F $OBJ/ssh_proxy somehost cat ${DATA} > ${COPY}
8ce3adf43SDag-Erling Smørgravif [ $? -ne 0 ]; then
9ce3adf43SDag-Erling Smørgrav	fail "ssh cat $DATA failed"
10ce3adf43SDag-Erling Smørgravfi
11ce3adf43SDag-Erling Smørgravcmp ${DATA} ${COPY}		|| fail "corrupted copy"
12ce3adf43SDag-Erling Smørgrav
13ce3adf43SDag-Erling Smørgravfor s in 10 100 1k 32k 64k 128k 256k; do
14*4f52dfbbSDag-Erling Smørgrav	trace "dd-size ${s}"
15ce3adf43SDag-Erling Smørgrav	rm -f ${COPY}
16ce3adf43SDag-Erling Smørgrav	dd if=$DATA obs=${s} 2> /dev/null | \
17*4f52dfbbSDag-Erling Smørgrav		${SSH} -q -F $OBJ/ssh_proxy somehost "cat > ${COPY}"
18ce3adf43SDag-Erling Smørgrav	if [ $? -ne 0 ]; then
19ce3adf43SDag-Erling Smørgrav		fail "ssh cat $DATA failed"
20ce3adf43SDag-Erling Smørgrav	fi
21ce3adf43SDag-Erling Smørgrav	cmp $DATA ${COPY}		|| fail "corrupted copy"
22ce3adf43SDag-Erling Smørgravdone
23ce3adf43SDag-Erling Smørgravrm -f ${COPY}
24