diff options
author | Darren Tucker <dtucker@zip.com.au> | 2003-06-28 12:42:09 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2003-06-28 12:42:09 +1000 |
commit | b611c12e67fcdd35b4afb2bf3fafc6f626059f0a (patch) | |
tree | 9e4862fd1c0403e8a059dc36bc209a93a0a002a8 /regress | |
parent | a99c1b77ab1c866d42ebc48c86da5767b2f6f53d (diff) |
- (dtucker) [regress/dynamic-forward.sh] Import new regression test.
Diffstat (limited to 'regress')
-rw-r--r-- | regress/dynamic-forward.sh | 37 |
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 | |||
4 | tid="dynamic forwarding" | ||
5 | |||
6 | PORT=4242 | ||
7 | FWDPORT=4243 | ||
8 | |||
9 | if [ -x `which nc` ] && nc -h 2>&1 | grep "x proxy address" >/dev/null; then | ||
10 | proxycmd="nc -x 127.0.0.1:$FWDPORT -X" | ||
11 | elif [ -x `which connect` ]; then | ||
12 | proxycmd="connect -S 127.0.0.1:$FWDPORT -" | ||
13 | else | ||
14 | echo "skipped (no suitable ProxyCommand found)" | ||
15 | exit 0 | ||
16 | fi | ||
17 | trace "will use ProxyCommand $proxycmd" | ||
18 | |||
19 | start_sshd | ||
20 | |||
21 | for 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 | ||
37 | done | ||