diff options
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r-- | regress/test-exec.sh | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh index dc033cd96..68f010b70 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: test-exec.sh,v 1.59 2017/02/07 23:03:11 dtucker Exp $ | 1 | # $OpenBSD: test-exec.sh,v 1.61 2017/07/28 10:32:08 dtucker Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | #SUDO=sudo | 4 | #SUDO=sudo |
@@ -130,12 +130,6 @@ if [ "x$TEST_SSH_CONCH" != "x" ]; then | |||
130 | esac | 130 | esac |
131 | fi | 131 | fi |
132 | 132 | ||
133 | SSH_PROTOCOLS=2 | ||
134 | #SSH_PROTOCOLS=`$SSH -Q protocol-version` | ||
135 | if [ "x$TEST_SSH_PROTOCOLS" != "x" ]; then | ||
136 | SSH_PROTOCOLS="${TEST_SSH_PROTOCOLS}" | ||
137 | fi | ||
138 | |||
139 | # Path to sshd must be absolute for rexec | 133 | # Path to sshd must be absolute for rexec |
140 | case "$SSHD" in | 134 | case "$SSHD" in |
141 | /*) ;; | 135 | /*) ;; |
@@ -310,8 +304,15 @@ stop_sshd () | |||
310 | i=`expr $i + 1` | 304 | i=`expr $i + 1` |
311 | sleep $i | 305 | sleep $i |
312 | done | 306 | done |
313 | test -f $PIDFILE && \ | 307 | if test -f $PIDFILE; then |
314 | fatal "sshd didn't exit port $PORT pid $pid" | 308 | if $SUDO kill -0 $pid; then |
309 | echo "sshd didn't exit " \ | ||
310 | "port $PORT pid $pid" | ||
311 | else | ||
312 | echo "sshd died without cleanup" | ||
313 | fi | ||
314 | exit 1 | ||
315 | fi | ||
315 | fi | 316 | fi |
316 | fi | 317 | fi |
317 | fi | 318 | fi |
@@ -386,22 +387,11 @@ fatal () | |||
386 | exit $RESULT | 387 | exit $RESULT |
387 | } | 388 | } |
388 | 389 | ||
389 | ssh_version () | ||
390 | { | ||
391 | echo ${SSH_PROTOCOLS} | grep "$1" >/dev/null | ||
392 | } | ||
393 | |||
394 | RESULT=0 | 390 | RESULT=0 |
395 | PIDFILE=$OBJ/pidfile | 391 | PIDFILE=$OBJ/pidfile |
396 | 392 | ||
397 | trap fatal 3 2 | 393 | trap fatal 3 2 |
398 | 394 | ||
399 | if ssh_version 1; then | ||
400 | PROTO="2,1" | ||
401 | else | ||
402 | PROTO="2" | ||
403 | fi | ||
404 | |||
405 | # create server config | 395 | # create server config |
406 | cat << EOF > $OBJ/sshd_config | 396 | cat << EOF > $OBJ/sshd_config |
407 | StrictModes no | 397 | StrictModes no |
@@ -460,11 +450,8 @@ fi | |||
460 | 450 | ||
461 | rm -f $OBJ/known_hosts $OBJ/authorized_keys_$USER | 451 | rm -f $OBJ/known_hosts $OBJ/authorized_keys_$USER |
462 | 452 | ||
463 | if ssh_version 1; then | 453 | SSH_KEYTYPES="rsa ed25519" |
464 | SSH_KEYTYPES="rsa rsa1" | 454 | |
465 | else | ||
466 | SSH_KEYTYPES="rsa ed25519" | ||
467 | fi | ||
468 | trace "generate keys" | 455 | trace "generate keys" |
469 | for t in ${SSH_KEYTYPES}; do | 456 | for t in ${SSH_KEYTYPES}; do |
470 | # generate user key | 457 | # generate user key |