diff options
Diffstat (limited to 'regress')
-rw-r--r-- | regress/Makefile | 61 | ||||
-rw-r--r-- | regress/README.regress | 86 | ||||
-rw-r--r-- | regress/agent-getpeereid.sh | 6 | ||||
-rw-r--r-- | regress/agent-ptrace.sh | 18 | ||||
-rw-r--r-- | regress/agent-timeout.sh | 12 | ||||
-rw-r--r-- | regress/agent.sh | 2 | ||||
-rw-r--r-- | regress/authorized_keys_root | 2 | ||||
-rwxr-xr-x | regress/copy.1 | bin | 0 -> 45948 bytes | |||
-rwxr-xr-x | regress/copy.2 | bin | 0 -> 45948 bytes | |||
-rw-r--r-- | regress/dynamic-forward.sh | 47 | ||||
-rw-r--r-- | regress/forwarding.sh | 7 | ||||
-rw-r--r-- | regress/proto-version.sh | 2 | ||||
-rw-r--r-- | regress/reconfigure.sh | 35 | ||||
-rw-r--r-- | regress/rekey.sh | 31 | ||||
-rw-r--r-- | regress/sftp-badcmds.sh | 78 | ||||
-rw-r--r-- | regress/sftp-batch.sh | 4 | ||||
-rw-r--r-- | regress/sftp-cmds.sh | 109 | ||||
-rw-r--r-- | regress/sftp.sh | 26 | ||||
-rw-r--r-- | regress/ssh-com-client.sh | 6 | ||||
-rw-r--r-- | regress/ssh-com-keygen.sh | 4 | ||||
-rw-r--r-- | regress/ssh-com-sftp.sh | 28 | ||||
-rw-r--r-- | regress/ssh-com.sh | 6 | ||||
-rw-r--r-- | regress/stderr-after-eof.sh | 14 | ||||
-rw-r--r-- | regress/stderr-data.sh | 2 | ||||
-rw-r--r-- | regress/test-exec.sh | 45 | ||||
-rw-r--r-- | regress/transfer.sh | 2 | ||||
-rw-r--r-- | regress/try-ciphers.sh | 5 | ||||
-rw-r--r-- | regress/yes-head.sh | 2 |
28 files changed, 88 insertions, 552 deletions
diff --git a/regress/Makefile b/regress/Makefile index 623be8d82..6e2029348 100644 --- a/regress/Makefile +++ b/regress/Makefile | |||
@@ -1,11 +1,8 @@ | |||
1 | # $OpenBSD: Makefile,v 1.24 2003/07/03 08:24:13 markus Exp $ | 1 | # $OpenBSD: Makefile,v 1.20 2003/01/08 23:54:22 djm Exp $ |
2 | 2 | ||
3 | REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t-exec | 3 | REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 |
4 | tests: $(REGRESS_TARGETS) | ||
5 | 4 | ||
6 | clean: | 5 | CLEANFILES+= t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 |
7 | for F in $(CLEANFILES); do rm -f $(OBJ)$$F; done | ||
8 | distclean: clean | ||
9 | 6 | ||
10 | LTESTS= connect \ | 7 | LTESTS= connect \ |
11 | proxy-connect \ | 8 | proxy-connect \ |
@@ -14,7 +11,6 @@ LTESTS= connect \ | |||
14 | proto-mismatch \ | 11 | proto-mismatch \ |
15 | exit-status \ | 12 | exit-status \ |
16 | transfer \ | 13 | transfer \ |
17 | rekey \ | ||
18 | stderr-data \ | 14 | stderr-data \ |
19 | stderr-after-eof \ | 15 | stderr-after-eof \ |
20 | broken-pipe \ | 16 | broken-pipe \ |
@@ -28,34 +24,30 @@ LTESTS= connect \ | |||
28 | keygen-change \ | 24 | keygen-change \ |
29 | sftp \ | 25 | sftp \ |
30 | sftp-cmds \ | 26 | sftp-cmds \ |
31 | sftp-badcmds \ | ||
32 | sftp-batch \ | 27 | sftp-batch \ |
33 | reconfigure \ | ||
34 | dynamic-forward \ | ||
35 | forwarding | 28 | forwarding |
36 | 29 | ||
37 | USER!= id -un | 30 | USER!= id -un |
38 | CLEANFILES= t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \ | 31 | CLEANFILES+= authorized_keys_${USER} known_hosts pidfile \ |
39 | authorized_keys_${USER} known_hosts pidfile \ | ||
40 | ssh_config ssh_proxy sshd_config sshd_proxy \ | 32 | ssh_config ssh_proxy sshd_config sshd_proxy \ |
41 | rsa.pub rsa rsa1.pub rsa1 host.rsa host.rsa1 \ | 33 | rsa.pub rsa rsa1.pub rsa1 host.rsa host.rsa1 \ |
42 | rsa-agent rsa-agent.pub rsa1-agent rsa1-agent.pub \ | 34 | rsa-agent rsa-agent.pub rsa1-agent rsa1-agent.pub \ |
43 | ls.copy remote_pid | 35 | ls.copy |
44 | 36 | ||
45 | #LTESTS += ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp | 37 | #LTESTS+= ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp |
46 | 38 | ||
47 | t1: | 39 | t1: |
48 | ssh-keygen -if ${.CURDIR}/rsa_ssh2.prv | diff - ${.CURDIR}/rsa_openssh.prv | 40 | ssh-keygen -if ${.CURDIR}/rsa_ssh2.prv | diff - ${.CURDIR}/rsa_openssh.prv |
49 | 41 | ||
50 | t2: | 42 | t2: |
51 | cat ${.CURDIR}/rsa_openssh.prv > $(OBJ)/t2.out | 43 | cat ${.CURDIR}/rsa_openssh.prv > t2.out |
52 | chmod 600 $(OBJ)/t2.out | 44 | chmod 600 t2.out |
53 | ssh-keygen -yf $(OBJ)/t2.out | diff - ${.CURDIR}/rsa_openssh.pub | 45 | ssh-keygen -yf t2.out | diff - ${.CURDIR}/rsa_openssh.pub |
54 | 46 | ||
55 | t3: | 47 | t3: |
56 | ssh-keygen -ef ${.CURDIR}/rsa_openssh.pub >$(OBJ)/rsa_secsh.pub | 48 | ssh-keygen -ef ${.CURDIR}/rsa_openssh.pub |\ |
57 | ssh-keygen -if $(OBJ)/rsa_secsh.pub | diff - ${.CURDIR}/rsa_openssh.pub | 49 | ssh-keygen -if /dev/stdin |\ |
58 | rm -f ${.CURDIR}/rsa_secsh.pub | 50 | diff - ${.CURDIR}/rsa_openssh.pub |
59 | 51 | ||
60 | t4: | 52 | t4: |
61 | ssh-keygen -lf ${.CURDIR}/rsa_openssh.pub |\ | 53 | ssh-keygen -lf ${.CURDIR}/rsa_openssh.pub |\ |
@@ -66,21 +58,22 @@ t5: | |||
66 | awk '{print $$2}' | diff - ${.CURDIR}/t5.ok | 58 | awk '{print $$2}' | diff - ${.CURDIR}/t5.ok |
67 | 59 | ||
68 | t6: | 60 | t6: |
69 | ssh-keygen -if ${.CURDIR}/dsa_ssh2.prv > $(OBJ)/t6.out1 | 61 | ssh-keygen -if ${.CURDIR}/dsa_ssh2.prv > t6.out1 |
70 | ssh-keygen -if ${.CURDIR}/dsa_ssh2.pub > $(OBJ)/t6.out2 | 62 | ssh-keygen -if ${.CURDIR}/dsa_ssh2.pub > t6.out2 |
71 | chmod 600 $(OBJ)/t6.out1 | 63 | chmod 600 t6.out1 |
72 | ssh-keygen -yf $(OBJ)/t6.out1 | diff - $(OBJ)/t6.out2 | 64 | ssh-keygen -yf t6.out1 | diff - t6.out2 |
73 | 65 | ||
74 | $(OBJ)/t7.out: | 66 | t7.out: |
75 | ssh-keygen -q -t rsa -N '' -f $@ | 67 | ssh-keygen -q -t rsa -N '' -f $@ |
76 | 68 | ||
77 | t7: $(OBJ)/t7.out | 69 | t7: t7.out |
78 | ssh-keygen -lf $(OBJ)/t7.out > /dev/null | 70 | ssh-keygen -lf t7.out > /dev/null |
79 | ssh-keygen -Bf $(OBJ)/t7.out > /dev/null | 71 | ssh-keygen -Bf t7.out > /dev/null |
80 | 72 | ||
81 | t-exec: ${LTESTS:=.sh} | 73 | .for t in ${LTESTS} |
82 | @if [ "x$?" = "x" ]; then exit 0; fi; \ | 74 | REGRESS_TARGETS+=t-${t} |
83 | for TEST in ""$?; do \ | 75 | t-${t}: |
84 | echo "run test $${TEST}" ... 1>&2; \ | 76 | sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/${t}.sh |
85 | (sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || exit $$?; \ | 77 | .endfor |
86 | done | 78 | |
79 | .include "bsd.regress.mk" | ||
diff --git a/regress/README.regress b/regress/README.regress deleted file mode 100644 index 916894a88..000000000 --- a/regress/README.regress +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | Overview. | ||
2 | |||
3 | $ ./configure && make tests | ||
4 | |||
5 | You'll see some progress info. A failure will cause either the make to | ||
6 | abort or the driver script to report a "FATAL" failure. | ||
7 | |||
8 | The test consists of 2 parts. The first is the file-based tests which is | ||
9 | driven by the Makefile, and the second is a set of network or proxycommand | ||
10 | based tests, which are driven by a driver script (test-exec.sh) which is | ||
11 | called multiple times by the Makefile. | ||
12 | |||
13 | Failures in the first part will cause the Makefile to return an error. | ||
14 | Failures in the second part will print a "FATAL" message for the failed | ||
15 | test and continue. | ||
16 | |||
17 | OpenBSD has a system-wide regression test suite. OpenSSH Portable's test | ||
18 | suite is based on OpenBSD's with modifications. | ||
19 | |||
20 | |||
21 | Environment variables. | ||
22 | |||
23 | SUDO: path to sudo command, if desired. Note that some systems (notably | ||
24 | systems using PAM) require sudo to execute some tests. | ||
25 | TEST_SSH_TRACE: set yo "yes" for verbose output from tests | ||
26 | TEST_SSH_QUIET: set to "yes" to suppress non-fatal output. | ||
27 | TEST_SSH_x: path to "ssh" command under test, where x=SSH,SSHD,SSHAGENT,SSHADD | ||
28 | SSHKEYGEN,SSHKEYSCAN,SFTP,SFTPSERVER | ||
29 | OBJ: used by test scripts to access build dir. | ||
30 | |||
31 | |||
32 | Individual tests. | ||
33 | |||
34 | You can invoke test-exec.sh directly if you set up the path to find the | ||
35 | binaries under test and the test scripts themselves, for example: | ||
36 | |||
37 | $ cd regress | ||
38 | $ PATH=`pwd`/..:$PATH:. sh test-exec.sh `pwd` agent-timeout.sh | ||
39 | ok agent timeout test | ||
40 | |||
41 | |||
42 | Files. | ||
43 | |||
44 | test-exec.sh: the main test driver. Sets environment, creates config files | ||
45 | and keys and runs the specified test. | ||
46 | |||
47 | At the time of writing, the individual tests are: | ||
48 | agent-timeout.sh: agent timeout test | ||
49 | agent.sh: simple agent test | ||
50 | broken-pipe.sh: broken pipe test | ||
51 | connect-privsep.sh: proxy connect with privsep | ||
52 | connect.sh: simple connect | ||
53 | exit-status.sh: remote exit status | ||
54 | forwarding.sh: local and remote forwarding | ||
55 | keygen-change.sh: change passphrase for key | ||
56 | keyscan.sh: keyscan | ||
57 | proto-mismatch.sh: protocol version mismatch | ||
58 | proto-version.sh: sshd version with different protocol combinations | ||
59 | proxy-connect.sh: proxy connect | ||
60 | sftp.sh: basic sftp put/get | ||
61 | ssh-com-client.sh: connect with ssh.com client | ||
62 | ssh-com-keygen.sh: ssh.com key import | ||
63 | ssh-com-sftp.sh: basic sftp put/get with ssh.com server | ||
64 | ssh-com.sh: connect to ssh.com server | ||
65 | stderr-after-eof.sh: stderr data after eof | ||
66 | stderr-data.sh: stderr data transfer | ||
67 | transfer.sh: transfer data | ||
68 | try-ciphers.sh: try ciphers | ||
69 | yes-head.sh: yes pipe head | ||
70 | |||
71 | |||
72 | Problems? | ||
73 | |||
74 | Run the failing test with shell tracing (-x) turned on: | ||
75 | $ PATH=`pwd`/..:$PATH:. sh -x test-exec.sh `pwd` agent-timeout.sh | ||
76 | |||
77 | Failed tests can be difficult to diagnose. Suggestions: | ||
78 | - run the individual test via ./test-exec.sh `pwd` [testname] | ||
79 | - set LogLevel to VERBOSE in test-exec.sh and enable syslogging of | ||
80 | auth.debug (eg to /var/log/authlog). | ||
81 | |||
82 | |||
83 | Known Issues. | ||
84 | |||
85 | |||
86 | $Id: README.regress,v 1.1 2003/09/04 05:39:54 dtucker Exp $ | ||
diff --git a/regress/agent-getpeereid.sh b/regress/agent-getpeereid.sh index 46d20dc2b..0889fe80e 100644 --- a/regress/agent-getpeereid.sh +++ b/regress/agent-getpeereid.sh | |||
@@ -7,12 +7,6 @@ UNPRIV=nobody | |||
7 | ASOCK=${OBJ}/agent | 7 | ASOCK=${OBJ}/agent |
8 | SSH_AUTH_SOCK=/nonexistant | 8 | SSH_AUTH_SOCK=/nonexistant |
9 | 9 | ||
10 | if grep "#undef.*HAVE_GETPEEREID" ${BUILDDIR}/config.h >/dev/null 2>&1 | ||
11 | then | ||
12 | echo "skipped (not supported on this platform)" | ||
13 | exit 0 | ||
14 | fi | ||
15 | |||
16 | trace "start agent" | 10 | trace "start agent" |
17 | eval `${SSHAGENT} -s -a ${ASOCK}` > /dev/null | 11 | eval `${SSHAGENT} -s -a ${ASOCK}` > /dev/null |
18 | r=$? | 12 | r=$? |
diff --git a/regress/agent-ptrace.sh b/regress/agent-ptrace.sh index cd9c0023d..9f9c99960 100644 --- a/regress/agent-ptrace.sh +++ b/regress/agent-ptrace.sh | |||
@@ -3,22 +3,6 @@ | |||
3 | 3 | ||
4 | tid="disallow agent ptrace attach" | 4 | tid="disallow agent ptrace attach" |
5 | 5 | ||
6 | if have_prog uname ; then | ||
7 | case `uname` in | ||
8 | Linux|HP-UX|SunOS|NetBSD|AIX|CYGWIN*) | ||
9 | echo "skipped (not supported on this platform)" | ||
10 | exit 0 | ||
11 | ;; | ||
12 | esac | ||
13 | fi | ||
14 | |||
15 | if have_prog gdb ; then | ||
16 | : ok | ||
17 | else | ||
18 | echo "skipped (gdb not found)" | ||
19 | exit 0 | ||
20 | fi | ||
21 | |||
22 | trace "start agent" | 6 | trace "start agent" |
23 | eval `${SSHAGENT} -s` > /dev/null | 7 | eval `${SSHAGENT} -s` > /dev/null |
24 | r=$? | 8 | r=$? |
@@ -32,7 +16,7 @@ EOF | |||
32 | if [ $? -ne 0 ]; then | 16 | if [ $? -ne 0 ]; then |
33 | fail "gdb failed: exit code $?" | 17 | fail "gdb failed: exit code $?" |
34 | fi | 18 | fi |
35 | grep 'ptrace: Operation not permitted.' >/dev/null ${OBJ}/gdb.out | 19 | grep -q 'ptrace: Operation not permitted.' ${OBJ}/gdb.out |
36 | r=$? | 20 | r=$? |
37 | rm -f ${OBJ}/gdb.out | 21 | rm -f ${OBJ}/gdb.out |
38 | if [ $r -ne 0 ]; then | 22 | if [ $r -ne 0 ]; then |
diff --git a/regress/agent-timeout.sh b/regress/agent-timeout.sh index 3a40e7af8..28b1be028 100644 --- a/regress/agent-timeout.sh +++ b/regress/agent-timeout.sh | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | tid="agent timeout test" | 4 | tid="agent timeout test" |
5 | 5 | ||
6 | SSHAGENT_TIMEOUT=10 | 6 | TIMEOUT=5 |
7 | 7 | ||
8 | trace "start agent" | 8 | trace "start agent" |
9 | eval `${SSHAGENT} -s` > /dev/null | 9 | eval `${SSHAGENT} -s` > /dev/null |
@@ -13,7 +13,7 @@ if [ $r -ne 0 ]; then | |||
13 | else | 13 | else |
14 | trace "add keys with timeout" | 14 | trace "add keys with timeout" |
15 | for t in rsa rsa1; do | 15 | for t in rsa rsa1; do |
16 | ${SSHADD} -t ${SSHAGENT_TIMEOUT} $OBJ/$t > /dev/null 2>&1 | 16 | ${SSHADD} -t ${TIMEOUT} $OBJ/$t > /dev/null 2>&1 |
17 | if [ $? -ne 0 ]; then | 17 | if [ $? -ne 0 ]; then |
18 | fail "ssh-add did succeed exit code 0" | 18 | fail "ssh-add did succeed exit code 0" |
19 | fi | 19 | fi |
@@ -23,10 +23,10 @@ else | |||
23 | if [ $n -ne 2 ]; then | 23 | if [ $n -ne 2 ]; then |
24 | fail "ssh-add -l did not return 2 keys: $n" | 24 | fail "ssh-add -l did not return 2 keys: $n" |
25 | fi | 25 | fi |
26 | trace "sleeping 2*${SSHAGENT_TIMEOUT} seconds" | 26 | trace "sleeping 2*${TIMEOUT} seconds" |
27 | sleep ${SSHAGENT_TIMEOUT} | 27 | sleep ${TIMEOUT} |
28 | sleep ${SSHAGENT_TIMEOUT} | 28 | sleep ${TIMEOUT} |
29 | ${SSHADD} -l 2> /dev/null | grep 'The agent has no identities.' >/dev/null | 29 | ${SSHADD} -l 2> /dev/null | grep -q 'The agent has no identities.' |
30 | if [ $? -ne 0 ]; then | 30 | if [ $? -ne 0 ]; then |
31 | fail "ssh-add -l still returns keys after timeout" | 31 | fail "ssh-add -l still returns keys after timeout" |
32 | fi | 32 | fi |
diff --git a/regress/agent.sh b/regress/agent.sh index b34487767..7e9b4cb18 100644 --- a/regress/agent.sh +++ b/regress/agent.sh | |||
@@ -19,7 +19,7 @@ else | |||
19 | fail "ssh-add -l did not fail with exit code 1" | 19 | fail "ssh-add -l did not fail with exit code 1" |
20 | fi | 20 | fi |
21 | trace "overwrite authorized keys" | 21 | trace "overwrite authorized keys" |
22 | echon > $OBJ/authorized_keys_$USER | 22 | echo -n > $OBJ/authorized_keys_$USER |
23 | for t in rsa rsa1; do | 23 | for t in rsa rsa1; do |
24 | # generate user key for agent | 24 | # generate user key for agent |
25 | rm -f $OBJ/$t-agent | 25 | rm -f $OBJ/$t-agent |
diff --git a/regress/authorized_keys_root b/regress/authorized_keys_root new file mode 100644 index 000000000..328537120 --- /dev/null +++ b/regress/authorized_keys_root | |||
@@ -0,0 +1,2 @@ | |||
1 | ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAt6ttBacbgvLPsF1VWWfT51t55/5Mj62Xp8EaoH5SNSaLiGIgrrja077lKEept75U4uKFUYU5JJX9GPE9A7Y43LXv+/A6Jm4rEj/U0s4H8tf0UmzVC3t6xh0sRK0hYVNILyoHnIAgdY8CmOiybw7p6DxJY8MRAehD3n9+kFcachU= root@xenon | ||
2 | 1024 35 132789427207755621599908461558918671787816692978751485815532032934821830960131244604702969298486352138126114080367609979552547448841583955126231410604842765726397407176910594168641969541792069550006878863592030567875913190224374005367884774859544943329148178663694126456638431428703289837638970464685771819219 root@xenon | ||
diff --git a/regress/copy.1 b/regress/copy.1 new file mode 100755 index 000000000..92d4d20f9 --- /dev/null +++ b/regress/copy.1 | |||
Binary files differ | |||
diff --git a/regress/copy.2 b/regress/copy.2 new file mode 100755 index 000000000..92d4d20f9 --- /dev/null +++ b/regress/copy.2 | |||
Binary files differ | |||
diff --git a/regress/dynamic-forward.sh b/regress/dynamic-forward.sh deleted file mode 100644 index 2b0b825d0..000000000 --- a/regress/dynamic-forward.sh +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | # $OpenBSD: dynamic-forward.sh,v 1.2 2003/07/03 08:21:46 markus Exp $ | ||
2 | # Placed in the Public Domain. | ||
3 | |||
4 | tid="dynamic forwarding" | ||
5 | |||
6 | PORT=4242 | ||
7 | FWDPORT=4243 | ||
8 | DATA=/bin/ls${EXEEXT} | ||
9 | |||
10 | if have_prog nc && nc -h 2>&1 | grep "x proxy address" >/dev/null; then | ||
11 | proxycmd="nc -x 127.0.0.1:$FWDPORT -X" | ||
12 | elif have_prog connect; then | ||
13 | proxycmd="connect -S 127.0.0.1:$FWDPORT -" | ||
14 | else | ||
15 | echo "skipped (no suitable ProxyCommand found)" | ||
16 | exit 0 | ||
17 | fi | ||
18 | trace "will use ProxyCommand $proxycmd" | ||
19 | |||
20 | start_sshd | ||
21 | |||
22 | for p in 1 2; do | ||
23 | trace "start dynamic forwarding, fork to background" | ||
24 | ${SSH} -$p -F $OBJ/ssh_config -f -D $FWDPORT -q somehost \ | ||
25 | exec sh -c \'"echo \$\$ > $OBJ/remote_pid; exec sleep 444"\' | ||
26 | |||
27 | for s in 4 5; do | ||
28 | for h in 127.0.0.1 localhost; do | ||
29 | trace "testing ssh protocol $p socks version $s host $h" | ||
30 | ${SSH} -F $OBJ/ssh_config \ | ||
31 | -o "ProxyCommand ${proxycmd}${s} $h $PORT" \ | ||
32 | somehost cat $DATA > $OBJ/ls.copy | ||
33 | test -f $OBJ/ls.copy || fail "failed copy $DATA" | ||
34 | cmp $DATA $OBJ/ls.copy || fail "corrupted copy of $DATA" | ||
35 | done | ||
36 | done | ||
37 | |||
38 | if [ -f $OBJ/remote_pid ]; then | ||
39 | remote=`cat $OBJ/remote_pid` | ||
40 | trace "terminate remote shell, pid $remote" | ||
41 | if [ $remote -gt 1 ]; then | ||
42 | kill -HUP $remote | ||
43 | fi | ||
44 | else | ||
45 | fail "no pid file: $OBJ/remote_pid" | ||
46 | fi | ||
47 | done | ||
diff --git a/regress/forwarding.sh b/regress/forwarding.sh index dfe065dd6..7b281c013 100644 --- a/regress/forwarding.sh +++ b/regress/forwarding.sh | |||
@@ -2,7 +2,6 @@ | |||
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="local and remote forwarding" | 4 | tid="local and remote forwarding" |
5 | DATA=/bin/ls${EXEEXT} | ||
6 | 5 | ||
7 | start_sshd | 6 | start_sshd |
8 | 7 | ||
@@ -26,9 +25,9 @@ for p in 1 2; do | |||
26 | 25 | ||
27 | trace "transfer over forwarded channels and check result" | 26 | trace "transfer over forwarded channels and check result" |
28 | ${SSH} -$q -F $OBJ/ssh_config -p$last -o 'ConnectionAttempts=4' \ | 27 | ${SSH} -$q -F $OBJ/ssh_config -p$last -o 'ConnectionAttempts=4' \ |
29 | somehost cat $DATA > $OBJ/ls.copy | 28 | somehost cat /bin/ls > $OBJ/ls.copy |
30 | test -f $OBJ/ls.copy || fail "failed copy $DATA" | 29 | test -f $OBJ/ls.copy || fail "failed copy /bin/ls" |
31 | cmp $DATA $OBJ/ls.copy || fail "corrupted copy of $DATA" | 30 | cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls" |
32 | 31 | ||
33 | sleep 10 | 32 | sleep 10 |
34 | done | 33 | done |
diff --git a/regress/proto-version.sh b/regress/proto-version.sh index 1651a69e1..7dc616f5f 100644 --- a/regress/proto-version.sh +++ b/regress/proto-version.sh | |||
@@ -8,7 +8,7 @@ check_version () | |||
8 | { | 8 | { |
9 | version=$1 | 9 | version=$1 |
10 | expect=$2 | 10 | expect=$2 |
11 | banner=`echon | ${SSHD} -o "Protocol=${version}" -i -f ${OBJ}/sshd_proxy` | 11 | banner=`echo -n | ${SSHD} -o "Protocol=${version}" -i -f ${OBJ}/sshd_proxy` |
12 | case ${banner} in | 12 | case ${banner} in |
13 | SSH-1.99-*) | 13 | SSH-1.99-*) |
14 | proto=199 | 14 | proto=199 |
diff --git a/regress/reconfigure.sh b/regress/reconfigure.sh deleted file mode 100644 index ba6dbc6f5..000000000 --- a/regress/reconfigure.sh +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | # $OpenBSD: reconfigure.sh,v 1.2 2003/06/21 09:14:05 markus Exp $ | ||
2 | # Placed in the Public Domain. | ||
3 | |||
4 | tid="simple connect after reconfigure" | ||
5 | |||
6 | # we need the full path to sshd for -HUP | ||
7 | case $SSHD in | ||
8 | /*) | ||
9 | # full path is OK | ||
10 | ;; | ||
11 | *) | ||
12 | # otherwise make fully qualified | ||
13 | SSHD=$OBJ/$SSHD | ||
14 | esac | ||
15 | |||
16 | start_sshd | ||
17 | |||
18 | $SUDO kill -HUP `cat $PIDFILE` | ||
19 | sleep 1 | ||
20 | |||
21 | trace "wait for sshd to restart" | ||
22 | i=0; | ||
23 | while [ ! -f $PIDFILE -a $i -lt 10 ]; do | ||
24 | i=`expr $i + 1` | ||
25 | sleep $i | ||
26 | done | ||
27 | |||
28 | test -f $PIDFILE || fatal "sshd did not restart" | ||
29 | |||
30 | for p in 1 2; do | ||
31 | ${SSH} -o "Protocol=$p" -F $OBJ/ssh_config somehost true | ||
32 | if [ $? -ne 0 ]; then | ||
33 | fail "ssh connect with protocol $p failed after reconfigure" | ||
34 | fi | ||
35 | done | ||
diff --git a/regress/rekey.sh b/regress/rekey.sh deleted file mode 100644 index 6b7e845ec..000000000 --- a/regress/rekey.sh +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | # $OpenBSD: rekey.sh,v 1.1 2003/03/28 13:58:28 markus Exp $ | ||
2 | # Placed in the Public Domain. | ||
3 | |||
4 | tid="rekey during transfer data" | ||
5 | |||
6 | DATA=${OBJ}/data | ||
7 | COPY=${OBJ}/copy | ||
8 | LOG=${OBJ}/log | ||
9 | |||
10 | rm -f ${COPY} ${LOG} ${DATA} | ||
11 | dd if=/bin/ls${EXEEXT} of=${DATA} bs=1k seek=511 count=1 > /dev/null 2>&1 | ||
12 | |||
13 | for s in 16 1k 128k 256k; do | ||
14 | trace "rekeylimit ${s}" | ||
15 | rm -f ${COPY} | ||
16 | cat $DATA | \ | ||
17 | ${SSH} -oCompression=no -oRekeyLimit=$s \ | ||
18 | -v -F $OBJ/ssh_proxy somehost "cat > ${COPY}" \ | ||
19 | 2> ${LOG} | ||
20 | if [ $? -ne 0 ]; then | ||
21 | fail "ssh failed" | ||
22 | fi | ||
23 | cmp $DATA ${COPY} || fail "corrupted copy" | ||
24 | n=`grep 'NEWKEYS sent' ${LOG} | wc -l` | ||
25 | n=`expr $n - 1` | ||
26 | trace "$n rekeying(s)" | ||
27 | if [ $n -lt 1 ]; then | ||
28 | fail "no rekeying occured" | ||
29 | fi | ||
30 | done | ||
31 | rm -f ${COPY} ${LOG} ${DATA} | ||
diff --git a/regress/sftp-badcmds.sh b/regress/sftp-badcmds.sh deleted file mode 100644 index a6a19409d..000000000 --- a/regress/sftp-badcmds.sh +++ /dev/null | |||
@@ -1,78 +0,0 @@ | |||
1 | # $OpenBSD: sftp-badcmds.sh,v 1.2 2003/05/15 04:07:12 mouring Exp $ | ||
2 | # Placed in the Public Domain. | ||
3 | |||
4 | tid="sftp invalid commands" | ||
5 | |||
6 | DATA=/bin/ls${EXEEXT} | ||
7 | DATA2=/bin/cat${EXEEXT} | ||
8 | NONEXIST=/NONEXIST.$$ | ||
9 | COPY=${OBJ}/copy | ||
10 | GLOBFILES=`(cd /bin;echo l*)` | ||
11 | |||
12 | rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd | ||
13 | |||
14 | rm -f ${COPY} | ||
15 | verbose "$tid: get nonexistent" | ||
16 | echo "get $NONEXIST $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
17 | || fail "get nonexistent failed" | ||
18 | test -f ${COPY} && fail "existing copy after get nonexistent" | ||
19 | |||
20 | rm -f ${COPY}.dd/* | ||
21 | verbose "$tid: glob get to nonexistent directory" | ||
22 | echo "get /bin/l* $NONEXIST" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
23 | || fail "get nonexistent failed" | ||
24 | for x in $GLOBFILES; do | ||
25 | test -f ${COPY}.dd/$x && fail "existing copy after get nonexistent" | ||
26 | done | ||
27 | |||
28 | rm -f ${COPY} | ||
29 | verbose "$tid: put nonexistent" | ||
30 | echo "put $NONEXIST $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
31 | || fail "put nonexistent failed" | ||
32 | test -f ${COPY} && fail "existing copy after put nonexistent" | ||
33 | |||
34 | rm -f ${COPY}.dd/* | ||
35 | verbose "$tid: glob put to nonexistent directory" | ||
36 | echo "put /bin/l* ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
37 | || fail "put nonexistent failed" | ||
38 | for x in $GLOBFILES; do | ||
39 | test -f ${COPY}.dd/$x && fail "existing copy after nonexistent" | ||
40 | done | ||
41 | |||
42 | rm -f ${COPY} | ||
43 | verbose "$tid: rename nonexistent" | ||
44 | echo "rename $NONEXIST ${COPY}.1" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
45 | || fail "rename nonexist failed" | ||
46 | test -f ${COPY}.1 && fail "file exists after rename nonexistent" | ||
47 | |||
48 | rm -f ${COPY} ${COPY}.1 | ||
49 | cp $DATA $COPY | ||
50 | cp $DATA2 ${COPY}.1 | ||
51 | verbose "$tid: rename target exists" | ||
52 | echo "rename $COPY ${COPY}.1" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
53 | || fail "rename target exists failed" | ||
54 | test -f ${COPY} || fail "oldname missing after rename target exists" | ||
55 | test -f ${COPY}.1 || fail "newname missing after rename target exists" | ||
56 | cmp $DATA ${COPY} >/dev/null 2>&1 || fail "corrupted oldname after rename target exists" | ||
57 | cmp $DATA2 ${COPY}.1 >/dev/null 2>&1 || fail "corrupted newname after rename target exists" | ||
58 | |||
59 | rm -rf ${COPY} ${COPY}.dd | ||
60 | cp $DATA $COPY | ||
61 | mkdir ${COPY}.dd | ||
62 | verbose "$tid: rename target exists (directory)" | ||
63 | echo "rename $COPY ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
64 | || fail "rename target exists (directory) failed" | ||
65 | test -f ${COPY} || fail "oldname missing after rename target exists (directory)" | ||
66 | test -d ${COPY}.dd || fail "newname missing after rename target exists (directory)" | ||
67 | cmp $DATA ${COPY} >/dev/null 2>&1 || fail "corrupted oldname after rename target exists (directory)" | ||
68 | |||
69 | rm -f ${COPY}.dd/* | ||
70 | rm -rf ${COPY} | ||
71 | cp ${DATA2} ${COPY} | ||
72 | verbose "$tid: glob put files to local file" | ||
73 | echo "put /bin/l* $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 | ||
74 | cmp ${DATA2} ${COPY} || fail "put successed when it should have failed" | ||
75 | |||
76 | rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd | ||
77 | |||
78 | |||
diff --git a/regress/sftp-batch.sh b/regress/sftp-batch.sh index f648eae80..cffacb6df 100644 --- a/regress/sftp-batch.sh +++ b/regress/sftp-batch.sh | |||
@@ -3,9 +3,9 @@ | |||
3 | 3 | ||
4 | tid="sftp batchfile" | 4 | tid="sftp batchfile" |
5 | 5 | ||
6 | DATA=/bin/ls${EXEEXT} | 6 | DATA=/bin/ls |
7 | COPY=${OBJ}/copy | 7 | COPY=${OBJ}/copy |
8 | BATCH=${OBJ}/sftp-batch.tmp | 8 | BATCH=${OBJ}/sftp-batch |
9 | 9 | ||
10 | rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.* | 10 | rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.* |
11 | 11 | ||
diff --git a/regress/sftp-cmds.sh b/regress/sftp-cmds.sh index 1256aeb2d..462c6802f 100644 --- a/regress/sftp-cmds.sh +++ b/regress/sftp-cmds.sh | |||
@@ -1,42 +1,17 @@ | |||
1 | # $OpenBSD: sftp-cmds.sh,v 1.5 2003/07/19 00:46:31 djm Exp $ | 1 | # $OpenBSD: sftp-cmds.sh,v 1.2 2003/01/10 07:52:41 djm Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | # XXX - TODO: | 4 | # XXX - TODO: |
5 | # - globbed operations | ||
5 | # - chmod / chown / chgrp | 6 | # - chmod / chown / chgrp |
6 | # - -p flag for get & put | 7 | # - -p flag for get & put |
7 | 8 | ||
8 | tid="sftp commands" | 9 | tid="sftp commands" |
9 | 10 | ||
10 | DATA=/bin/ls${EXEEXT} | 11 | DATA=/bin/ls |
11 | COPY=${OBJ}/copy | 12 | COPY=${OBJ}/copy |
12 | # test that these files are readable! | 13 | |
13 | for i in `(cd /bin;echo l*)` | 14 | rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.* |
14 | do | ||
15 | if [ -r $i ]; then | ||
16 | GLOBFILES="$GLOBFILES $i" | ||
17 | fi | ||
18 | done | ||
19 | |||
20 | if have_prog uname | ||
21 | then | ||
22 | case `uname` in | ||
23 | CYGWIN*) | ||
24 | os=cygwin | ||
25 | ;; | ||
26 | *) | ||
27 | os=`uname` | ||
28 | ;; | ||
29 | esac | ||
30 | else | ||
31 | os="unknown" | ||
32 | fi | ||
33 | |||
34 | # Path with embedded quote | ||
35 | QUOTECOPY=${COPY}".\"blah\"" | ||
36 | QUOTECOPY_ARG=${COPY}'.\"blah\"' | ||
37 | |||
38 | rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${COPY}.dd2 | ||
39 | mkdir ${COPY}.dd | ||
40 | 15 | ||
41 | verbose "$tid: lls" | 16 | verbose "$tid: lls" |
42 | echo "lls ${OBJ}" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | 17 | echo "lls ${OBJ}" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ |
@@ -79,91 +54,21 @@ echo "get $DATA $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | |||
79 | || fail "get failed" | 54 | || fail "get failed" |
80 | cmp $DATA ${COPY} || fail "corrupted copy after get" | 55 | cmp $DATA ${COPY} || fail "corrupted copy after get" |
81 | 56 | ||
82 | rm -f ${COPY}.dd/* | ||
83 | verbose "$tid: get to directory" | ||
84 | echo "get $DATA ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
85 | || fail "get failed" | ||
86 | cmp $DATA ${COPY}.dd/`basename $DATA` || fail "corrupted copy after get" | ||
87 | |||
88 | rm -f ${COPY}.dd/* | ||
89 | verbose "$tid: glob get to directory" | ||
90 | echo "get /bin/l* ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
91 | || fail "get failed" | ||
92 | for x in $GLOBFILES; do | ||
93 | cmp /bin/$x ${COPY}.dd/$x || fail "corrupted copy after get" | ||
94 | done | ||
95 | |||
96 | rm -f ${COPY}.dd/* | ||
97 | verbose "$tid: get to local dir" | ||
98 | (echo "lcd ${COPY}.dd"; echo "get $DATA" ) | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
99 | || fail "get failed" | ||
100 | cmp $DATA ${COPY}.dd/`basename $DATA` || fail "corrupted copy after get" | ||
101 | |||
102 | rm -f ${COPY}.dd/* | ||
103 | verbose "$tid: glob get to local dir" | ||
104 | (echo "lcd ${COPY}.dd"; echo "get /bin/l*") | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
105 | || fail "get failed" | ||
106 | for x in $GLOBFILES; do | ||
107 | cmp /bin/$x ${COPY}.dd/$x || fail "corrupted copy after get" | ||
108 | done | ||
109 | |||
110 | rm -f ${COPY} | 57 | rm -f ${COPY} |
111 | verbose "$tid: put" | 58 | verbose "$tid: put" |
112 | echo "put $DATA $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | 59 | echo "put $DATA $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ |
113 | || fail "put failed" | 60 | || fail "put failed" |
114 | cmp $DATA ${COPY} || fail "corrupted copy after put" | 61 | cmp $DATA ${COPY} || fail "corrupted copy after put" |
115 | 62 | ||
116 | if [ "$os" != "cygwin" ]; then | ||
117 | rm -f ${QUOTECOPY} | ||
118 | verbose "$tid: put filename with quotes" | ||
119 | echo "put $DATA \"$QUOTECOPY_ARG\"" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
120 | || fail "put failed" | ||
121 | cmp $DATA ${QUOTECOPY} || fail "corrupted copy after put with quotes" | ||
122 | fi | ||
123 | |||
124 | rm -f ${COPY}.dd/* | ||
125 | verbose "$tid: put to directory" | ||
126 | echo "put $DATA ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
127 | || fail "put failed" | ||
128 | cmp $DATA ${COPY}.dd/`basename $DATA` || fail "corrupted copy after put" | ||
129 | |||
130 | rm -f ${COPY}.dd/* | ||
131 | verbose "$tid: glob put to directory" | ||
132 | echo "put /bin/l* ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
133 | || fail "put failed" | ||
134 | for x in $GLOBFILES; do | ||
135 | cmp /bin/$x ${COPY}.dd/$x || fail "corrupted copy after put" | ||
136 | done | ||
137 | |||
138 | rm -f ${COPY}.dd/* | ||
139 | verbose "$tid: put to local dir" | ||
140 | (echo "cd ${COPY}.dd"; echo "put $DATA") | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
141 | || fail "put failed" | ||
142 | cmp $DATA ${COPY}.dd/`basename $DATA` || fail "corrupted copy after put" | ||
143 | |||
144 | rm -f ${COPY}.dd/* | ||
145 | verbose "$tid: glob put to local dir" | ||
146 | (echo "cd ${COPY}.dd"; echo "put /bin/l*") | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
147 | || fail "put failed" | ||
148 | for x in $GLOBFILES; do | ||
149 | cmp /bin/$x ${COPY}.dd/$x || fail "corrupted copy after put" | ||
150 | done | ||
151 | |||
152 | verbose "$tid: rename" | 63 | verbose "$tid: rename" |
153 | echo "rename $COPY ${COPY}.1" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | 64 | echo "rename $COPY ${COPY}.1" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ |
154 | || fail "rename failed" | 65 | || fail "rename failed" |
155 | test -f ${COPY}.1 || fail "missing file after rename" | 66 | test -f ${COPY}.1 || fail "missing file after rename" |
156 | cmp $DATA ${COPY}.1 >/dev/null 2>&1 || fail "corrupted copy after rename" | 67 | cmp $DATA ${COPY}.1 >/dev/null 2>&1 || fail "corrupted copy after rename" |
157 | 68 | ||
158 | verbose "$tid: rename directory" | ||
159 | echo "rename ${COPY}.dd ${COPY}.dd2" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | ||
160 | || fail "rename directory failed" | ||
161 | test -d ${COPY}.dd && fail "oldname exists after rename directory" | ||
162 | test -d ${COPY}.dd2 || fail "missing newname after rename directory" | ||
163 | |||
164 | verbose "$tid: ln" | 69 | verbose "$tid: ln" |
165 | echo "ln ${COPY}.1 ${COPY}.2" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 || fail "ln failed" | 70 | echo "ln ${COPY}.1 ${COPY}.2" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 || fail "ln failed" |
166 | test -h ${COPY}.2 || fail "missing file after ln" | 71 | test -L ${COPY}.2 || fail "missing file after ln" |
167 | 72 | ||
168 | verbose "$tid: mkdir" | 73 | verbose "$tid: mkdir" |
169 | echo "mkdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | 74 | echo "mkdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ |
@@ -190,6 +95,6 @@ verbose "$tid: lchdir" | |||
190 | echo "lchdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ | 95 | echo "lchdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ |
191 | || fail "lchdir failed" | 96 | || fail "lchdir failed" |
192 | 97 | ||
193 | rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${COPY}.dd2 | 98 | rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.* |
194 | 99 | ||
195 | 100 | ||
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 | ||
diff --git a/regress/ssh-com-client.sh b/regress/ssh-com-client.sh index fc953228e..015ebbb8c 100644 --- a/regress/ssh-com-client.sh +++ b/regress/ssh-com-client.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: ssh-com-client.sh,v 1.5 2003/05/14 22:08:27 markus Exp $ | 1 | # $OpenBSD: ssh-com-client.sh,v 1.4 2002/07/16 08:58:16 markus Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="connect with ssh.com client" | 4 | tid="connect with ssh.com client" |
@@ -17,8 +17,6 @@ VERSIONS=" | |||
17 | 3.0.0 | 17 | 3.0.0 |
18 | 3.1.0 | 18 | 3.1.0 |
19 | 3.2.0 | 19 | 3.2.0 |
20 | 3.2.2 | ||
21 | 3.2.3 | ||
22 | 3.3.0" | 20 | 3.3.0" |
23 | 21 | ||
24 | # 2.0.10 2.0.12 2.0.13 don't like the test setup | 22 | # 2.0.10 2.0.12 2.0.13 don't like the test setup |
@@ -64,7 +62,7 @@ EOF | |||
64 | # we need a real server (no ProxyConnect option) | 62 | # we need a real server (no ProxyConnect option) |
65 | start_sshd | 63 | start_sshd |
66 | 64 | ||
67 | DATA=/bin/ls${EXEEXT} | 65 | DATA=/bin/ls |
68 | COPY=${OBJ}/copy | 66 | COPY=${OBJ}/copy |
69 | rm -f ${COPY} | 67 | rm -f ${COPY} |
70 | 68 | ||
diff --git a/regress/ssh-com-keygen.sh b/regress/ssh-com-keygen.sh index dbe9b0a6b..e93dc78c9 100644 --- a/regress/ssh-com-keygen.sh +++ b/regress/ssh-com-keygen.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: ssh-com-keygen.sh,v 1.3 2003/05/14 22:08:27 markus Exp $ | 1 | # $OpenBSD: ssh-com-keygen.sh,v 1.2 2002/07/16 08:58:16 markus Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="ssh.com key import" | 4 | tid="ssh.com key import" |
@@ -20,8 +20,6 @@ VERSIONS=" | |||
20 | 3.0.0 | 20 | 3.0.0 |
21 | 3.1.0 | 21 | 3.1.0 |
22 | 3.2.0 | 22 | 3.2.0 |
23 | 3.2.2 | ||
24 | 3.2.3 | ||
25 | 3.3.0" | 23 | 3.3.0" |
26 | 24 | ||
27 | COMPRV=${OBJ}/comkey | 25 | COMPRV=${OBJ}/comkey |
diff --git a/regress/ssh-com-sftp.sh b/regress/ssh-com-sftp.sh index 6ca7dad51..f08018b84 100644 --- a/regress/ssh-com-sftp.sh +++ b/regress/ssh-com-sftp.sh | |||
@@ -1,17 +1,10 @@ | |||
1 | # $OpenBSD: ssh-com-sftp.sh,v 1.4 2003/05/14 22:08:27 markus Exp $ | 1 | # $OpenBSD: ssh-com-sftp.sh,v 1.3 2002/07/16 08:58:16 markus Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="basic sftp put/get with ssh.com server" | 4 | tid="basic sftp put/get with ssh.com server" |
5 | 5 | ||
6 | DATA=/bin/ls${EXEEXT} | 6 | DATA=/bin/ls |
7 | COPY=${OBJ}/copy | 7 | COPY=${OBJ}/copy |
8 | SFTPCMDFILE=${OBJ}/batch | ||
9 | |||
10 | cat >$SFTPCMDFILE <<EOF | ||
11 | version | ||
12 | get $DATA ${COPY}.1 | ||
13 | put $DATA ${COPY}.2 | ||
14 | EOF | ||
15 | 8 | ||
16 | BUFFERSIZE="5 1000 32000 64000" | 9 | BUFFERSIZE="5 1000 32000 64000" |
17 | REQUESTS="1 2 10" | 10 | REQUESTS="1 2 10" |
@@ -33,8 +26,6 @@ VERSIONS=" | |||
33 | 3.0.0 | 26 | 3.0.0 |
34 | 3.1.0 | 27 | 3.1.0 |
35 | 3.2.0 | 28 | 3.2.0 |
36 | 3.2.2 | ||
37 | 3.2.3 | ||
38 | 3.3.0" | 29 | 3.3.0" |
39 | 30 | ||
40 | # go for it | 31 | # go for it |
@@ -48,17 +39,18 @@ for v in ${VERSIONS}; do | |||
48 | for R in ${REQUESTS}; do | 39 | for R in ${REQUESTS}; do |
49 | verbose "test $tid: buffer_size $B num_requests $R" | 40 | verbose "test $tid: buffer_size $B num_requests $R" |
50 | rm -f ${COPY}.1 ${COPY}.2 | 41 | rm -f ${COPY}.1 ${COPY}.2 |
51 | ${SFTP} -P ${server} -B $B -R $R -b $SFTPCMDFILE \ | 42 | ${SFTP} -P ${server} -B $B -R $R -b /dev/stdin \ |
52 | > /dev/null 2>&1 | 43 | > /dev/null 2>&1 << EOF |
44 | version | ||
45 | get $DATA ${COPY}.1 | ||
46 | put $DATA ${COPY}.2 | ||
47 | EOF | ||
53 | r=$? | 48 | r=$? |
54 | if [ $r -ne 0 ]; then | 49 | if [ $r -ne 0 ]; then |
55 | fail "sftp failed with $r" | 50 | fail "sftp failed with $r" |
56 | else | ||
57 | cmp $DATA ${COPY}.1 || fail "corrupted copy after get" | ||
58 | cmp $DATA ${COPY}.2 || fail "corrupted copy after put" | ||
59 | fi | 51 | fi |
52 | cmp $DATA ${COPY}.1 || fail "corrupted copy after get" | ||
53 | cmp $DATA ${COPY}.2 || fail "corrupted copy after put" | ||
60 | done | 54 | done |
61 | done | 55 | done |
62 | done | 56 | done |
63 | rm -f ${COPY}.1 ${COPY}.2 | ||
64 | rm -f $SFTPCMDFILE | ||
diff --git a/regress/ssh-com.sh b/regress/ssh-com.sh index 78ae6e9e1..c2bd15380 100644 --- a/regress/ssh-com.sh +++ b/regress/ssh-com.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: ssh-com.sh,v 1.5 2003/05/14 22:08:27 markus Exp $ | 1 | # $OpenBSD: ssh-com.sh,v 1.4 2002/07/16 08:58:16 markus Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="connect to ssh.com server" | 4 | tid="connect to ssh.com server" |
@@ -18,8 +18,6 @@ VERSIONS=" | |||
18 | 3.0.0 | 18 | 3.0.0 |
19 | 3.1.0 | 19 | 3.1.0 |
20 | 3.2.0 | 20 | 3.2.0 |
21 | 3.2.2 | ||
22 | 3.2.3 | ||
23 | 3.3.0" | 21 | 3.3.0" |
24 | # 2.0.10 does not support UserConfigDirectory | 22 | # 2.0.10 does not support UserConfigDirectory |
25 | # 2.3.1 requires a config in $HOME/.ssh2 | 23 | # 2.3.1 requires a config in $HOME/.ssh2 |
@@ -67,7 +65,7 @@ done | |||
67 | 65 | ||
68 | # convert and append DSA hostkey | 66 | # convert and append DSA hostkey |
69 | ( | 67 | ( |
70 | echon 'ssh2-localhost-with-alias,127.0.0.1,::1 ' | 68 | echo -n 'ssh2-localhost-with-alias,127.0.0.1,::1 ' |
71 | ${SSHKEYGEN} -if ${SRC}/dsa_ssh2.pub | 69 | ${SSHKEYGEN} -if ${SRC}/dsa_ssh2.pub |
72 | ) >> $OBJ/known_hosts | 70 | ) >> $OBJ/known_hosts |
73 | 71 | ||
diff --git a/regress/stderr-after-eof.sh b/regress/stderr-after-eof.sh index 05a5ea56d..bebd700bf 100644 --- a/regress/stderr-after-eof.sh +++ b/regress/stderr-after-eof.sh | |||
@@ -7,23 +7,13 @@ DATA=/etc/motd | |||
7 | DATA=${OBJ}/data | 7 | DATA=${OBJ}/data |
8 | COPY=${OBJ}/copy | 8 | COPY=${OBJ}/copy |
9 | 9 | ||
10 | if have_prog md5sum; then | 10 | MD5=md5sum |
11 | CHECKSUM=md5sum | ||
12 | elif have_prog openssl; then | ||
13 | CHECKSUM="openssl md5" | ||
14 | elif have_prog cksum; then | ||
15 | CHECKSUM=cksum | ||
16 | elif have_prog sum; then | ||
17 | CHECKSUM=sum | ||
18 | else | ||
19 | fatal "No checksum program available, aborting $tid test" | ||
20 | fi | ||
21 | 11 | ||
22 | # setup data | 12 | # setup data |
23 | rm -f ${DATA} ${COPY} | 13 | rm -f ${DATA} ${COPY} |
24 | cp /dev/null ${DATA} | 14 | cp /dev/null ${DATA} |
25 | for i in 1 2 3 4 5 6; do | 15 | for i in 1 2 3 4 5 6; do |
26 | (date;echo $i) | $CHECKSUM >> ${DATA} | 16 | (date;echo $i) | $MD5 >> ${DATA} |
27 | done | 17 | done |
28 | 18 | ||
29 | ${SSH} -2 -F $OBJ/ssh_proxy otherhost \ | 19 | ${SSH} -2 -F $OBJ/ssh_proxy otherhost \ |
diff --git a/regress/stderr-data.sh b/regress/stderr-data.sh index 1daf79bb5..0157690b0 100644 --- a/regress/stderr-data.sh +++ b/regress/stderr-data.sh | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | tid="stderr data transfer" | 4 | tid="stderr data transfer" |
5 | 5 | ||
6 | DATA=/bin/ls${EXEEXT} | 6 | DATA=/bin/ls |
7 | COPY=${OBJ}/copy | 7 | COPY=${OBJ}/copy |
8 | rm -f ${COPY} | 8 | rm -f ${COPY} |
9 | 9 | ||
diff --git a/regress/test-exec.sh b/regress/test-exec.sh index cc7ea67fe..a7a8ddbe6 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh | |||
@@ -2,16 +2,10 @@ | |||
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | PORT=4242 | 4 | PORT=4242 |
5 | USER=`id -un` | ||
6 | SUDO= | ||
5 | #SUDO=sudo | 7 | #SUDO=sudo |
6 | 8 | ||
7 | if [ -x /usr/ucb/whoami ]; then | ||
8 | USER=`/usr/ucb/whoami` | ||
9 | elif whoami >/dev/null 2>&1; then | ||
10 | USER=`whoami` | ||
11 | else | ||
12 | USER=`id -un` | ||
13 | fi | ||
14 | |||
15 | OBJ=$1 | 9 | OBJ=$1 |
16 | if [ "x$OBJ" = "x" ]; then | 10 | if [ "x$OBJ" = "x" ]; then |
17 | echo '$OBJ not defined' | 11 | echo '$OBJ not defined' |
@@ -78,32 +72,6 @@ export SSH SSHD SSHAGENT SSHADD SSHKEYGEN SSHKEYSCAN SFTP SFTPSERVER | |||
78 | #echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER | 72 | #echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER |
79 | 73 | ||
80 | # helper | 74 | # helper |
81 | echon() | ||
82 | { | ||
83 | if [ "x`echo -n`" = "x" ]; then | ||
84 | echo -n "$@" | ||
85 | elif [ "x`echo '\c'`" = "x" ]; then | ||
86 | echo "$@\c" | ||
87 | else | ||
88 | fatal "Don't know how to echo without newline." | ||
89 | fi | ||
90 | } | ||
91 | |||
92 | have_prog() | ||
93 | { | ||
94 | saved_IFS="$IFS" | ||
95 | IFS=":" | ||
96 | for i in $PATH | ||
97 | do | ||
98 | if [ -x $i/$1 ]; then | ||
99 | IFS="$saved_IFS" | ||
100 | return 0 | ||
101 | fi | ||
102 | done | ||
103 | IFS="$saved_IFS" | ||
104 | return 1 | ||
105 | } | ||
106 | |||
107 | cleanup () | 75 | cleanup () |
108 | { | 76 | { |
109 | if [ -f $PIDFILE ]; then | 77 | if [ -f $PIDFILE ]; then |
@@ -143,7 +111,7 @@ fail () | |||
143 | 111 | ||
144 | fatal () | 112 | fatal () |
145 | { | 113 | { |
146 | echon "FATAL: " | 114 | echo -n "FATAL: " |
147 | fail "$@" | 115 | fail "$@" |
148 | cleanup | 116 | cleanup |
149 | exit $RESULT | 117 | exit $RESULT |
@@ -162,7 +130,6 @@ cat << EOF > $OBJ/sshd_config | |||
162 | PidFile $PIDFILE | 130 | PidFile $PIDFILE |
163 | AuthorizedKeysFile $OBJ/authorized_keys_%u | 131 | AuthorizedKeysFile $OBJ/authorized_keys_%u |
164 | LogLevel QUIET | 132 | LogLevel QUIET |
165 | StrictModes no | ||
166 | EOF | 133 | EOF |
167 | 134 | ||
168 | # server config for proxy connects | 135 | # server config for proxy connects |
@@ -202,7 +169,7 @@ for t in rsa rsa1; do | |||
202 | 169 | ||
203 | # known hosts file for client | 170 | # known hosts file for client |
204 | ( | 171 | ( |
205 | echon 'localhost-with-alias,127.0.0.1,::1 ' | 172 | echo -n 'localhost-with-alias,127.0.0.1,::1 ' |
206 | cat $OBJ/$t.pub | 173 | cat $OBJ/$t.pub |
207 | ) >> $OBJ/known_hosts | 174 | ) >> $OBJ/known_hosts |
208 | 175 | ||
@@ -222,7 +189,7 @@ chmod 644 $OBJ/authorized_keys_$USER | |||
222 | # create a proxy version of the client config | 189 | # create a proxy version of the client config |
223 | ( | 190 | ( |
224 | cat $OBJ/ssh_config | 191 | cat $OBJ/ssh_config |
225 | echo proxycommand ${SUDO} ${SSHD} -i -f $OBJ/sshd_proxy | 192 | echo proxycommand ${SSHD} -i -f $OBJ/sshd_proxy |
226 | ) > $OBJ/ssh_proxy | 193 | ) > $OBJ/ssh_proxy |
227 | 194 | ||
228 | # check proxy config | 195 | # check proxy config |
@@ -236,7 +203,7 @@ start_sshd () | |||
236 | 203 | ||
237 | trace "wait for sshd" | 204 | trace "wait for sshd" |
238 | i=0; | 205 | i=0; |
239 | while [ ! -f $PIDFILE -a $i -lt 10 ]; do | 206 | while [ ! -f $PIDFILE -a $i -lt 5 ]; do |
240 | i=`expr $i + 1` | 207 | i=`expr $i + 1` |
241 | sleep $i | 208 | sleep $i |
242 | done | 209 | done |
diff --git a/regress/transfer.sh b/regress/transfer.sh index 13ea367d5..31cdc0ce3 100644 --- a/regress/transfer.sh +++ b/regress/transfer.sh | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | tid="transfer data" | 4 | tid="transfer data" |
5 | 5 | ||
6 | DATA=/bin/ls${EXEEXT} | 6 | DATA=/bin/ls |
7 | COPY=${OBJ}/copy | 7 | COPY=${OBJ}/copy |
8 | 8 | ||
9 | for p in 1 2; do | 9 | for p in 1 2; do |
diff --git a/regress/try-ciphers.sh b/regress/try-ciphers.sh index 2c727f66c..161f039c0 100644 --- a/regress/try-ciphers.sh +++ b/regress/try-ciphers.sh | |||
@@ -1,11 +1,10 @@ | |||
1 | # $OpenBSD: try-ciphers.sh,v 1.8 2003/06/12 15:40:01 markus Exp $ | 1 | # $OpenBSD: try-ciphers.sh,v 1.7 2002/04/03 09:30:01 markus Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="try ciphers" | 4 | tid="try ciphers" |
5 | 5 | ||
6 | ciphers="aes128-cbc 3des-cbc blowfish-cbc cast128-cbc arcfour | 6 | ciphers="aes128-cbc 3des-cbc blowfish-cbc cast128-cbc arcfour |
7 | aes192-cbc aes256-cbc rijndael-cbc@lysator.liu.se | 7 | aes192-cbc aes256-cbc rijndael-cbc@lysator.liu.se" |
8 | aes128-ctr aes192-ctr aes256-ctr" | ||
9 | macs="hmac-sha1 hmac-md5 hmac-sha1-96 hmac-md5-96" | 8 | macs="hmac-sha1 hmac-md5 hmac-sha1-96 hmac-md5-96" |
10 | 9 | ||
11 | for c in $ciphers; do | 10 | for c in $ciphers; do |
diff --git a/regress/yes-head.sh b/regress/yes-head.sh index 17a4d0dd4..f213f6863 100644 --- a/regress/yes-head.sh +++ b/regress/yes-head.sh | |||
@@ -4,7 +4,7 @@ | |||
4 | tid="yes pipe head" | 4 | tid="yes pipe head" |
5 | 5 | ||
6 | for p in 1 2; do | 6 | for p in 1 2; do |
7 | lines=`${SSH} -$p -F $OBJ/ssh_proxy thishost 'sh -c "while true;do echo yes;done | head -2000"' | (sleep 3 ; wc -l)` | 7 | lines=`${SSH} -$p -F $OBJ/ssh_proxy thishost 'yes | head -2000' | (sleep 3 ; wc -l)` |
8 | if [ $? -ne 0 ]; then | 8 | if [ $? -ne 0 ]; then |
9 | fail "yes|head test failed" | 9 | fail "yes|head test failed" |
10 | lines = 0; | 10 | lines = 0; |