summaryrefslogtreecommitdiff
path: root/regress/usr.bin
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2013-04-22 07:28:54 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2013-04-22 07:28:54 +0000
commit414d8f47368084cc07db3b186ebe93e69578eaf6 (patch)
tree41f49001dd2e25fe5112c4a4e1de877c4d6528a1 /regress/usr.bin
parentae77347ea6965515614f23559b39db1edeb4120b (diff)
Add tests for -Oforward and -Ocancel for local and remote forwards
Diffstat (limited to 'regress/usr.bin')
-rw-r--r--regress/usr.bin/ssh/multiplex.sh23
1 files changed, 22 insertions, 1 deletions
diff --git a/regress/usr.bin/ssh/multiplex.sh b/regress/usr.bin/ssh/multiplex.sh
index 87a3a69ec5d..bdf68e69073 100644
--- a/regress/usr.bin/ssh/multiplex.sh
+++ b/regress/usr.bin/ssh/multiplex.sh
@@ -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.
CTL=$OBJ/ctl-sock
@@ -7,6 +7,7 @@ tid="connection multiplexing"
DATA=/bin/ls
COPY=$OBJ/ls.copy
+P=3301 # test port
wait_for_mux_master_ready()
{
@@ -91,6 +92,26 @@ verbose "test $tid: cmd check"
${SSH} -F $OBJ/ssh_config -S $CTL -Ocheck otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \
|| 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"
${SSH} -F $OBJ/ssh_config -S $CTL -Oexit otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \
|| fail "send exit command failed"