[multiplex.sh]
     Add tests for -Oforward and -Ocancel for local and remote forwards
This commit is contained in:
Darren Tucker 2013-05-17 09:37:31 +10:00
parent 40aaff7e4b
commit a4df65b9fc
2 changed files with 23 additions and 2 deletions

View File

@ -25,7 +25,7 @@
[regress/Makefile regress/sftp-chroot.sh] [regress/Makefile regress/sftp-chroot.sh]
test sshd ChrootDirectory+internal-sftp; feedback & ok dtucker@ test sshd ChrootDirectory+internal-sftp; feedback & ok dtucker@
- dtucker@cvs.openbsd.org 2013/04/22 07:23:08 - dtucker@cvs.openbsd.org 2013/04/22 07:23:08
[multiplex.sh] [regress/multiplex.sh]
Write mux master logs to regress.log instead of ssh.log to keep separate Write mux master logs to regress.log instead of ssh.log to keep separate
20130516 20130516

View File

@ -1,4 +1,4 @@
# $OpenBSD: multiplex.sh,v 1.19 2013/04/22 07:23:08 dtucker Exp $ # $OpenBSD: multiplex.sh,v 1.20 2013/04/22 07:28:53 dtucker Exp $
# Placed in the Public Domain. # Placed in the Public Domain.
CTL=/tmp/openssh.regress.ctl-sock.$$ CTL=/tmp/openssh.regress.ctl-sock.$$
@ -12,6 +12,7 @@ fi
DATA=/bin/ls${EXEEXT} DATA=/bin/ls${EXEEXT}
COPY=$OBJ/ls.copy COPY=$OBJ/ls.copy
P=3301 # test port
wait_for_mux_master_ready() wait_for_mux_master_ready()
{ {
@ -96,6 +97,26 @@ verbose "test $tid: cmd check"
${SSH} -F $OBJ/ssh_config -S $CTL -Ocheck otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \ ${SSH} -F $OBJ/ssh_config -S $CTL -Ocheck otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \
|| fail "check command failed" || fail "check command failed"
verbose "test $tid: cmd forward local"
${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L $P:localhost:$PORT otherhost \
|| fail "request local forward failed"
${SSH} -F $OBJ/ssh_config -p$P otherhost true \
|| fail "connect to local forward port failed"
${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -L $P:localhost:$PORT otherhost \
|| fail "cancel local forward failed"
${SSH} -F $OBJ/ssh_config -p$P otherhost true \
&& fail "local forward port still listening"
verbose "test $tid: cmd forward remote"
${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R $P:localhost:$PORT otherhost \
|| fail "request remote forward failed"
${SSH} -F $OBJ/ssh_config -p$P otherhost true \
|| fail "connect to remote forwarded port failed"
${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -R $P:localhost:$PORT otherhost \
|| fail "cancel remote forward failed"
${SSH} -F $OBJ/ssh_config -p$P otherhost true \
&& fail "remote forward port still listening"
verbose "test $tid: cmd exit" verbose "test $tid: cmd exit"
${SSH} -F $OBJ/ssh_config -S $CTL -Oexit otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \ ${SSH} -F $OBJ/ssh_config -S $CTL -Oexit otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \
|| fail "send exit command failed" || fail "send exit command failed"