]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - crypto/openssh/regress/sftp.sh
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / crypto / openssh / regress / sftp.sh
1 #       $OpenBSD: sftp.sh,v 1.5 2013/05/17 10:28:11 dtucker Exp $
2 #       Placed in the Public Domain.
3
4 tid="basic sftp put/get"
5
6 SFTPCMDFILE=${OBJ}/batch
7 cat >$SFTPCMDFILE <<EOF
8 version
9 get $DATA ${COPY}.1
10 put $DATA ${COPY}.2
11 EOF
12
13 BUFFERSIZE="5 1000 32000 64000"
14 REQUESTS="1 2 10"
15
16 for B in ${BUFFERSIZE}; do
17         for R in ${REQUESTS}; do
18                 verbose "test $tid: buffer_size $B num_requests $R"
19                 rm -f ${COPY}.1 ${COPY}.2
20                 ${SFTP} -D ${SFTPSERVER} -B $B -R $R -b $SFTPCMDFILE \
21                 > /dev/null 2>&1
22                 r=$?
23                 if [ $r -ne 0 ]; then
24                         fail "sftp failed with $r"
25                 else 
26                         cmp $DATA ${COPY}.1 || fail "corrupted copy after get"
27                         cmp $DATA ${COPY}.2 || fail "corrupted copy after put"
28                 fi
29         done
30 done
31 rm -f ${COPY}.1 ${COPY}.2                
32 rm -f $SFTPCMDFILE