diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2007-12-21 04:13:54 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2007-12-21 04:13:54 +0000 |
commit | ed4d4b9f9a3d1a77939981eaa41b92675a86f185 (patch) | |
tree | dc7a69b9cab9eb533d9fbe31df76b670f4e0a2e0 /regress/usr.bin/ssh/test-exec.sh | |
parent | 8b12679a963566c41b82af56575e1e605b61b538 (diff) |
basic (crypto, kex and transfer) interop regression tests against putty
To run these, install the net/putty port and run "make interop" - the
tests aren't run by default yet.
Diffstat (limited to 'regress/usr.bin/ssh/test-exec.sh')
-rw-r--r-- | regress/usr.bin/ssh/test-exec.sh | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/regress/usr.bin/ssh/test-exec.sh b/regress/usr.bin/ssh/test-exec.sh index 06aaffd5944..1482a2539f7 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.30 2007/10/26 05:30:01 djm Exp $ +# $OpenBSD: test-exec.sh,v 1.31 2007/12/21 04:13:53 djm Exp $ # Placed in the Public Domain. USER=`id -un` @@ -49,6 +49,10 @@ SFTP=sftp SFTPSERVER=/usr/libexec/sftp-server SCP=scp +# Interop testing +PLINK=/usr/local/bin/plink +PUTTYGEN=/usr/local/bin/puttygen + if [ "x$TEST_SSH_SSH" != "x" ]; then SSH="${TEST_SSH_SSH}" fi @@ -76,6 +80,12 @@ fi if [ "x$TEST_SSH_SCP" != "x" ]; then SCP="${TEST_SSH_SCP}" fi +if [ "x$TEST_SSH_PLINK" != "x" ]; then + PLINK="${TEST_SSH_PLINK}" +fi +if [ "x$TEST_SSH_PUTTYGEN" != "x" ]; then + PUTTYGEN="${TEST_SSH_PUTTYGEN}" +fi # Path to sshd must be absolute for rexec if [ ! -x /$SSHD ]; then @@ -222,6 +232,34 @@ for t in rsa rsa1; do done chmod 644 $OBJ/authorized_keys_$USER +# If PuTTY is present, prepare keys and configuration +REGRESS_INTEROP_PUTTY=no +if test -x $PUTTYGEN -a -x $PLINK ; then + mkdir -p ${OBJ}/.putty + + # Add a PuTTY key to authorized_keys + rm -f ${OBJ}/putty.rsa2 + puttygen -t rsa -o ${OBJ}/putty.rsa2 < /dev/null > /dev/null + puttygen -O public-openssh ${OBJ}/putty.rsa2 \ + >> $OBJ/authorized_keys_$USER + + # Convert rsa2 host key to PuTTY format + ${SRC}/ssh2putty.sh 127.0.0.1 $PORT $OBJ/rsa > \ + ${OBJ}/.putty/sshhostkeys + ${SRC}/ssh2putty.sh 127.0.0.1 22 $OBJ/rsa >> \ + ${OBJ}/.putty/sshhostkeys + + # Setup proxied session + mkdir -p ${OBJ}/.putty/sessions + rm -f ${OBJ}/.putty/sessions/localhost_proxy + echo "Hostname=127.0.0.1" >> ${OBJ}/.putty/sessions/localhost_proxy + echo "PortNumber=$PORT" >> ${OBJ}/.putty/sessions/localhost_proxy + echo "ProxyMethod=5" >> ${OBJ}/.putty/sessions/localhost_proxy + echo "ProxyTelnetCommand=sh ${SRC}/sshd-log-wrapper.sh ${SSHD} ${TEST_SSH_LOGFILE} -i -f $OBJ/sshd_proxy" >> ${OBJ}/.putty/sessions/localhost_proxy + + REGRESS_INTEROP_PUTTY=yes +fi + # create a proxy version of the client config ( cat $OBJ/ssh_config @@ -234,8 +272,8 @@ ${SSHD} -t -f $OBJ/sshd_proxy || fatal "sshd_proxy broken" start_sshd () { # start sshd - $SUDO ${SSHD} -f $OBJ/sshd_config -t || fatal "sshd_config broken" - $SUDO ${SSHD} -f $OBJ/sshd_config -e >>$TEST_SSH_LOGFILE 2>&1 + $SUDO ${SSHD} -f $OBJ/sshd_config "$@" -t || fatal "sshd_config broken" + $SUDO ${SSHD} -f $OBJ/sshd_config -e "$@" >>$TEST_SSH_LOGFILE 2>&1 trace "wait for sshd" i=0; |