]> andersk Git - gssapi-openssh.git/blobdiff - openssh/regress/test-exec.sh
Import of OpenSSH 4.0p1
[gssapi-openssh.git] / openssh / regress / test-exec.sh
index 70250acd717b8f8e1afb35c26c3d24e869f51b2d..4e53449bedeb53d4c4202a5d52925a620827d411 100644 (file)
@@ -1,8 +1,19 @@
-#      $OpenBSD: test-exec.sh,v 1.23 2004/06/25 01:25:12 djm Exp $
+#      $OpenBSD: test-exec.sh,v 1.27 2005/02/27 11:33:30 dtucker Exp $
 #      Placed in the Public Domain.
 
 #SUDO=sudo
 
+# Unbreak GNU head(1)
+_POSIX2_VERSION=199209
+export _POSIX2_VERSION
+
+case `uname -s 2>/dev/null` in
+OSF1*)
+       BIN_SH=xpg4
+       export BIN_SH
+       ;;
+esac
+
 if [ ! -z "$TEST_SSH_PORT" ]; then
        PORT="$TEST_SSH_PORT"
 else
@@ -43,6 +54,8 @@ else
 fi
 unset SSH_AUTH_SOCK
 
+SRC=`dirname ${SCRIPT}`
+
 # defaults
 SSH=ssh
 SSHD=sshd
@@ -83,7 +96,13 @@ if [ "x$TEST_SSH_SCP" != "x" ]; then
 fi
 
 # Path to sshd must be absolute for rexec
-SSHD=`which sshd`
+if [ ! -x /$SSHD ]; then
+       SSHD=`which sshd`
+fi
+
+if [ "x$TEST_SSH_LOGFILE" = "x" ]; then
+       TEST_SSH_LOGFILE=/dev/null
+fi
 
 # these should be used in tests
 export SSH SSHD SSHAGENT SSHADD SSHKEYGEN SSHKEYSCAN SFTP SFTPSERVER SCP
@@ -134,6 +153,7 @@ cleanup ()
 
 trace ()
 {
+       echo "trace: $@" >>$TEST_SSH_LOGFILE
        if [ "X$TEST_SSH_TRACE" = "Xyes" ]; then
                echo "$@"
        fi
@@ -141,6 +161,7 @@ trace ()
 
 verbose ()
 {
+       echo "verbose: $@" >>$TEST_SSH_LOGFILE
        if [ "X$TEST_SSH_QUIET" != "Xyes" ]; then
                echo "$@"
        fi
@@ -149,12 +170,14 @@ verbose ()
 
 fail ()
 {
+       echo "FAIL: $@" >>$TEST_SSH_LOGFILE
        RESULT=1
        echo "$@"
 }
 
 fatal ()
 {
+       echo "FATAL: $@" >>$TEST_SSH_LOGFILE
        echon "FATAL: "
        fail "$@"
        cleanup
@@ -174,7 +197,7 @@ cat << EOF > $OBJ/sshd_config
        #ListenAddress          ::1
        PidFile                 $PIDFILE
        AuthorizedKeysFile      $OBJ/authorized_keys_%u
-       LogLevel                QUIET
+       LogLevel                DEBUG
        AcceptEnv               _XXX_TEST_*
        AcceptEnv               _XXX_TEST
        Subsystem       sftp    $SFTPSERVER
@@ -205,7 +228,6 @@ Host *
        ChallengeResponseAuthentication no
        HostbasedAuthentication no
        PasswordAuthentication  no
-       RhostsRSAAuthentication no
        BatchMode               yes
        StrictHostKeyChecking   yes
 EOF
@@ -246,7 +268,7 @@ chmod 644 $OBJ/authorized_keys_$USER
 # create a proxy version of the client config
 (
        cat $OBJ/ssh_config
-       echo proxycommand ${SUDO} ${SSHD} -i -f $OBJ/sshd_proxy
+       echo proxycommand ${SUDO} sh ${SRC}/sshd-log-wrapper.sh ${SSHD} ${TEST_SSH_LOGFILE} -i -f $OBJ/sshd_proxy
 ) > $OBJ/ssh_proxy
 
 # check proxy config
@@ -256,7 +278,7 @@ start_sshd ()
 {
        # start sshd
        $SUDO ${SSHD} -f $OBJ/sshd_config -t    || fatal "sshd_config broken"
-       $SUDO ${SSHD} -f $OBJ/sshd_config
+       $SUDO ${SSHD} -f $OBJ/sshd_config -e >>$TEST_SSH_LOGFILE 2>&1
 
        trace "wait for sshd"
        i=0;
This page took 0.034407 seconds and 4 git commands to generate.