Darren Tucker | ee5f83d | 2003-06-18 22:36:48 +1000 | [diff] [blame^] | 1 | # $OpenBSD: ssh-com-sftp.sh,v 1.4 2003/05/14 22:08:27 markus Exp $ |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 2 | # Placed in the Public Domain. |
| 3 | |
| 4 | tid="basic sftp put/get with ssh.com server" |
| 5 | |
| 6 | DATA=/bin/ls |
| 7 | COPY=${OBJ}/copy |
| 8 | |
| 9 | BUFFERSIZE="5 1000 32000 64000" |
| 10 | REQUESTS="1 2 10" |
| 11 | |
| 12 | #TEST_COMBASE=/path/to/ssh/com/binaries |
| 13 | if [ "X${TEST_COMBASE}" = "X" ]; then |
| 14 | fatal '$TEST_COMBASE is not set' |
| 15 | fi |
| 16 | |
| 17 | VERSIONS=" |
| 18 | 2.0.10 |
| 19 | 2.0.12 |
| 20 | 2.0.13 |
| 21 | 2.1.0 |
| 22 | 2.2.0 |
| 23 | 2.3.0 |
| 24 | 2.3.1 |
| 25 | 2.4.0 |
| 26 | 3.0.0 |
Damien Miller | 8b9cde7 | 2003-01-22 17:53:16 +1100 | [diff] [blame] | 27 | 3.1.0 |
| 28 | 3.2.0 |
Darren Tucker | ee5f83d | 2003-06-18 22:36:48 +1000 | [diff] [blame^] | 29 | 3.2.2 |
| 30 | 3.2.3 |
Damien Miller | 8b9cde7 | 2003-01-22 17:53:16 +1100 | [diff] [blame] | 31 | 3.3.0" |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 32 | |
| 33 | # go for it |
| 34 | for v in ${VERSIONS}; do |
| 35 | server=${TEST_COMBASE}/${v}/sftp-server2 |
| 36 | if [ ! -x ${server} ]; then |
| 37 | continue |
| 38 | fi |
| 39 | verbose "sftp-server $v" |
| 40 | for B in ${BUFFERSIZE}; do |
| 41 | for R in ${REQUESTS}; do |
| 42 | verbose "test $tid: buffer_size $B num_requests $R" |
| 43 | rm -f ${COPY}.1 ${COPY}.2 |
| 44 | ${SFTP} -P ${server} -B $B -R $R -b /dev/stdin \ |
| 45 | > /dev/null 2>&1 << EOF |
| 46 | version |
| 47 | get $DATA ${COPY}.1 |
| 48 | put $DATA ${COPY}.2 |
| 49 | EOF |
| 50 | r=$? |
| 51 | if [ $r -ne 0 ]; then |
| 52 | fail "sftp failed with $r" |
| 53 | fi |
| 54 | cmp $DATA ${COPY}.1 || fail "corrupted copy after get" |
| 55 | cmp $DATA ${COPY}.2 || fail "corrupted copy after put" |
| 56 | done |
| 57 | done |
| 58 | done |