diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2004-06-24 19:32:01 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2004-06-24 19:32:01 +0000 |
commit | 128dd71ffeec48b94e085c757b3626553d619e7c (patch) | |
tree | 88ec615ccc967230b24bae79002a6a1d6e506ec6 /regress/usr.bin/ssh/test-exec.sh | |
parent | 074349eafad1a02ebfe310d147afdf2211f15729 (diff) |
regress test for re-exec corner cases
Diffstat (limited to 'regress/usr.bin/ssh/test-exec.sh')
-rw-r--r-- | regress/usr.bin/ssh/test-exec.sh | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/regress/usr.bin/ssh/test-exec.sh b/regress/usr.bin/ssh/test-exec.sh index 9d1b1734ed9..b859521cd35 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.21 2004/06/22 22:55:56 dtucker Exp $ +# $OpenBSD: test-exec.sh,v 1.22 2004/06/24 19:32:00 djm Exp $ # Placed in the Public Domain. USER=`id -un` @@ -76,6 +76,9 @@ if [ "x$TEST_SSH_SCP" != "x" ]; then SCP="${TEST_SSH_SCP}" fi +# Path to sshd must be absolute for rexec +SSHD=`which sshd` + # these should be used in tests export SSH SSHD SSHAGENT SSHADD SSHKEYGEN SSHKEYSCAN SFTP SFTPSERVER SCP #echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER $SCP @@ -233,6 +236,27 @@ start_sshd () test -f $PIDFILE || fatal "no sshd running on port $PORT" } +# Start a sshd and then delete it +start_sshd_copy_zap () +{ + cp ${SSHD} $OBJ/sshd.copy + SSHD_CPY=`which $OBJ/sshd.copy` + + # start sshd + $SUDO $SSHD_CPY -f $OBJ/sshd_config -t || fatal "sshd_config broken" + $SUDO $SSHD_CPY -f $OBJ/sshd_config + + trace "wait for sshd" + i=0; + while [ ! -f $PIDFILE -a $i -lt 5 ]; do + i=`expr $i + 1` + sleep $i + done + + test -f $PIDFILE || fatal "no sshd running on port $PORT" + rm -f $OBJ/sshd.copy +} + # source test body . $SCRIPT |