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.sh40
1 files changed, 25 insertions, 15 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index 1b6526d0b..bfa48803b 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: test-exec.sh,v 1.53 2016/04/15 02:57:10 djm Exp $ 1# $OpenBSD: test-exec.sh,v 1.58 2016/12/16 01:06:27 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4#SUDO=sudo 4#SUDO=sudo
@@ -130,7 +130,8 @@ if [ "x$TEST_SSH_CONCH" != "x" ]; then
130 esac 130 esac
131fi 131fi
132 132
133SSH_PROTOCOLS=`$SSH -Q protocol-version` 133SSH_PROTOCOLS=2
134#SSH_PROTOCOLS=`$SSH -Q protocol-version`
134if [ "x$TEST_SSH_PROTOCOLS" != "x" ]; then 135if [ "x$TEST_SSH_PROTOCOLS" != "x" ]; then
135 SSH_PROTOCOLS="${TEST_SSH_PROTOCOLS}" 136 SSH_PROTOCOLS="${TEST_SSH_PROTOCOLS}"
136fi 137fi
@@ -292,16 +293,8 @@ md5 () {
292} 293}
293# End of portable specific functions 294# End of portable specific functions
294 295
295# helper 296stop_sshd ()
296cleanup ()
297{ 297{
298 if [ "x$SSH_PID" != "x" ]; then
299 if [ $SSH_PID -lt 2 ]; then
300 echo bad pid for ssh: $SSH_PID
301 else
302 kill $SSH_PID
303 fi
304 fi
305 if [ -f $PIDFILE ]; then 298 if [ -f $PIDFILE ]; then
306 pid=`$SUDO cat $PIDFILE` 299 pid=`$SUDO cat $PIDFILE`
307 if [ "X$pid" = "X" ]; then 300 if [ "X$pid" = "X" ]; then
@@ -324,6 +317,19 @@ cleanup ()
324 fi 317 fi
325} 318}
326 319
320# helper
321cleanup ()
322{
323 if [ "x$SSH_PID" != "x" ]; then
324 if [ $SSH_PID -lt 2 ]; then
325 echo bad pid for ssh: $SSH_PID
326 else
327 kill $SSH_PID
328 fi
329 fi
330 stop_sshd
331}
332
327start_debug_log () 333start_debug_log ()
328{ 334{
329 echo "trace: $@" >$TEST_REGRESS_LOGFILE 335 echo "trace: $@" >$TEST_REGRESS_LOGFILE
@@ -400,7 +406,6 @@ fi
400cat << EOF > $OBJ/sshd_config 406cat << EOF > $OBJ/sshd_config
401 StrictModes no 407 StrictModes no
402 Port $PORT 408 Port $PORT
403 Protocol $PROTO
404 AddressFamily inet 409 AddressFamily inet
405 ListenAddress 127.0.0.1 410 ListenAddress 127.0.0.1
406 #ListenAddress ::1 411 #ListenAddress ::1
@@ -433,7 +438,6 @@ echo 'StrictModes no' >> $OBJ/sshd_proxy
433# create client config 438# create client config
434cat << EOF > $OBJ/ssh_config 439cat << EOF > $OBJ/ssh_config
435Host * 440Host *
436 Protocol $PROTO
437 Hostname 127.0.0.1 441 Hostname 127.0.0.1
438 HostKeyAlias localhost-with-alias 442 HostKeyAlias localhost-with-alias
439 Port $PORT 443 Port $PORT
@@ -513,7 +517,11 @@ if test "$REGRESS_INTEROP_PUTTY" = "yes" ; then
513 517
514 # Add a PuTTY key to authorized_keys 518 # Add a PuTTY key to authorized_keys
515 rm -f ${OBJ}/putty.rsa2 519 rm -f ${OBJ}/putty.rsa2
516 puttygen -t rsa -o ${OBJ}/putty.rsa2 < /dev/null > /dev/null 520 if ! puttygen -t rsa -o ${OBJ}/putty.rsa2 \
521 --new-passphrase /dev/null < /dev/null > /dev/null; then
522 echo "Your installed version of PuTTY is too old to support --new-passphrase; trying without (may require manual interaction) ..." >&2
523 puttygen -t rsa -o ${OBJ}/putty.rsa2 < /dev/null > /dev/null
524 fi
517 puttygen -O public-openssh ${OBJ}/putty.rsa2 \ 525 puttygen -O public-openssh ${OBJ}/putty.rsa2 \
518 >> $OBJ/authorized_keys_$USER 526 >> $OBJ/authorized_keys_$USER
519 527
@@ -526,10 +534,12 @@ if test "$REGRESS_INTEROP_PUTTY" = "yes" ; then
526 # Setup proxied session 534 # Setup proxied session
527 mkdir -p ${OBJ}/.putty/sessions 535 mkdir -p ${OBJ}/.putty/sessions
528 rm -f ${OBJ}/.putty/sessions/localhost_proxy 536 rm -f ${OBJ}/.putty/sessions/localhost_proxy
529 echo "Hostname=127.0.0.1" >> ${OBJ}/.putty/sessions/localhost_proxy 537 echo "Protocol=ssh" >> ${OBJ}/.putty/sessions/localhost_proxy
538 echo "HostName=127.0.0.1" >> ${OBJ}/.putty/sessions/localhost_proxy
530 echo "PortNumber=$PORT" >> ${OBJ}/.putty/sessions/localhost_proxy 539 echo "PortNumber=$PORT" >> ${OBJ}/.putty/sessions/localhost_proxy
531 echo "ProxyMethod=5" >> ${OBJ}/.putty/sessions/localhost_proxy 540 echo "ProxyMethod=5" >> ${OBJ}/.putty/sessions/localhost_proxy
532 echo "ProxyTelnetCommand=sh ${SRC}/sshd-log-wrapper.sh ${TEST_SSHD_LOGFILE} ${SSHD} -i -f $OBJ/sshd_proxy" >> ${OBJ}/.putty/sessions/localhost_proxy 541 echo "ProxyTelnetCommand=sh ${SRC}/sshd-log-wrapper.sh ${TEST_SSHD_LOGFILE} ${SSHD} -i -f $OBJ/sshd_proxy" >> ${OBJ}/.putty/sessions/localhost_proxy
542 echo "ProxyLocalhost=1" >> ${OBJ}/.putty/sessions/localhost_proxy
533 543
534 REGRESS_INTEROP_PUTTY=yes 544 REGRESS_INTEROP_PUTTY=yes
535fi 545fi