summaryrefslogtreecommitdiff
path: root/regress/dynamic-forward.sh
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2003-06-28 12:42:09 +1000
committerDarren Tucker <dtucker@zip.com.au>2003-06-28 12:42:09 +1000
commitb611c12e67fcdd35b4afb2bf3fafc6f626059f0a (patch)
tree9e4862fd1c0403e8a059dc36bc209a93a0a002a8 /regress/dynamic-forward.sh
parenta99c1b77ab1c866d42ebc48c86da5767b2f6f53d (diff)
- (dtucker) [regress/dynamic-forward.sh] Import new regression test.
Diffstat (limited to 'regress/dynamic-forward.sh')
-rw-r--r--regress/dynamic-forward.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/regress/dynamic-forward.sh b/regress/dynamic-forward.sh
new file mode 100644
index 000000000..90a2ab225
--- /dev/null
+++ b/regress/dynamic-forward.sh
@@ -0,0 +1,37 @@
1# $OpenBSD: dynamic-forward.sh,v 1.1 2003/06/26 14:23:10 markus Exp $
2# Placed in the Public Domain.
3
4tid="dynamic forwarding"
5
6PORT=4242
7FWDPORT=4243
8
9if [ -x `which nc` ] && nc -h 2>&1 | grep "x proxy address" >/dev/null; then
10 proxycmd="nc -x 127.0.0.1:$FWDPORT -X"
11elif [ -x `which connect` ]; then
12 proxycmd="connect -S 127.0.0.1:$FWDPORT -"
13else
14 echo "skipped (no suitable ProxyCommand found)"
15 exit 0
16fi
17trace "will use ProxyCommand $proxycmd"
18
19start_sshd
20
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"
26 ${SSH} -$p -F $OBJ/ssh_config -f -D $FWDPORT somehost sleep 10
27
28 trace "transfer over forwarded channel and check result"
29 ${SSH} -F $OBJ/ssh_config -o "ProxyCommand ${proxycmd}${s} $h $PORT" \
30 somehost cat /bin/ls > $OBJ/ls.copy
31 test -f $OBJ/ls.copy || fail "failed copy /bin/ls"
32 cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls"
33
34 sleep 10
35 done
36 done
37done