summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
Diffstat (limited to 'regress')
-rw-r--r--regress/Makefile6
-rw-r--r--regress/cfgmatch.sh4
-rw-r--r--regress/integrity.sh4
-rw-r--r--regress/multiplex.sh14
-rw-r--r--regress/rekey.sh6
-rw-r--r--regress/test-exec.sh33
6 files changed, 41 insertions, 26 deletions
diff --git a/regress/Makefile b/regress/Makefile
index 6ef5d9cce..b99bd3e83 100644
--- a/regress/Makefile
+++ b/regress/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.62 2013/01/18 00:45:29 djm Exp $ 1# $OpenBSD: Makefile,v 1.63 2013/04/06 06:00:22 dtucker Exp $
2 2
3REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t8 t9 t-exec 3REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t8 t9 t-exec
4tests: $(REGRESS_TARGETS) 4tests: $(REGRESS_TARGETS)
@@ -82,8 +82,8 @@ CLEANFILES= t2.out t3.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \
82 putty.rsa2 sshd_proxy_orig ssh_proxy_bak \ 82 putty.rsa2 sshd_proxy_orig ssh_proxy_bak \
83 key.rsa-* key.dsa-* key.ecdsa-* \ 83 key.rsa-* key.dsa-* key.ecdsa-* \
84 authorized_principals_${USER} expect actual ready \ 84 authorized_principals_${USER} expect actual ready \
85 sshd_proxy.* authorized_keys_${USER}.* modpipe revoked-* krl-* 85 sshd_proxy.* authorized_keys_${USER}.* modpipe revoked-* krl-* \
86 86 ssh.log sshd.log regress.log
87 87
88# Enable all malloc(3) randomisations and checks 88# Enable all malloc(3) randomisations and checks
89TEST_ENV= "MALLOC_OPTIONS=AFGJPRX" 89TEST_ENV= "MALLOC_OPTIONS=AFGJPRX"
diff --git a/regress/cfgmatch.sh b/regress/cfgmatch.sh
index 0603fab64..02755d9d0 100644
--- a/regress/cfgmatch.sh
+++ b/regress/cfgmatch.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: cfgmatch.sh,v 1.6 2011/06/03 05:35:10 dtucker Exp $ 1# $OpenBSD: cfgmatch.sh,v 1.7 2013/04/06 06:00:22 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="sshd_config match" 4tid="sshd_config match"
@@ -15,7 +15,7 @@ start_client()
15 rm -f $pidfile 15 rm -f $pidfile
16 ${SSH} -q -$p $fwd "$@" somehost \ 16 ${SSH} -q -$p $fwd "$@" somehost \
17 exec sh -c \'"echo \$\$ > $pidfile; exec sleep 100"\' \ 17 exec sh -c \'"echo \$\$ > $pidfile; exec sleep 100"\' \
18 >>$TEST_SSH_LOGFILE 2>&1 & 18 >>$TEST_REGRESS_LOGFILE 2>&1 &
19 client_pid=$! 19 client_pid=$!
20 # Wait for remote end 20 # Wait for remote end
21 n=0 21 n=0
diff --git a/regress/integrity.sh b/regress/integrity.sh
index 4d46926d5..1bd330a18 100644
--- a/regress/integrity.sh
+++ b/regress/integrity.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: integrity.sh,v 1.7 2013/02/20 08:27:50 djm Exp $ 1# $OpenBSD: integrity.sh,v 1.8 2013/04/06 06:00:22 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="integrity" 4tid="integrity"
@@ -22,7 +22,7 @@ config_defined OPENSSL_HAVE_EVPGCM && \
22 macs="$macs aes128-gcm@openssh.com aes256-gcm@openssh.com" 22 macs="$macs aes128-gcm@openssh.com aes256-gcm@openssh.com"
23 23
24# sshd-command for proxy (see test-exec.sh) 24# sshd-command for proxy (see test-exec.sh)
25cmd="$SUDO sh ${SRC}/sshd-log-wrapper.sh ${SSHD} ${TEST_SSH_LOGFILE} -i -f $OBJ/sshd_proxy" 25cmd="$SUDO sh ${SRC}/sshd-log-wrapper.sh ${SSHD} ${TEST_SSHD_LOGFILE} -i -f $OBJ/sshd_proxy"
26 26
27jot() { 27jot() {
28 awk "BEGIN { for (i = $2; i < $2 + $1; i++) { printf \"%d\n\", i } exit }" 28 awk "BEGIN { for (i = $2; i < $2 + $1; i++) { printf \"%d\n\", i } exit }"
diff --git a/regress/multiplex.sh b/regress/multiplex.sh
index 1e6cc7606..6491837a4 100644
--- a/regress/multiplex.sh
+++ b/regress/multiplex.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: multiplex.sh,v 1.17 2012/10/05 02:05:30 dtucker Exp $ 1# $OpenBSD: multiplex.sh,v 1.18 2013/04/06 06:00:22 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4CTL=/tmp/openssh.regress.ctl-sock.$$ 4CTL=/tmp/openssh.regress.ctl-sock.$$
@@ -55,13 +55,13 @@ cmp ${DATA} ${COPY} || fail "ssh -S ctl: corrupted copy of ${DATA}"
55rm -f ${COPY} 55rm -f ${COPY}
56trace "sftp transfer over multiplexed connection and check result" 56trace "sftp transfer over multiplexed connection and check result"
57echo "get ${DATA} ${COPY}" | \ 57echo "get ${DATA} ${COPY}" | \
58 ${SFTP} -S ${SSH} -F $OBJ/ssh_config -oControlPath=$CTL otherhost >>$TEST_SSH_LOGFILE 2>&1 58 ${SFTP} -S ${SSH} -F $OBJ/ssh_config -oControlPath=$CTL otherhost >>$TEST_REGRESS_LOGFILE 2>&1
59test -f ${COPY} || fail "sftp: failed copy ${DATA}" 59test -f ${COPY} || fail "sftp: failed copy ${DATA}"
60cmp ${DATA} ${COPY} || fail "sftp: corrupted copy of ${DATA}" 60cmp ${DATA} ${COPY} || fail "sftp: corrupted copy of ${DATA}"
61 61
62rm -f ${COPY} 62rm -f ${COPY}
63trace "scp transfer over multiplexed connection and check result" 63trace "scp transfer over multiplexed connection and check result"
64${SCP} -S ${SSH} -F $OBJ/ssh_config -oControlPath=$CTL otherhost:${DATA} ${COPY} >>$TEST_SSH_LOGFILE 2>&1 64${SCP} -S ${SSH} -F $OBJ/ssh_config -oControlPath=$CTL otherhost:${DATA} ${COPY} >>$TEST_REGRESS_LOGFILE 2>&1
65test -f ${COPY} || fail "scp: failed copy ${DATA}" 65test -f ${COPY} || fail "scp: failed copy ${DATA}"
66cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}" 66cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}"
67 67
@@ -87,11 +87,11 @@ for s in 0 1 4 5 44; do
87done 87done
88 88
89verbose "test $tid: cmd check" 89verbose "test $tid: cmd check"
90${SSH} -F $OBJ/ssh_config -S $CTL -Ocheck otherhost >>$TEST_SSH_LOGFILE 2>&1 \ 90${SSH} -F $OBJ/ssh_config -S $CTL -Ocheck otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \
91 || fail "check command failed" 91 || fail "check command failed"
92 92
93verbose "test $tid: cmd exit" 93verbose "test $tid: cmd exit"
94${SSH} -F $OBJ/ssh_config -S $CTL -Oexit otherhost >>$TEST_SSH_LOGFILE 2>&1 \ 94${SSH} -F $OBJ/ssh_config -S $CTL -Oexit otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \
95 || fail "send exit command failed" 95 || fail "send exit command failed"
96 96
97# Wait for master to exit 97# Wait for master to exit
@@ -107,9 +107,9 @@ wait_for_mux_master_ready
107 107
108# start a long-running command then immediately request a stop 108# start a long-running command then immediately request a stop
109${SSH} -F $OBJ/ssh_config -S $CTL otherhost "sleep 10; exit 0" \ 109${SSH} -F $OBJ/ssh_config -S $CTL otherhost "sleep 10; exit 0" \
110 >>$TEST_SSH_LOGFILE 2>&1 & 110 >>$TEST_REGRESS_LOGFILE 2>&1 &
111SLEEP_PID=$! 111SLEEP_PID=$!
112${SSH} -F $OBJ/ssh_config -S $CTL -Ostop otherhost >>$TEST_SSH_LOGFILE 2>&1 \ 112${SSH} -F $OBJ/ssh_config -S $CTL -Ostop otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \
113 || fail "send stop command failed" 113 || fail "send stop command failed"
114 114
115# wait until both long-running command and master have exited. 115# wait until both long-running command and master have exited.
diff --git a/regress/rekey.sh b/regress/rekey.sh
index 3c5f266fc..b23cfca70 100644
--- a/regress/rekey.sh
+++ b/regress/rekey.sh
@@ -1,11 +1,11 @@
1# $OpenBSD: rekey.sh,v 1.1 2003/03/28 13:58:28 markus Exp $ 1# $OpenBSD: rekey.sh,v 1.2 2013/04/06 06:00:22 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="rekey during transfer data" 4tid="rekey during transfer data"
5 5
6DATA=${OBJ}/data 6DATA=${OBJ}/data
7COPY=${OBJ}/copy 7COPY=${OBJ}/copy
8LOG=${OBJ}/log 8LOG=${TEST_SSH_LOGFILE}
9 9
10rm -f ${COPY} ${LOG} ${DATA} 10rm -f ${COPY} ${LOG} ${DATA}
11touch ${DATA} 11touch ${DATA}
@@ -29,4 +29,4 @@ for s in 16 1k 128k 256k; do
29 fail "no rekeying occured" 29 fail "no rekeying occured"
30 fi 30 fi
31done 31done
32rm -f ${COPY} ${LOG} ${DATA} 32rm -f ${COPY} ${DATA}
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index 29dac3de9..b02172c03 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: test-exec.sh,v 1.38 2013/03/23 11:09:43 dtucker Exp $ 1# $OpenBSD: test-exec.sh,v 1.39 2013/04/06 06:00:22 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4#SUDO=sudo 4#SUDO=sudo
@@ -136,9 +136,24 @@ case "$SSHD" in
136*) SSHD=`which sshd` ;; 136*) SSHD=`which sshd` ;;
137esac 137esac
138 138
139# Logfiles.
140# SSH_LOGFILE should be the debug output of ssh(1) only
141# SSHD_LOGFILE should be the debug output of sshd(8) only
142# REGRESS_LOGFILE is the output of the test itself stdout and stderr
139if [ "x$TEST_SSH_LOGFILE" = "x" ]; then 143if [ "x$TEST_SSH_LOGFILE" = "x" ]; then
140 TEST_SSH_LOGFILE=/dev/null 144 TEST_SSH_LOGFILE=$OBJ/ssh.log
141fi 145fi
146if [ "x$TEST_SSHD_LOGFILE" = "x" ]; then
147 TEST_SSHD_LOGFILE=$OBJ/sshd.log
148fi
149if [ "x$TEST_REGRESS_LOGFILE" = "x" ]; then
150 TEST_REGRESS_LOGFILE=$OBJ/regress.log
151fi
152
153# truncate logfiles
154>$TEST_SSH_LOGFILE
155>$TEST_SSHD_LOGFILE
156>$TEST_REGRESS_LOGFILE
142 157
143# Some data for test copies 158# Some data for test copies
144DATA=$OBJ/testdata 159DATA=$OBJ/testdata
@@ -201,7 +216,7 @@ cleanup ()
201 216
202trace () 217trace ()
203{ 218{
204 echo "trace: $@" >>$TEST_SSH_LOGFILE 219 echo "trace: $@" >>$TEST_REGRESS_LOGFILE
205 if [ "X$TEST_SSH_TRACE" = "Xyes" ]; then 220 if [ "X$TEST_SSH_TRACE" = "Xyes" ]; then
206 echo "$@" 221 echo "$@"
207 fi 222 fi
@@ -209,7 +224,7 @@ trace ()
209 224
210verbose () 225verbose ()
211{ 226{
212 echo "verbose: $@" >>$TEST_SSH_LOGFILE 227 echo "verbose: $@" >>$TEST_REGRESS_LOGFILE
213 if [ "X$TEST_SSH_QUIET" != "Xyes" ]; then 228 if [ "X$TEST_SSH_QUIET" != "Xyes" ]; then
214 echo "$@" 229 echo "$@"
215 fi 230 fi
@@ -223,14 +238,14 @@ warn ()
223 238
224fail () 239fail ()
225{ 240{
226 echo "FAIL: $@" >>$TEST_SSH_LOGFILE 241 echo "FAIL: $@" >>$TEST_REGRESS_LOGFILE
227 RESULT=1 242 RESULT=1
228 echo "$@" 243 echo "$@"
229} 244}
230 245
231fatal () 246fatal ()
232{ 247{
233 echo "FATAL: $@" >>$TEST_SSH_LOGFILE 248 echo "FATAL: $@" >>$TEST_REGRESS_LOGFILE
234 echon "FATAL: " 249 echon "FATAL: "
235 fail "$@" 250 fail "$@"
236 cleanup 251 cleanup
@@ -372,7 +387,7 @@ if test "$REGRESS_INTEROP_PUTTY" = "yes" ; then
372 echo "Hostname=127.0.0.1" >> ${OBJ}/.putty/sessions/localhost_proxy 387 echo "Hostname=127.0.0.1" >> ${OBJ}/.putty/sessions/localhost_proxy
373 echo "PortNumber=$PORT" >> ${OBJ}/.putty/sessions/localhost_proxy 388 echo "PortNumber=$PORT" >> ${OBJ}/.putty/sessions/localhost_proxy
374 echo "ProxyMethod=5" >> ${OBJ}/.putty/sessions/localhost_proxy 389 echo "ProxyMethod=5" >> ${OBJ}/.putty/sessions/localhost_proxy
375 echo "ProxyTelnetCommand=sh ${SRC}/sshd-log-wrapper.sh ${SSHD} ${TEST_SSH_LOGFILE} -i -f $OBJ/sshd_proxy" >> ${OBJ}/.putty/sessions/localhost_proxy 390 echo "ProxyTelnetCommand=sh ${SRC}/sshd-log-wrapper.sh ${SSHD} ${TEST_SSHD_LOGFILE} -i -f $OBJ/sshd_proxy" >> ${OBJ}/.putty/sessions/localhost_proxy
376 391
377 REGRESS_INTEROP_PUTTY=yes 392 REGRESS_INTEROP_PUTTY=yes
378fi 393fi
@@ -380,7 +395,7 @@ fi
380# create a proxy version of the client config 395# create a proxy version of the client config
381( 396(
382 cat $OBJ/ssh_config 397 cat $OBJ/ssh_config
383 echo proxycommand ${SUDO} sh ${SRC}/sshd-log-wrapper.sh ${SSHD} ${TEST_SSH_LOGFILE} -i -f $OBJ/sshd_proxy 398 echo proxycommand ${SUDO} sh ${SRC}/sshd-log-wrapper.sh ${SSHD} ${TEST_SSHD_LOGFILE} -i -f $OBJ/sshd_proxy
384) > $OBJ/ssh_proxy 399) > $OBJ/ssh_proxy
385 400
386# check proxy config 401# check proxy config
@@ -390,7 +405,7 @@ start_sshd ()
390{ 405{
391 # start sshd 406 # start sshd
392 $SUDO ${SSHD} -f $OBJ/sshd_config "$@" -t || fatal "sshd_config broken" 407 $SUDO ${SSHD} -f $OBJ/sshd_config "$@" -t || fatal "sshd_config broken"
393 $SUDO ${SSHD} -f $OBJ/sshd_config -e "$@" >>$TEST_SSH_LOGFILE 2>&1 408 $SUDO ${SSHD} -f $OBJ/sshd_config -e "$@" >>$TEST_SSHD_LOGFILE 2>&1
394 409
395 trace "wait for sshd" 410 trace "wait for sshd"
396 i=0; 411 i=0;