diff options
author | 2006-07-11 18:51:21 +0000 | |
---|---|---|
committer | 2006-07-11 18:51:21 +0000 | |
commit | 91776c60e5b2704ad0bb09d71f5413e09f0d9d22 (patch) | |
tree | 4ace95b2a38ca2bc308594edfa73d72ba205fc35 | |
parent | add ExitOnForwardFailure: terminate the connection if ssh(1) (diff) | |
download | wireguard-openbsd-91776c60e5b2704ad0bb09d71f5413e09f0d9d22.tar.xz wireguard-openbsd-91776c60e5b2704ad0bb09d71f5413e09f0d9d22.zip |
add test for ExitOnForwardFailure=yes
-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 |