]> andersk Git - openssh.git/commitdiff
- dtucker@cvs.openbsd.org 2005/02/27 11:33:30
authordtucker <dtucker>
Mon, 7 Mar 2005 07:33:02 +0000 (07:33 +0000)
committerdtucker <dtucker>
Mon, 7 Mar 2005 07:33:02 +0000 (07:33 +0000)
     [multiplex.sh test-exec.sh sshd-log-wrapper.sh]
     Add optional capability to log output from regress commands; ok markus@
     Use with: make TEST_SSH_LOGFILE=/tmp/regress.log

ChangeLog
regress/multiplex.sh
regress/sshd-log-wrapper.sh [new file with mode: 0644]
regress/test-exec.sh

index 336dca915b17a1d9c14eed50e8b04f5bfe1b3ee9..5b72449285ed28e6b98339f64b97881e660686f2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,10 @@
    - david@cvs.openbsd.org 2005/01/14 04:21:18
      [Makefile test-exec.sh]
      pass the SUDO make variable to the individual sh tests; ok dtucker@ markus@
+   - dtucker@cvs.openbsd.org 2005/02/27 11:33:30
+     [multiplex.sh test-exec.sh sshd-log-wrapper.sh]
+     Add optional capability to log output from regress commands; ok markus@
+     Use with: make TEST_SSH_LOGFILE=/tmp/regress.log
 
 20050306
  - (dtucker) [monitor.c] Bug #125 comment #47: fix errors returned by monitor
index 15e518c86b603e6b29dd6201b716a576440c99e4..e8cc1ac53190c5b00b2ad5938b417e43b61211b9 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: multiplex.sh,v 1.9 2004/11/07 00:32:41 djm Exp $
+#      $OpenBSD: multiplex.sh,v 1.10 2005/02/27 11:33:30 dtucker Exp $
 #      Placed in the Public Domain.
 
 CTL=$OBJ/ctl-sock
@@ -13,6 +13,7 @@ fi
 
 DATA=/bin/ls${EXEEXT}
 COPY=$OBJ/ls.copy
+LOG=$TEST_SSH_LOGFILE
 
 start_sshd
 
@@ -48,13 +49,13 @@ cmp ${DATA} ${COPY}         || fail "ssh -S ctl: corrupted copy of ${DATA}"
 rm -f ${COPY}
 trace "sftp transfer over multiplexed connection and check result"
 echo "get ${DATA} ${COPY}" | \
-       ${SFTP} -S ${SSH} -oControlPath=$CTL otherhost >/dev/null 2>&1
+       ${SFTP} -S ${SSH} -oControlPath=$CTL otherhost >$LOG 2>&1
 test -f ${COPY}                        || fail "sftp: failed copy ${DATA}" 
 cmp ${DATA} ${COPY}            || fail "sftp: corrupted copy of ${DATA}"
 
 rm -f ${COPY}
 trace "scp transfer over multiplexed connection and check result"
-${SCP} -S ${SSH} -oControlPath=$CTL otherhost:${DATA} ${COPY} >/dev/null 2>&1
+${SCP} -S ${SSH} -oControlPath=$CTL otherhost:${DATA} ${COPY} >$LOG 2>&1
 test -f ${COPY}                        || fail "scp: failed copy ${DATA}" 
 cmp ${DATA} ${COPY}            || fail "scp: corrupted copy of ${DATA}"
 
diff --git a/regress/sshd-log-wrapper.sh b/regress/sshd-log-wrapper.sh
new file mode 100644 (file)
index 0000000..c7a5ef3
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+#       $OpenBSD: sshd-log-wrapper.sh,v 1.2 2005/02/27 11:40:30 dtucker Exp $
+#       Placed in the Public Domain.
+#
+# simple wrapper for sshd proxy mode to catch stderr output
+# sh sshd-log-wrapper.sh /path/to/sshd /path/to/logfile
+
+sshd=$1
+log=$2
+shift
+shift
+
+exec $sshd $@ -e 2>>$log
index 346b68f1616459313ef82a41d43e76e6393655a0..958c87109b779b7fc3c089c06dfeadaa5e4f4319 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: test-exec.sh,v 1.26 2005/01/14 04:21:18 david Exp $
+#      $OpenBSD: test-exec.sh,v 1.27 2005/02/27 11:33:30 dtucker Exp $
 #      Placed in the Public Domain.
 
 #SUDO=sudo
@@ -47,6 +47,8 @@ else
 fi
 unset SSH_AUTH_SOCK
 
+SRC=`dirname ${SCRIPT}`
+
 # defaults
 SSH=ssh
 SSHD=sshd
@@ -91,6 +93,10 @@ 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
 #echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER $SCP
@@ -140,6 +146,7 @@ cleanup ()
 
 trace ()
 {
+       echo "trace: $@" >>$TEST_SSH_LOGFILE
        if [ "X$TEST_SSH_TRACE" = "Xyes" ]; then
                echo "$@"
        fi
@@ -147,6 +154,7 @@ trace ()
 
 verbose ()
 {
+       echo "verbose: $@" >>$TEST_SSH_LOGFILE
        if [ "X$TEST_SSH_QUIET" != "Xyes" ]; then
                echo "$@"
        fi
@@ -155,12 +163,14 @@ verbose ()
 
 fail ()
 {
+       echo "FAIL: $@" >>$TEST_SSH_LOGFILE
        RESULT=1
        echo "$@"
 }
 
 fatal ()
 {
+       echo "FATAL: $@" >>$TEST_SSH_LOGFILE
        echon "FATAL: "
        fail "$@"
        cleanup
@@ -180,7 +190,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
@@ -251,7 +261,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 sh ${SRC}/sshd-log-wrapper.sh ${SUDO} ${SSHD} ${TEST_SSH_LOGFILE} -i -f $OBJ/sshd_proxy
 ) > $OBJ/ssh_proxy
 
 # check proxy config
@@ -261,7 +271,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.136832 seconds and 5 git commands to generate.