diff options
author | Darren Tucker <dtucker@zip.com.au> | 2009-10-07 11:00:58 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2009-10-07 11:00:58 +1100 |
commit | a25ab018459dc366061ac98086705c561b856a19 (patch) | |
tree | cb097d0b011b5ef5b7d2ece822f42e3e40dd5584 /regress/portnum.sh | |
parent | b99c6e14990e56eaac0b7afa8303a27bb20fc6d3 (diff) |
- (dtucker) [regress/portnum.sh] Import new test.
Diffstat (limited to 'regress/portnum.sh')
-rw-r--r-- | regress/portnum.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/regress/portnum.sh b/regress/portnum.sh new file mode 100644 index 000000000..82abbc9f0 --- /dev/null +++ b/regress/portnum.sh | |||
@@ -0,0 +1,32 @@ | |||
1 | # $OpenBSD: portnum.sh,v 1.1 2009/08/13 00:57:17 djm Exp $ | ||
2 | # Placed in the Public Domain. | ||
3 | |||
4 | tid="port number parsing" | ||
5 | |||
6 | badport() { | ||
7 | port=$1 | ||
8 | verbose "$tid: invalid port $port" | ||
9 | if ${SSH} -F $OBJ/ssh_proxy -p $port somehost true 2>/dev/null ; then | ||
10 | fail "$tid accepted invalid port $port" | ||
11 | fi | ||
12 | } | ||
13 | goodport() { | ||
14 | port=$1 | ||
15 | verbose "$tid: valid port $port" | ||
16 | if ! ${SSH} -F $OBJ/ssh_proxy -p $port somehost true 2>/dev/null ; then | ||
17 | fail "$tid rejected valid port $port" | ||
18 | fi | ||
19 | } | ||
20 | |||
21 | badport 0 | ||
22 | badport 65536 | ||
23 | badport 131073 | ||
24 | badport 2000blah | ||
25 | badport blah2000 | ||
26 | |||
27 | goodport 1 | ||
28 | goodport 22 | ||
29 | goodport 2222 | ||
30 | goodport 22222 | ||
31 | goodport 65535 | ||
32 | |||