diff options
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r-- | regress/test-exec.sh | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh index e44778065..1eb9ff729 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: test-exec.sh,v 1.30 2007/10/26 05:30:01 djm Exp $ | 1 | # $OpenBSD: test-exec.sh,v 1.31 2007/12/21 04:13:53 djm Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | #SUDO=sudo | 4 | #SUDO=sudo |
@@ -69,6 +69,10 @@ SFTP=sftp | |||
69 | SFTPSERVER=/usr/libexec/openssh/sftp-server | 69 | SFTPSERVER=/usr/libexec/openssh/sftp-server |
70 | SCP=scp | 70 | SCP=scp |
71 | 71 | ||
72 | # Interop testing | ||
73 | PLINK=/usr/local/bin/plink | ||
74 | PUTTYGEN=/usr/local/bin/puttygen | ||
75 | |||
72 | if [ "x$TEST_SSH_SSH" != "x" ]; then | 76 | if [ "x$TEST_SSH_SSH" != "x" ]; then |
73 | SSH="${TEST_SSH_SSH}" | 77 | SSH="${TEST_SSH_SSH}" |
74 | fi | 78 | fi |
@@ -96,6 +100,12 @@ fi | |||
96 | if [ "x$TEST_SSH_SCP" != "x" ]; then | 100 | if [ "x$TEST_SSH_SCP" != "x" ]; then |
97 | SCP="${TEST_SSH_SCP}" | 101 | SCP="${TEST_SSH_SCP}" |
98 | fi | 102 | fi |
103 | if [ "x$TEST_SSH_PLINK" != "x" ]; then | ||
104 | PLINK="${TEST_SSH_PLINK}" | ||
105 | fi | ||
106 | if [ "x$TEST_SSH_PUTTYGEN" != "x" ]; then | ||
107 | PUTTYGEN="${TEST_SSH_PUTTYGEN}" | ||
108 | fi | ||
99 | 109 | ||
100 | # Path to sshd must be absolute for rexec | 110 | # Path to sshd must be absolute for rexec |
101 | case "$SSHD" in | 111 | case "$SSHD" in |
@@ -269,6 +279,34 @@ for t in rsa rsa1; do | |||
269 | done | 279 | done |
270 | chmod 644 $OBJ/authorized_keys_$USER | 280 | chmod 644 $OBJ/authorized_keys_$USER |
271 | 281 | ||
282 | # If PuTTY is present, prepare keys and configuration | ||
283 | REGRESS_INTEROP_PUTTY=no | ||
284 | if test -x $PUTTYGEN -a -x $PLINK ; then | ||
285 | mkdir -p ${OBJ}/.putty | ||
286 | |||
287 | # Add a PuTTY key to authorized_keys | ||
288 | rm -f ${OBJ}/putty.rsa2 | ||
289 | puttygen -t rsa -o ${OBJ}/putty.rsa2 < /dev/null > /dev/null | ||
290 | puttygen -O public-openssh ${OBJ}/putty.rsa2 \ | ||
291 | >> $OBJ/authorized_keys_$USER | ||
292 | |||
293 | # Convert rsa2 host key to PuTTY format | ||
294 | ${SRC}/ssh2putty.sh 127.0.0.1 $PORT $OBJ/rsa > \ | ||
295 | ${OBJ}/.putty/sshhostkeys | ||
296 | ${SRC}/ssh2putty.sh 127.0.0.1 22 $OBJ/rsa >> \ | ||
297 | ${OBJ}/.putty/sshhostkeys | ||
298 | |||
299 | # Setup proxied session | ||
300 | mkdir -p ${OBJ}/.putty/sessions | ||
301 | rm -f ${OBJ}/.putty/sessions/localhost_proxy | ||
302 | echo "Hostname=127.0.0.1" >> ${OBJ}/.putty/sessions/localhost_proxy | ||
303 | echo "PortNumber=$PORT" >> ${OBJ}/.putty/sessions/localhost_proxy | ||
304 | echo "ProxyMethod=5" >> ${OBJ}/.putty/sessions/localhost_proxy | ||
305 | echo "ProxyTelnetCommand=sh ${SRC}/sshd-log-wrapper.sh ${SSHD} ${TEST_SSH_LOGFILE} -i -f $OBJ/sshd_proxy" >> ${OBJ}/.putty/sessions/localhost_proxy | ||
306 | |||
307 | REGRESS_INTEROP_PUTTY=yes | ||
308 | fi | ||
309 | |||
272 | # create a proxy version of the client config | 310 | # create a proxy version of the client config |
273 | ( | 311 | ( |
274 | cat $OBJ/ssh_config | 312 | cat $OBJ/ssh_config |
@@ -281,8 +319,8 @@ ${SSHD} -t -f $OBJ/sshd_proxy || fatal "sshd_proxy broken" | |||
281 | start_sshd () | 319 | start_sshd () |
282 | { | 320 | { |
283 | # start sshd | 321 | # start sshd |
284 | $SUDO ${SSHD} -f $OBJ/sshd_config -t || fatal "sshd_config broken" | 322 | $SUDO ${SSHD} -f $OBJ/sshd_config "$@" -t || fatal "sshd_config broken" |
285 | $SUDO ${SSHD} -f $OBJ/sshd_config -e >>$TEST_SSH_LOGFILE 2>&1 | 323 | $SUDO ${SSHD} -f $OBJ/sshd_config -e "$@" >>$TEST_SSH_LOGFILE 2>&1 |
286 | 324 | ||
287 | trace "wait for sshd" | 325 | trace "wait for sshd" |
288 | i=0; | 326 | i=0; |