summaryrefslogtreecommitdiff
path: root/regress/test-exec.sh
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2015-03-03 22:35:19 +0000
committerDamien Miller <djm@mindrot.org>2015-03-05 05:59:47 +1100
commitdad2b1892b4c1b7e58df483a8c5b983c4454e099 (patch)
treefa461e273ef92414c934a88cc88b2875032e616f /regress/test-exec.sh
parentd48a22601bdd3eec054794c535f4ae8d8ae4c6e2 (diff)
upstream commit
make it possible to run tests w/o ssh1 support; ok djm@
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r--regress/test-exec.sh29
1 files changed, 25 insertions, 4 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index ff0768a04..12ba094a9 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: test-exec.sh,v 1.48 2014/07/06 07:42:03 djm Exp $ 1# $OpenBSD: test-exec.sh,v 1.51 2015/03/03 22:35:19 markus Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4#SUDO=sudo 4#SUDO=sudo
@@ -130,6 +130,11 @@ if [ "x$TEST_SSH_CONCH" != "x" ]; then
130 esac 130 esac
131fi 131fi
132 132
133SSH_PROTOCOLS=`$SSH -Q protocol-version`
134if [ "x$TEST_SSH_PROTOCOLS" != "x" ]; then
135 SSH_PROTOCOLS="${TEST_SSH_PROTOCOLS}"
136fi
137
133# Path to sshd must be absolute for rexec 138# Path to sshd must be absolute for rexec
134case "$SSHD" in 139case "$SSHD" in
135/*) ;; 140/*) ;;
@@ -374,16 +379,27 @@ fatal ()
374 exit $RESULT 379 exit $RESULT
375} 380}
376 381
382ssh_version ()
383{
384 echo ${SSH_PROTOCOLS} | grep -q "$1"
385}
386
377RESULT=0 387RESULT=0
378PIDFILE=$OBJ/pidfile 388PIDFILE=$OBJ/pidfile
379 389
380trap fatal 3 2 390trap fatal 3 2
381 391
392if ssh_version 1; then
393 PROTO="2,1"
394else
395 PROTO="2"
396fi
397
382# create server config 398# create server config
383cat << EOF > $OBJ/sshd_config 399cat << EOF > $OBJ/sshd_config
384 StrictModes no 400 StrictModes no
385 Port $PORT 401 Port $PORT
386 Protocol 2,1 402 Protocol $PROTO
387 AddressFamily inet 403 AddressFamily inet
388 ListenAddress 127.0.0.1 404 ListenAddress 127.0.0.1
389 #ListenAddress ::1 405 #ListenAddress ::1
@@ -409,7 +425,7 @@ echo 'StrictModes no' >> $OBJ/sshd_proxy
409# create client config 425# create client config
410cat << EOF > $OBJ/ssh_config 426cat << EOF > $OBJ/ssh_config
411Host * 427Host *
412 Protocol 2,1 428 Protocol $PROTO
413 Hostname 127.0.0.1 429 Hostname 127.0.0.1
414 HostKeyAlias localhost-with-alias 430 HostKeyAlias localhost-with-alias
415 Port $PORT 431 Port $PORT
@@ -434,8 +450,13 @@ fi
434 450
435rm -f $OBJ/known_hosts $OBJ/authorized_keys_$USER 451rm -f $OBJ/known_hosts $OBJ/authorized_keys_$USER
436 452
453if ssh_version 1; then
454 SSH_KEYTYPES="rsa rsa1"
455else
456 SSH_KEYTYPES="rsa ed25519"
457fi
437trace "generate keys" 458trace "generate keys"
438for t in rsa rsa1; do 459for t in ${SSH_KEYTYPES}; do
439 # generate user key 460 # generate user key
440 if [ ! -f $OBJ/$t ] || [ ${SSHKEYGEN_BIN} -nt $OBJ/$t ]; then 461 if [ ! -f $OBJ/$t ] || [ ${SSHKEYGEN_BIN} -nt $OBJ/$t ]; then
441 rm -f $OBJ/$t 462 rm -f $OBJ/$t