diff options
Diffstat (limited to 'regress/multiplex.sh')
-rw-r--r-- | regress/multiplex.sh | 34 |
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 | ||
4 | CTL=$OBJ/ctl-sock | 4 | CTL=$OBJ/ctl-sock |
5 | 5 | ||
6 | tid="connection multiplexing" | 6 | tid="connection multiplexing" |
7 | 7 | ||
8 | if grep "#define.*DISABLE_FD_PASSING" ${BUILDDIR}/config.h >/dev/null 2>&1 | ||
9 | then | ||
10 | echo "skipped (not supported on this platform)" | ||
11 | exit 0 | ||
12 | fi | ||
13 | |||
8 | DATA=/bin/ls${EXEEXT} | 14 | DATA=/bin/ls${EXEEXT} |
9 | COPY=$OBJ/ls.copy | 15 | COPY=$OBJ/ls.copy |
16 | LOG=$TEST_SSH_LOGFILE | ||
10 | 17 | ||
11 | start_sshd | 18 | start_sshd |
12 | 19 | ||
13 | trace "start master, fork to background" | 20 | trace "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 & |
22 | MASTER_PID=$! | ||
23 | |||
24 | # Wait for master to start and authenticate | ||
25 | sleep 5 | ||
15 | 26 | ||
16 | verbose "test $tid: envpass" | 27 | verbose "test $tid: envpass" |
17 | trace "env passing over multiplexed connection" | 28 | trace "env passing over multiplexed connection" |
@@ -38,13 +49,13 @@ cmp ${DATA} ${COPY} || fail "ssh -S ctl: corrupted copy of ${DATA}" | |||
38 | rm -f ${COPY} | 49 | rm -f ${COPY} |
39 | trace "sftp transfer over multiplexed connection and check result" | 50 | trace "sftp transfer over multiplexed connection and check result" |
40 | echo "get ${DATA} ${COPY}" | \ | 51 | echo "get ${DATA} ${COPY}" | \ |
41 | ${SFTP} -S ${SSH} -oControlPath=$CTL otherhost >/dev/null 2>&1 | 52 | ${SFTP} -S ${SSH} -oControlPath=$CTL otherhost >$LOG 2>&1 |
42 | test -f ${COPY} || fail "sftp: failed copy ${DATA}" | 53 | test -f ${COPY} || fail "sftp: failed copy ${DATA}" |
43 | cmp ${DATA} ${COPY} || fail "sftp: corrupted copy of ${DATA}" | 54 | cmp ${DATA} ${COPY} || fail "sftp: corrupted copy of ${DATA}" |
44 | 55 | ||
45 | rm -f ${COPY} | 56 | rm -f ${COPY} |
46 | trace "scp transfer over multiplexed connection and check result" | 57 | trace "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 |
48 | test -f ${COPY} || fail "scp: failed copy ${DATA}" | 59 | test -f ${COPY} || fail "scp: failed copy ${DATA}" |
49 | cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}" | 60 | cmp ${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 |
70 | done | 81 | done |
71 | 82 | ||
72 | # kill master, remove control socket. ssh -MS will exit when sleep exits | 83 | trace "test check command" |
73 | $SUDO kill `cat $PIDFILE` | 84 | ${SSH} -S $CTL -Ocheck otherhost || fail "check command failed" |
74 | rm -f $CTL | 85 | |
86 | trace "test exit command" | ||
87 | ${SSH} -S $CTL -Oexit otherhost || fail "send exit command failed" | ||
88 | |||
89 | # Wait for master to exit | ||
90 | sleep 2 | ||
91 | |||
92 | ps -p $MASTER_PID >/dev/null && fail "exit command failed" | ||
93 | |||
94 | cleanup | ||