diff options
author | Darren Tucker <dtucker@zip.com.au> | 2013-05-17 09:19:10 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2013-05-17 09:19:10 +1000 |
commit | 75129025a2d504b630d1718fef0da002f5662f63 (patch) | |
tree | 20f11cfa09be4128d81665ab06094d358dd2a3b0 /regress/test-exec.sh | |
parent | 7c8b1e72331293b4707dc6f7f68a69e975a3fa70 (diff) |
- dtucker@cvs.openbsd.org 2013/04/06 06:00:22
[regress/rekey.sh regress/test-exec.sh regress/integrity.sh
regress/multiplex.sh Makefile regress/cfgmatch.sh]
Split the regress log into 3 parts: the debug output from ssh, the debug
log from sshd and the output from the client command (ssh, scp or sftp).
Somewhat functional now, will become more useful when ssh/sshd -E is added.
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r-- | regress/test-exec.sh | 33 |
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` ;; |
137 | esac | 137 | esac |
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 | ||
139 | if [ "x$TEST_SSH_LOGFILE" = "x" ]; then | 143 | if [ "x$TEST_SSH_LOGFILE" = "x" ]; then |
140 | TEST_SSH_LOGFILE=/dev/null | 144 | TEST_SSH_LOGFILE=$OBJ/ssh.log |
141 | fi | 145 | fi |
146 | if [ "x$TEST_SSHD_LOGFILE" = "x" ]; then | ||
147 | TEST_SSHD_LOGFILE=$OBJ/sshd.log | ||
148 | fi | ||
149 | if [ "x$TEST_REGRESS_LOGFILE" = "x" ]; then | ||
150 | TEST_REGRESS_LOGFILE=$OBJ/regress.log | ||
151 | fi | ||
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 |
144 | DATA=$OBJ/testdata | 159 | DATA=$OBJ/testdata |
@@ -201,7 +216,7 @@ cleanup () | |||
201 | 216 | ||
202 | trace () | 217 | trace () |
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 | ||
210 | verbose () | 225 | verbose () |
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 | ||
224 | fail () | 239 | fail () |
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 | ||
231 | fatal () | 246 | fatal () |
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 |
378 | fi | 393 | fi |
@@ -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; |