summaryrefslogtreecommitdiff
path: root/regress/usr.bin/ssh/test-exec.sh
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2015-03-03 22:35:20 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2015-03-03 22:35:20 +0000
commit6470573f3a90a3c795eea22f4b415add107cddf7 (patch)
treeea72e91d8403ac84b996fe9a2a079437d4c2cd9a /regress/usr.bin/ssh/test-exec.sh
parentc92000127666b10e4bcda54e58b2f865a42b2326 (diff)
make it possible to run tests w/o ssh1 support; ok djm@
Diffstat (limited to 'regress/usr.bin/ssh/test-exec.sh')
-rw-r--r--regress/usr.bin/ssh/test-exec.sh29
1 files changed, 25 insertions, 4 deletions
diff --git a/regress/usr.bin/ssh/test-exec.sh b/regress/usr.bin/ssh/test-exec.sh
index adb6ff5b891..f63974e57ee 100644
--- a/regress/usr.bin/ssh/test-exec.sh
+++ b/regress/usr.bin/ssh/test-exec.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: test-exec.sh,v 1.50 2015/01/18 19:50:15 djm Exp $
+# $OpenBSD: test-exec.sh,v 1.51 2015/03/03 22:35:19 markus Exp $
# Placed in the Public Domain.
USER=`id -un`
@@ -91,6 +91,11 @@ if [ "x$TEST_SSH_CONCH" != "x" ]; then
CONCH="${TEST_SSH_CONCH}"
fi
+SSH_PROTOCOLS=`$SSH -Q protocol-version`
+if [ "x$TEST_SSH_PROTOCOLS" != "x" ]; then
+ SSH_PROTOCOLS="${TEST_SSH_PROTOCOLS}"
+fi
+
# Path to sshd must be absolute for rexec
case "$SSHD" in
/*) ;;
@@ -234,15 +239,26 @@ fatal ()
exit $RESULT
}
+ssh_version ()
+{
+ echo ${SSH_PROTOCOLS} | grep -q "$1"
+}
+
RESULT=0
PIDFILE=$OBJ/pidfile
trap fatal 3 2
+if ssh_version 1; then
+ PROTO="2,1"
+else
+ PROTO="2"
+fi
+
# create server config
cat << EOF > $OBJ/sshd_config
Port $PORT
- Protocol 2,1
+ Protocol $PROTO
AddressFamily inet
ListenAddress 127.0.0.1
#ListenAddress ::1
@@ -268,7 +284,7 @@ echo 'StrictModes no' >> $OBJ/sshd_proxy
# create client config
cat << EOF > $OBJ/ssh_config
Host *
- Protocol 2,1
+ Protocol $PROTO
Hostname 127.0.0.1
HostKeyAlias localhost-with-alias
Port $PORT
@@ -293,8 +309,13 @@ fi
rm -f $OBJ/known_hosts $OBJ/authorized_keys_$USER
+if ssh_version 1; then
+ SSH_KEYTYPES="rsa rsa1"
+else
+ SSH_KEYTYPES="rsa ed25519"
+fi
trace "generate keys"
-for t in rsa rsa1; do
+for t in ${SSH_KEYTYPES}; do
# generate user key
if [ ! -f $OBJ/$t ] || [ ${SSHKEYGEN} -nt $OBJ/$t ]; then
rm -f $OBJ/$t