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