Darren Tucker | 59d928d | 2013-05-17 15:32:29 +1000 | [diff] [blame] | 1 | # $OpenBSD: ssh-com-sftp.sh,v 1.7 2013/05/17 04:29:14 dtucker 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 | |
Darren Tucker | bd05609 | 2003-09-04 15:26:57 +1000 | [diff] [blame] | 6 | SFTPCMDFILE=${OBJ}/batch |
| 7 | |
| 8 | cat >$SFTPCMDFILE <<EOF |
| 9 | version |
| 10 | get $DATA ${COPY}.1 |
| 11 | put $DATA ${COPY}.2 |
| 12 | EOF |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 13 | |
| 14 | BUFFERSIZE="5 1000 32000 64000" |
| 15 | REQUESTS="1 2 10" |
| 16 | |
| 17 | #TEST_COMBASE=/path/to/ssh/com/binaries |
| 18 | if [ "X${TEST_COMBASE}" = "X" ]; then |
| 19 | fatal '$TEST_COMBASE is not set' |
| 20 | fi |
| 21 | |
| 22 | VERSIONS=" |
| 23 | 2.0.10 |
| 24 | 2.0.12 |
| 25 | 2.0.13 |
| 26 | 2.1.0 |
| 27 | 2.2.0 |
| 28 | 2.3.0 |
| 29 | 2.3.1 |
| 30 | 2.4.0 |
| 31 | 3.0.0 |
Damien Miller | 8b9cde7 | 2003-01-22 17:53:16 +1100 | [diff] [blame] | 32 | 3.1.0 |
| 33 | 3.2.0 |
Darren Tucker | ee5f83d | 2003-06-18 22:36:48 +1000 | [diff] [blame] | 34 | 3.2.2 |
| 35 | 3.2.3 |
Darren Tucker | 437a5f0 | 2004-02-29 20:33:51 +1100 | [diff] [blame] | 36 | 3.2.5 |
| 37 | 3.2.9 |
| 38 | 3.2.9.1 |
Damien Miller | 8b9cde7 | 2003-01-22 17:53:16 +1100 | [diff] [blame] | 39 | 3.3.0" |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 40 | |
| 41 | # go for it |
| 42 | for v in ${VERSIONS}; do |
| 43 | server=${TEST_COMBASE}/${v}/sftp-server2 |
| 44 | if [ ! -x ${server} ]; then |
| 45 | continue |
| 46 | fi |
| 47 | verbose "sftp-server $v" |
| 48 | for B in ${BUFFERSIZE}; do |
| 49 | for R in ${REQUESTS}; do |
| 50 | verbose "test $tid: buffer_size $B num_requests $R" |
| 51 | rm -f ${COPY}.1 ${COPY}.2 |
Darren Tucker | c863895 | 2009-10-07 10:46:29 +1100 | [diff] [blame] | 52 | ${SFTP} -D ${server} -B $B -R $R -b $SFTPCMDFILE \ |
Darren Tucker | bd05609 | 2003-09-04 15:26:57 +1000 | [diff] [blame] | 53 | > /dev/null 2>&1 |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 54 | r=$? |
| 55 | if [ $r -ne 0 ]; then |
| 56 | fail "sftp failed with $r" |
Darren Tucker | bd05609 | 2003-09-04 15:26:57 +1000 | [diff] [blame] | 57 | else |
| 58 | cmp $DATA ${COPY}.1 || fail "corrupted copy after get" |
| 59 | cmp $DATA ${COPY}.2 || fail "corrupted copy after put" |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 60 | fi |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 61 | done |
| 62 | done |
| 63 | done |
Darren Tucker | bd05609 | 2003-09-04 15:26:57 +1000 | [diff] [blame] | 64 | rm -f ${COPY}.1 ${COPY}.2 |
| 65 | rm -f $SFTPCMDFILE |