summaryrefslogtreecommitdiff
path: root/regress/test-exec.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r--regress/test-exec.sh33
1 files changed, 24 insertions, 9 deletions
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;