blob: b8e9f752791a58ab270dff11ca9ea87a15cf4d26 [file] [log] [blame]
Darren Tucker98989eb2013-05-17 20:44:09 +10001# $OpenBSD: sftp.sh,v 1.5 2013/05/17 10:28:11 dtucker Exp $
Damien Miller38cd4352002-05-01 13:17:33 +10002# Placed in the Public Domain.
3
4tid="basic sftp put/get"
5
Darren Tuckere15b0dd2003-09-04 15:00:55 +10006SFTPCMDFILE=${OBJ}/batch
7cat >$SFTPCMDFILE <<EOF
8version
9get $DATA ${COPY}.1
10put $DATA ${COPY}.2
11EOF
12
Damien Miller38cd4352002-05-01 13:17:33 +100013BUFFERSIZE="5 1000 32000 64000"
14REQUESTS="1 2 10"
15
16for B in ${BUFFERSIZE}; do
17 for R in ${REQUESTS}; do
18 verbose "test $tid: buffer_size $B num_requests $R"
Darren Tuckered6b0c52009-10-07 10:43:57 +110019 rm -f ${COPY}.1 ${COPY}.2
20 ${SFTP} -D ${SFTPSERVER} -B $B -R $R -b $SFTPCMDFILE \
Darren Tuckere15b0dd2003-09-04 15:00:55 +100021 > /dev/null 2>&1
Damien Miller38cd4352002-05-01 13:17:33 +100022 r=$?
23 if [ $r -ne 0 ]; then
24 fail "sftp failed with $r"
Darren Tuckere15b0dd2003-09-04 15:00:55 +100025 else
26 cmp $DATA ${COPY}.1 || fail "corrupted copy after get"
27 cmp $DATA ${COPY}.2 || fail "corrupted copy after put"
Damien Miller38cd4352002-05-01 13:17:33 +100028 fi
Damien Miller38cd4352002-05-01 13:17:33 +100029 done
30done
Darren Tuckere15b0dd2003-09-04 15:00:55 +100031rm -f ${COPY}.1 ${COPY}.2
32rm -f $SFTPCMDFILE