diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2006-07-11 18:51:22 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2006-07-11 18:51:22 +0000 |
commit | 71eea39e8b410d4123d053d5aeaafdfc3745660a (patch) | |
tree | 2ba0035f7c0d7866c2e3165456467356bad1cd20 /regress/usr.bin/ssh | |
parent | 08c0648542c379047cf09b0eee2f33d4d17cf40f (diff) |
add test for ExitOnForwardFailure=yes
Diffstat (limited to 'regress/usr.bin/ssh')
-rw-r--r-- | regress/usr.bin/ssh/forwarding.sh | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/regress/usr.bin/ssh/forwarding.sh b/regress/usr.bin/ssh/forwarding.sh index dcdd9a6f9c4..38c311d5c8c 100644 --- a/regress/usr.bin/ssh/forwarding.sh +++ b/regress/usr.bin/ssh/forwarding.sh @@ -1,4 +1,4 @@ -# $OpenBSD: forwarding.sh,v 1.5 2005/03/10 10:20:39 dtucker Exp $ +# $OpenBSD: forwarding.sh,v 1.6 2006/07/11 18:51:21 markus Exp $ # Placed in the Public Domain. tid="local and remote forwarding" @@ -33,6 +33,36 @@ for p in 1 2; do done for p in 1 2; do +for d in L R; do + trace "exit on -$d forward failure, proto $p" + + # this one should succeed + ${SSH} -$p -F $OBJ/ssh_config \ + -$d ${base}01:127.0.0.1:$PORT \ + -$d ${base}02:127.0.0.1:$PORT \ + -$d ${base}03:127.0.0.1:$PORT \ + -$d ${base}04:127.0.0.1:$PORT \ + -oExitOnForwardFailure=yes somehost true + if [ $? != 0 ]; then + fail "connection failed, should not" + else + # this one should fail + ${SSH} -q -$p -F $OBJ/ssh_config \ + -$d ${base}01:127.0.0.1:$PORT \ + -$d ${base}02:127.0.0.1:$PORT \ + -$d ${base}03:127.0.0.1:$PORT \ + -$d ${base}01:127.0.0.1:$PORT \ + -$d ${base}04:127.0.0.1:$PORT \ + -oExitOnForwardFailure=yes somehost true + r=$? + if [ $r != 255 ]; then + fail "connection not termintated, but should ($r)" + fi + fi +done +done + +for p in 1 2; do trace "simple clear forwarding proto $p" ${SSH} -$p -F $OBJ/ssh_config -oClearAllForwardings=yes somehost true |