summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
Diffstat (limited to 'regress')
-rw-r--r--regress/dynamic-forward.sh35
1 files changed, 22 insertions, 13 deletions
diff --git a/regress/dynamic-forward.sh b/regress/dynamic-forward.sh
index 90a2ab225..d090814c5 100644
--- a/regress/dynamic-forward.sh
+++ b/regress/dynamic-forward.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: dynamic-forward.sh,v 1.1 2003/06/26 14:23:10 markus Exp $ 1# $OpenBSD: dynamic-forward.sh,v 1.2 2003/07/03 08:21:46 markus Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="dynamic forwarding" 4tid="dynamic forwarding"
@@ -19,19 +19,28 @@ trace "will use ProxyCommand $proxycmd"
19start_sshd 19start_sshd
20 20
21for p in 1 2; do 21for p in 1 2; do
22 for s in 4; do
23 for h in 127.0.0.1 localhost; do
24 trace "testing ssh protocol $p socks version $s host $h"
25 trace "start dynamic forwarding, fork to background" 22 trace "start dynamic forwarding, fork to background"
26 ${SSH} -$p -F $OBJ/ssh_config -f -D $FWDPORT somehost sleep 10 23 ${SSH} -$p -F $OBJ/ssh_config -f -D $FWDPORT -q somehost \
24 exec sh -c \'"echo \$\$ > $OBJ/remote_pid; exec sleep 444"\'
27 25
28 trace "transfer over forwarded channel and check result" 26 for s in 4 5; do
29 ${SSH} -F $OBJ/ssh_config -o "ProxyCommand ${proxycmd}${s} $h $PORT" \ 27 for h in 127.0.0.1 localhost; do
30 somehost cat /bin/ls > $OBJ/ls.copy 28 trace "testing ssh protocol $p socks version $s host $h"
31 test -f $OBJ/ls.copy || fail "failed copy /bin/ls" 29 ${SSH} -F $OBJ/ssh_config \
32 cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls" 30 -o "ProxyCommand ${proxycmd}${s} $h $PORT" \
31 somehost cat /bin/ls > $OBJ/ls.copy
32 test -f $OBJ/ls.copy || fail "failed copy /bin/ls"
33 cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls"
34 done
35 done
33 36
34 sleep 10 37 if [ -f $OBJ/remote_pid ]; then
35 done 38 remote=`cat $OBJ/remote_pid`
36 done 39 trace "terminate remote shell, pid $remote"
40 if [ $remote -gt 1 ]; then
41 kill -HUP $remote
42 fi
43 else
44 fail "no pid file: $OBJ/remote_pid"
45 fi
37done 46done