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.sh37
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
131fi 131fi
132 132
133SSH_PROTOCOLS=2
134#SSH_PROTOCOLS=`$SSH -Q protocol-version`
135if [ "x$TEST_SSH_PROTOCOLS" != "x" ]; then
136 SSH_PROTOCOLS="${TEST_SSH_PROTOCOLS}"
137fi
138
139# Path to sshd must be absolute for rexec 133# Path to sshd must be absolute for rexec
140case "$SSHD" in 134case "$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
389ssh_version ()
390{
391 echo ${SSH_PROTOCOLS} | grep "$1" >/dev/null
392}
393
394RESULT=0 390RESULT=0
395PIDFILE=$OBJ/pidfile 391PIDFILE=$OBJ/pidfile
396 392
397trap fatal 3 2 393trap fatal 3 2
398 394
399if ssh_version 1; then
400 PROTO="2,1"
401else
402 PROTO="2"
403fi
404
405# create server config 395# create server config
406cat << EOF > $OBJ/sshd_config 396cat << EOF > $OBJ/sshd_config
407 StrictModes no 397 StrictModes no
@@ -460,11 +450,8 @@ fi
460 450
461rm -f $OBJ/known_hosts $OBJ/authorized_keys_$USER 451rm -f $OBJ/known_hosts $OBJ/authorized_keys_$USER
462 452
463if ssh_version 1; then 453SSH_KEYTYPES="rsa ed25519"
464 SSH_KEYTYPES="rsa rsa1" 454
465else
466 SSH_KEYTYPES="rsa ed25519"
467fi
468trace "generate keys" 455trace "generate keys"
469for t in ${SSH_KEYTYPES}; do 456for t in ${SSH_KEYTYPES}; do
470 # generate user key 457 # generate user key