summaryrefslogtreecommitdiff
path: root/regress/sftp.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/sftp.sh')
-rw-r--r--regress/sftp.sh26
1 files changed, 16 insertions, 10 deletions
diff --git a/regress/sftp.sh b/regress/sftp.sh
index e8d473123..0e22f8f6b 100644
--- a/regress/sftp.sh
+++ b/regress/sftp.sh
@@ -3,27 +3,33 @@
3 3
4tid="basic sftp put/get" 4tid="basic sftp put/get"
5 5
6DATA=/bin/ls 6DATA=/bin/ls${EXEEXT}
7COPY=${OBJ}/copy 7COPY=${OBJ}/copy
8 8
9SFTPCMDFILE=${OBJ}/batch
10cat >$SFTPCMDFILE <<EOF
11version
12get $DATA ${COPY}.1
13put $DATA ${COPY}.2
14EOF
15
9BUFFERSIZE="5 1000 32000 64000" 16BUFFERSIZE="5 1000 32000 64000"
10REQUESTS="1 2 10" 17REQUESTS="1 2 10"
11 18
12for B in ${BUFFERSIZE}; do 19for B in ${BUFFERSIZE}; do
13 for R in ${REQUESTS}; do 20 for R in ${REQUESTS}; do
14 verbose "test $tid: buffer_size $B num_requests $R" 21 verbose "test $tid: buffer_size $B num_requests $R"
15 rm -f ${COPY}.1 ${COPY}.2 22 rm -f ${COPY}.1 ${COPY}.2
16 ${SFTP} -P ${SFTPSERVER} -B $B -R $R -b /dev/stdin \ 23 ${SFTP} -P ${SFTPSERVER} -B $B -R $R -b $SFTPCMDFILE \
17 > /dev/null 2>&1 << EOF 24 > /dev/null 2>&1
18 version
19 get $DATA ${COPY}.1
20 put $DATA ${COPY}.2
21EOF
22 r=$? 25 r=$?
23 if [ $r -ne 0 ]; then 26 if [ $r -ne 0 ]; then
24 fail "sftp failed with $r" 27 fail "sftp failed with $r"
28 else
29 cmp $DATA ${COPY}.1 || fail "corrupted copy after get"
30 cmp $DATA ${COPY}.2 || fail "corrupted copy after put"
25 fi 31 fi
26 cmp $DATA ${COPY}.1 || fail "corrupted copy after get"
27 cmp $DATA ${COPY}.2 || fail "corrupted copy after put"
28 done 32 done
29done 33done
34rm -f ${COPY}.1 ${COPY}.2
35rm -f $SFTPCMDFILE