summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
Diffstat (limited to 'regress')
-rw-r--r--regress/Makefile61
-rw-r--r--regress/README.regress86
-rw-r--r--regress/agent-getpeereid.sh6
-rw-r--r--regress/agent-ptrace.sh18
-rw-r--r--regress/agent-timeout.sh12
-rw-r--r--regress/agent.sh2
-rw-r--r--regress/authorized_keys_root2
-rwxr-xr-xregress/copy.1bin0 -> 45948 bytes
-rwxr-xr-xregress/copy.2bin0 -> 45948 bytes
-rw-r--r--regress/dynamic-forward.sh47
-rw-r--r--regress/forwarding.sh7
-rw-r--r--regress/proto-version.sh2
-rw-r--r--regress/reconfigure.sh35
-rw-r--r--regress/rekey.sh31
-rw-r--r--regress/sftp-badcmds.sh78
-rw-r--r--regress/sftp-batch.sh4
-rw-r--r--regress/sftp-cmds.sh109
-rw-r--r--regress/sftp.sh26
-rw-r--r--regress/ssh-com-client.sh6
-rw-r--r--regress/ssh-com-keygen.sh4
-rw-r--r--regress/ssh-com-sftp.sh28
-rw-r--r--regress/ssh-com.sh6
-rw-r--r--regress/stderr-after-eof.sh14
-rw-r--r--regress/stderr-data.sh2
-rw-r--r--regress/test-exec.sh45
-rw-r--r--regress/transfer.sh2
-rw-r--r--regress/try-ciphers.sh5
-rw-r--r--regress/yes-head.sh2
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
3REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t-exec 3REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7
4tests: $(REGRESS_TARGETS)
5 4
6clean: 5CLEANFILES+= 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
8distclean: clean
9 6
10LTESTS= connect \ 7LTESTS= 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
37USER!= id -un 30USER!= id -un
38CLEANFILES= t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \ 31CLEANFILES+= 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
47t1: 39t1:
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
50t2: 42t2:
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
55t3: 47t3:
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
60t4: 52t4:
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
68t6: 60t6:
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: 66t7.out:
75 ssh-keygen -q -t rsa -N '' -f $@ 67 ssh-keygen -q -t rsa -N '' -f $@
76 68
77t7: $(OBJ)/t7.out 69t7: 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
81t-exec: ${LTESTS:=.sh} 73.for t in ${LTESTS}
82 @if [ "x$?" = "x" ]; then exit 0; fi; \ 74REGRESS_TARGETS+=t-${t}
83 for TEST in ""$?; do \ 75t-${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 @@
1Overview.
2
3$ ./configure && make tests
4
5You'll see some progress info. A failure will cause either the make to
6abort or the driver script to report a "FATAL" failure.
7
8The test consists of 2 parts. The first is the file-based tests which is
9driven by the Makefile, and the second is a set of network or proxycommand
10based tests, which are driven by a driver script (test-exec.sh) which is
11called multiple times by the Makefile.
12
13Failures in the first part will cause the Makefile to return an error.
14Failures in the second part will print a "FATAL" message for the failed
15test and continue.
16
17OpenBSD has a system-wide regression test suite. OpenSSH Portable's test
18suite is based on OpenBSD's with modifications.
19
20
21Environment variables.
22
23SUDO: path to sudo command, if desired. Note that some systems (notably
24 systems using PAM) require sudo to execute some tests.
25TEST_SSH_TRACE: set yo "yes" for verbose output from tests
26TEST_SSH_QUIET: set to "yes" to suppress non-fatal output.
27TEST_SSH_x: path to "ssh" command under test, where x=SSH,SSHD,SSHAGENT,SSHADD
28 SSHKEYGEN,SSHKEYSCAN,SFTP,SFTPSERVER
29OBJ: used by test scripts to access build dir.
30
31
32Individual tests.
33
34You can invoke test-exec.sh directly if you set up the path to find the
35binaries 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
39ok agent timeout test
40
41
42Files.
43
44test-exec.sh: the main test driver. Sets environment, creates config files
45and keys and runs the specified test.
46
47At the time of writing, the individual tests are:
48agent-timeout.sh: agent timeout test
49agent.sh: simple agent test
50broken-pipe.sh: broken pipe test
51connect-privsep.sh: proxy connect with privsep
52connect.sh: simple connect
53exit-status.sh: remote exit status
54forwarding.sh: local and remote forwarding
55keygen-change.sh: change passphrase for key
56keyscan.sh: keyscan
57proto-mismatch.sh: protocol version mismatch
58proto-version.sh: sshd version with different protocol combinations
59proxy-connect.sh: proxy connect
60sftp.sh: basic sftp put/get
61ssh-com-client.sh: connect with ssh.com client
62ssh-com-keygen.sh: ssh.com key import
63ssh-com-sftp.sh: basic sftp put/get with ssh.com server
64ssh-com.sh: connect to ssh.com server
65stderr-after-eof.sh: stderr data after eof
66stderr-data.sh: stderr data transfer
67transfer.sh: transfer data
68try-ciphers.sh: try ciphers
69yes-head.sh: yes pipe head
70
71
72Problems?
73
74Run the failing test with shell tracing (-x) turned on:
75$ PATH=`pwd`/..:$PATH:. sh -x test-exec.sh `pwd` agent-timeout.sh
76
77Failed 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
83Known 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
7ASOCK=${OBJ}/agent 7ASOCK=${OBJ}/agent
8SSH_AUTH_SOCK=/nonexistant 8SSH_AUTH_SOCK=/nonexistant
9 9
10if grep "#undef.*HAVE_GETPEEREID" ${BUILDDIR}/config.h >/dev/null 2>&1
11then
12 echo "skipped (not supported on this platform)"
13 exit 0
14fi
15
16trace "start agent" 10trace "start agent"
17eval `${SSHAGENT} -s -a ${ASOCK}` > /dev/null 11eval `${SSHAGENT} -s -a ${ASOCK}` > /dev/null
18r=$? 12r=$?
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
4tid="disallow agent ptrace attach" 4tid="disallow agent ptrace attach"
5 5
6if 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
13fi
14
15if have_prog gdb ; then
16 : ok
17else
18 echo "skipped (gdb not found)"
19 exit 0
20fi
21
22trace "start agent" 6trace "start agent"
23eval `${SSHAGENT} -s` > /dev/null 7eval `${SSHAGENT} -s` > /dev/null
24r=$? 8r=$?
@@ -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
4tid="agent timeout test" 4tid="agent timeout test"
5 5
6SSHAGENT_TIMEOUT=10 6TIMEOUT=5
7 7
8trace "start agent" 8trace "start agent"
9eval `${SSHAGENT} -s` > /dev/null 9eval `${SSHAGENT} -s` > /dev/null
@@ -13,7 +13,7 @@ if [ $r -ne 0 ]; then
13else 13else
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 @@
1ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAt6ttBacbgvLPsF1VWWfT51t55/5Mj62Xp8EaoH5SNSaLiGIgrrja077lKEept75U4uKFUYU5JJX9GPE9A7Y43LXv+/A6Jm4rEj/U0s4H8tf0UmzVC3t6xh0sRK0hYVNILyoHnIAgdY8CmOiybw7p6DxJY8MRAehD3n9+kFcachU= root@xenon
21024 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
4tid="dynamic forwarding"
5
6PORT=4242
7FWDPORT=4243
8DATA=/bin/ls${EXEEXT}
9
10if have_prog nc && nc -h 2>&1 | grep "x proxy address" >/dev/null; then
11 proxycmd="nc -x 127.0.0.1:$FWDPORT -X"
12elif have_prog connect; then
13 proxycmd="connect -S 127.0.0.1:$FWDPORT -"
14else
15 echo "skipped (no suitable ProxyCommand found)"
16 exit 0
17fi
18trace "will use ProxyCommand $proxycmd"
19
20start_sshd
21
22for 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
47done
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
4tid="local and remote forwarding" 4tid="local and remote forwarding"
5DATA=/bin/ls${EXEEXT}
6 5
7start_sshd 6start_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
34done 33done
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
4tid="simple connect after reconfigure"
5
6# we need the full path to sshd for -HUP
7case $SSHD in
8/*)
9 # full path is OK
10 ;;
11*)
12 # otherwise make fully qualified
13 SSHD=$OBJ/$SSHD
14esac
15
16start_sshd
17
18$SUDO kill -HUP `cat $PIDFILE`
19sleep 1
20
21trace "wait for sshd to restart"
22i=0;
23while [ ! -f $PIDFILE -a $i -lt 10 ]; do
24 i=`expr $i + 1`
25 sleep $i
26done
27
28test -f $PIDFILE || fatal "sshd did not restart"
29
30for 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
35done
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
4tid="rekey during transfer data"
5
6DATA=${OBJ}/data
7COPY=${OBJ}/copy
8LOG=${OBJ}/log
9
10rm -f ${COPY} ${LOG} ${DATA}
11dd if=/bin/ls${EXEEXT} of=${DATA} bs=1k seek=511 count=1 > /dev/null 2>&1
12
13for 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
30done
31rm -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
4tid="sftp invalid commands"
5
6DATA=/bin/ls${EXEEXT}
7DATA2=/bin/cat${EXEEXT}
8NONEXIST=/NONEXIST.$$
9COPY=${OBJ}/copy
10GLOBFILES=`(cd /bin;echo l*)`
11
12rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd
13
14rm -f ${COPY}
15verbose "$tid: get nonexistent"
16echo "get $NONEXIST $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
17 || fail "get nonexistent failed"
18test -f ${COPY} && fail "existing copy after get nonexistent"
19
20rm -f ${COPY}.dd/*
21verbose "$tid: glob get to nonexistent directory"
22echo "get /bin/l* $NONEXIST" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
23 || fail "get nonexistent failed"
24for x in $GLOBFILES; do
25 test -f ${COPY}.dd/$x && fail "existing copy after get nonexistent"
26done
27
28rm -f ${COPY}
29verbose "$tid: put nonexistent"
30echo "put $NONEXIST $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
31 || fail "put nonexistent failed"
32test -f ${COPY} && fail "existing copy after put nonexistent"
33
34rm -f ${COPY}.dd/*
35verbose "$tid: glob put to nonexistent directory"
36echo "put /bin/l* ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
37 || fail "put nonexistent failed"
38for x in $GLOBFILES; do
39 test -f ${COPY}.dd/$x && fail "existing copy after nonexistent"
40done
41
42rm -f ${COPY}
43verbose "$tid: rename nonexistent"
44echo "rename $NONEXIST ${COPY}.1" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
45 || fail "rename nonexist failed"
46test -f ${COPY}.1 && fail "file exists after rename nonexistent"
47
48rm -f ${COPY} ${COPY}.1
49cp $DATA $COPY
50cp $DATA2 ${COPY}.1
51verbose "$tid: rename target exists"
52echo "rename $COPY ${COPY}.1" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
53 || fail "rename target exists failed"
54test -f ${COPY} || fail "oldname missing after rename target exists"
55test -f ${COPY}.1 || fail "newname missing after rename target exists"
56cmp $DATA ${COPY} >/dev/null 2>&1 || fail "corrupted oldname after rename target exists"
57cmp $DATA2 ${COPY}.1 >/dev/null 2>&1 || fail "corrupted newname after rename target exists"
58
59rm -rf ${COPY} ${COPY}.dd
60cp $DATA $COPY
61mkdir ${COPY}.dd
62verbose "$tid: rename target exists (directory)"
63echo "rename $COPY ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
64 || fail "rename target exists (directory) failed"
65test -f ${COPY} || fail "oldname missing after rename target exists (directory)"
66test -d ${COPY}.dd || fail "newname missing after rename target exists (directory)"
67cmp $DATA ${COPY} >/dev/null 2>&1 || fail "corrupted oldname after rename target exists (directory)"
68
69rm -f ${COPY}.dd/*
70rm -rf ${COPY}
71cp ${DATA2} ${COPY}
72verbose "$tid: glob put files to local file"
73echo "put /bin/l* $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1
74cmp ${DATA2} ${COPY} || fail "put successed when it should have failed"
75
76rm -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
4tid="sftp batchfile" 4tid="sftp batchfile"
5 5
6DATA=/bin/ls${EXEEXT} 6DATA=/bin/ls
7COPY=${OBJ}/copy 7COPY=${OBJ}/copy
8BATCH=${OBJ}/sftp-batch.tmp 8BATCH=${OBJ}/sftp-batch
9 9
10rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.* 10rm -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
8tid="sftp commands" 9tid="sftp commands"
9 10
10DATA=/bin/ls${EXEEXT} 11DATA=/bin/ls
11COPY=${OBJ}/copy 12COPY=${OBJ}/copy
12# test that these files are readable! 13
13for i in `(cd /bin;echo l*)` 14rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.*
14do
15 if [ -r $i ]; then
16 GLOBFILES="$GLOBFILES $i"
17 fi
18done
19
20if have_prog uname
21then
22 case `uname` in
23 CYGWIN*)
24 os=cygwin
25 ;;
26 *)
27 os=`uname`
28 ;;
29 esac
30else
31 os="unknown"
32fi
33
34# Path with embedded quote
35QUOTECOPY=${COPY}".\"blah\""
36QUOTECOPY_ARG=${COPY}'.\"blah\"'
37
38rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${COPY}.dd2
39mkdir ${COPY}.dd
40 15
41verbose "$tid: lls" 16verbose "$tid: lls"
42echo "lls ${OBJ}" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ 17echo "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"
80cmp $DATA ${COPY} || fail "corrupted copy after get" 55cmp $DATA ${COPY} || fail "corrupted copy after get"
81 56
82rm -f ${COPY}.dd/*
83verbose "$tid: get to directory"
84echo "get $DATA ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
85 || fail "get failed"
86cmp $DATA ${COPY}.dd/`basename $DATA` || fail "corrupted copy after get"
87
88rm -f ${COPY}.dd/*
89verbose "$tid: glob get to directory"
90echo "get /bin/l* ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
91 || fail "get failed"
92for x in $GLOBFILES; do
93 cmp /bin/$x ${COPY}.dd/$x || fail "corrupted copy after get"
94done
95
96rm -f ${COPY}.dd/*
97verbose "$tid: get to local dir"
98(echo "lcd ${COPY}.dd"; echo "get $DATA" ) | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
99 || fail "get failed"
100cmp $DATA ${COPY}.dd/`basename $DATA` || fail "corrupted copy after get"
101
102rm -f ${COPY}.dd/*
103verbose "$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"
106for x in $GLOBFILES; do
107 cmp /bin/$x ${COPY}.dd/$x || fail "corrupted copy after get"
108done
109
110rm -f ${COPY} 57rm -f ${COPY}
111verbose "$tid: put" 58verbose "$tid: put"
112echo "put $DATA $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ 59echo "put $DATA $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
113 || fail "put failed" 60 || fail "put failed"
114cmp $DATA ${COPY} || fail "corrupted copy after put" 61cmp $DATA ${COPY} || fail "corrupted copy after put"
115 62
116if [ "$os" != "cygwin" ]; then
117rm -f ${QUOTECOPY}
118verbose "$tid: put filename with quotes"
119echo "put $DATA \"$QUOTECOPY_ARG\"" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
120 || fail "put failed"
121cmp $DATA ${QUOTECOPY} || fail "corrupted copy after put with quotes"
122fi
123
124rm -f ${COPY}.dd/*
125verbose "$tid: put to directory"
126echo "put $DATA ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
127 || fail "put failed"
128cmp $DATA ${COPY}.dd/`basename $DATA` || fail "corrupted copy after put"
129
130rm -f ${COPY}.dd/*
131verbose "$tid: glob put to directory"
132echo "put /bin/l* ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
133 || fail "put failed"
134for x in $GLOBFILES; do
135 cmp /bin/$x ${COPY}.dd/$x || fail "corrupted copy after put"
136done
137
138rm -f ${COPY}.dd/*
139verbose "$tid: put to local dir"
140(echo "cd ${COPY}.dd"; echo "put $DATA") | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
141 || fail "put failed"
142cmp $DATA ${COPY}.dd/`basename $DATA` || fail "corrupted copy after put"
143
144rm -f ${COPY}.dd/*
145verbose "$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"
148for x in $GLOBFILES; do
149 cmp /bin/$x ${COPY}.dd/$x || fail "corrupted copy after put"
150done
151
152verbose "$tid: rename" 63verbose "$tid: rename"
153echo "rename $COPY ${COPY}.1" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ 64echo "rename $COPY ${COPY}.1" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
154 || fail "rename failed" 65 || fail "rename failed"
155test -f ${COPY}.1 || fail "missing file after rename" 66test -f ${COPY}.1 || fail "missing file after rename"
156cmp $DATA ${COPY}.1 >/dev/null 2>&1 || fail "corrupted copy after rename" 67cmp $DATA ${COPY}.1 >/dev/null 2>&1 || fail "corrupted copy after rename"
157 68
158verbose "$tid: rename directory"
159echo "rename ${COPY}.dd ${COPY}.dd2" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
160 || fail "rename directory failed"
161test -d ${COPY}.dd && fail "oldname exists after rename directory"
162test -d ${COPY}.dd2 || fail "missing newname after rename directory"
163
164verbose "$tid: ln" 69verbose "$tid: ln"
165echo "ln ${COPY}.1 ${COPY}.2" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 || fail "ln failed" 70echo "ln ${COPY}.1 ${COPY}.2" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 || fail "ln failed"
166test -h ${COPY}.2 || fail "missing file after ln" 71test -L ${COPY}.2 || fail "missing file after ln"
167 72
168verbose "$tid: mkdir" 73verbose "$tid: mkdir"
169echo "mkdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ 74echo "mkdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
@@ -190,6 +95,6 @@ verbose "$tid: lchdir"
190echo "lchdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ 95echo "lchdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
191 || fail "lchdir failed" 96 || fail "lchdir failed"
192 97
193rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${COPY}.dd2 98rm -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
4tid="basic sftp put/get" 4tid="basic sftp put/get"
5 5
6DATA=/bin/ls${EXEEXT} 6DATA=/bin/ls
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
16BUFFERSIZE="5 1000 32000 64000" 9BUFFERSIZE="5 1000 32000 64000"
17REQUESTS="1 2 10" 10REQUESTS="1 2 10"
18 11
19for B in ${BUFFERSIZE}; do 12for 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
21EOF
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
33done 29done
34rm -f ${COPY}.1 ${COPY}.2
35rm -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
4tid="connect with ssh.com client" 4tid="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)
65start_sshd 63start_sshd
66 64
67DATA=/bin/ls${EXEEXT} 65DATA=/bin/ls
68COPY=${OBJ}/copy 66COPY=${OBJ}/copy
69rm -f ${COPY} 67rm -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
4tid="ssh.com key import" 4tid="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
27COMPRV=${OBJ}/comkey 25COMPRV=${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
4tid="basic sftp put/get with ssh.com server" 4tid="basic sftp put/get with ssh.com server"
5 5
6DATA=/bin/ls${EXEEXT} 6DATA=/bin/ls
7COPY=${OBJ}/copy 7COPY=${OBJ}/copy
8SFTPCMDFILE=${OBJ}/batch
9
10cat >$SFTPCMDFILE <<EOF
11version
12get $DATA ${COPY}.1
13put $DATA ${COPY}.2
14EOF
15 8
16BUFFERSIZE="5 1000 32000 64000" 9BUFFERSIZE="5 1000 32000 64000"
17REQUESTS="1 2 10" 10REQUESTS="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
47EOF
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
62done 56done
63rm -f ${COPY}.1 ${COPY}.2
64rm -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
4tid="connect to ssh.com server" 4tid="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
7DATA=${OBJ}/data 7DATA=${OBJ}/data
8COPY=${OBJ}/copy 8COPY=${OBJ}/copy
9 9
10if have_prog md5sum; then 10MD5=md5sum
11 CHECKSUM=md5sum
12elif have_prog openssl; then
13 CHECKSUM="openssl md5"
14elif have_prog cksum; then
15 CHECKSUM=cksum
16elif have_prog sum; then
17 CHECKSUM=sum
18else
19 fatal "No checksum program available, aborting $tid test"
20fi
21 11
22# setup data 12# setup data
23rm -f ${DATA} ${COPY} 13rm -f ${DATA} ${COPY}
24cp /dev/null ${DATA} 14cp /dev/null ${DATA}
25for i in 1 2 3 4 5 6; do 15for i in 1 2 3 4 5 6; do
26 (date;echo $i) | $CHECKSUM >> ${DATA} 16 (date;echo $i) | $MD5 >> ${DATA}
27done 17done
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
4tid="stderr data transfer" 4tid="stderr data transfer"
5 5
6DATA=/bin/ls${EXEEXT} 6DATA=/bin/ls
7COPY=${OBJ}/copy 7COPY=${OBJ}/copy
8rm -f ${COPY} 8rm -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
4PORT=4242 4PORT=4242
5USER=`id -un`
6SUDO=
5#SUDO=sudo 7#SUDO=sudo
6 8
7if [ -x /usr/ucb/whoami ]; then
8 USER=`/usr/ucb/whoami`
9elif whoami >/dev/null 2>&1; then
10 USER=`whoami`
11else
12 USER=`id -un`
13fi
14
15OBJ=$1 9OBJ=$1
16if [ "x$OBJ" = "x" ]; then 10if [ "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
81echon()
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
92have_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
107cleanup () 75cleanup ()
108{ 76{
109 if [ -f $PIDFILE ]; then 77 if [ -f $PIDFILE ]; then
@@ -143,7 +111,7 @@ fail ()
143 111
144fatal () 112fatal ()
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
166EOF 133EOF
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
4tid="transfer data" 4tid="transfer data"
5 5
6DATA=/bin/ls${EXEEXT} 6DATA=/bin/ls
7COPY=${OBJ}/copy 7COPY=${OBJ}/copy
8 8
9for p in 1 2; do 9for 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
4tid="try ciphers" 4tid="try ciphers"
5 5
6ciphers="aes128-cbc 3des-cbc blowfish-cbc cast128-cbc arcfour 6ciphers="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"
9macs="hmac-sha1 hmac-md5 hmac-sha1-96 hmac-md5-96" 8macs="hmac-sha1 hmac-md5 hmac-sha1-96 hmac-md5-96"
10 9
11for c in $ciphers; do 10for 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 @@
4tid="yes pipe head" 4tid="yes pipe head"
5 5
6for p in 1 2; do 6for 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;