summaryrefslogtreecommitdiff
path: root/regress/multiplex.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/multiplex.sh')
-rw-r--r--regress/multiplex.sh34
1 files changed, 27 insertions, 7 deletions
diff --git a/regress/multiplex.sh b/regress/multiplex.sh
index dbf2025be..e8cc1ac53 100644
--- a/regress/multiplex.sh
+++ b/regress/multiplex.sh
@@ -1,17 +1,28 @@
1# $OpenBSD: multiplex.sh,v 1.8 2004/06/22 03:12:13 markus Exp $ 1# $OpenBSD: multiplex.sh,v 1.10 2005/02/27 11:33:30 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4CTL=$OBJ/ctl-sock 4CTL=$OBJ/ctl-sock
5 5
6tid="connection multiplexing" 6tid="connection multiplexing"
7 7
8if grep "#define.*DISABLE_FD_PASSING" ${BUILDDIR}/config.h >/dev/null 2>&1
9then
10 echo "skipped (not supported on this platform)"
11 exit 0
12fi
13
8DATA=/bin/ls${EXEEXT} 14DATA=/bin/ls${EXEEXT}
9COPY=$OBJ/ls.copy 15COPY=$OBJ/ls.copy
16LOG=$TEST_SSH_LOGFILE
10 17
11start_sshd 18start_sshd
12 19
13trace "start master, fork to background" 20trace "start master, fork to background"
14${SSH} -2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" -f somehost sleep 120 21${SSH} -Nn2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" somehost &
22MASTER_PID=$!
23
24# Wait for master to start and authenticate
25sleep 5
15 26
16verbose "test $tid: envpass" 27verbose "test $tid: envpass"
17trace "env passing over multiplexed connection" 28trace "env passing over multiplexed connection"
@@ -38,13 +49,13 @@ cmp ${DATA} ${COPY} || fail "ssh -S ctl: corrupted copy of ${DATA}"
38rm -f ${COPY} 49rm -f ${COPY}
39trace "sftp transfer over multiplexed connection and check result" 50trace "sftp transfer over multiplexed connection and check result"
40echo "get ${DATA} ${COPY}" | \ 51echo "get ${DATA} ${COPY}" | \
41 ${SFTP} -S ${SSH} -oControlPath=$CTL otherhost >/dev/null 2>&1 52 ${SFTP} -S ${SSH} -oControlPath=$CTL otherhost >$LOG 2>&1
42test -f ${COPY} || fail "sftp: failed copy ${DATA}" 53test -f ${COPY} || fail "sftp: failed copy ${DATA}"
43cmp ${DATA} ${COPY} || fail "sftp: corrupted copy of ${DATA}" 54cmp ${DATA} ${COPY} || fail "sftp: corrupted copy of ${DATA}"
44 55
45rm -f ${COPY} 56rm -f ${COPY}
46trace "scp transfer over multiplexed connection and check result" 57trace "scp transfer over multiplexed connection and check result"
47${SCP} -S ${SSH} -oControlPath=$CTL otherhost:${DATA} ${COPY} >/dev/null 2>&1 58${SCP} -S ${SSH} -oControlPath=$CTL otherhost:${DATA} ${COPY} >$LOG 2>&1
48test -f ${COPY} || fail "scp: failed copy ${DATA}" 59test -f ${COPY} || fail "scp: failed copy ${DATA}"
49cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}" 60cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}"
50 61
@@ -69,6 +80,15 @@ for s in 0 1 4 5 44; do
69 fi 80 fi
70done 81done
71 82
72# kill master, remove control socket. ssh -MS will exit when sleep exits 83trace "test check command"
73$SUDO kill `cat $PIDFILE` 84${SSH} -S $CTL -Ocheck otherhost || fail "check command failed"
74rm -f $CTL 85
86trace "test exit command"
87${SSH} -S $CTL -Oexit otherhost || fail "send exit command failed"
88
89# Wait for master to exit
90sleep 2
91
92ps -p $MASTER_PID >/dev/null && fail "exit command failed"
93
94cleanup