summaryrefslogtreecommitdiff
path: root/regress/portnum.sh
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2009-10-07 11:00:58 +1100
committerDarren Tucker <dtucker@zip.com.au>2009-10-07 11:00:58 +1100
commita25ab018459dc366061ac98086705c561b856a19 (patch)
treecb097d0b011b5ef5b7d2ece822f42e3e40dd5584 /regress/portnum.sh
parentb99c6e14990e56eaac0b7afa8303a27bb20fc6d3 (diff)
- (dtucker) [regress/portnum.sh] Import new test.
Diffstat (limited to 'regress/portnum.sh')
-rw-r--r--regress/portnum.sh32
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
4tid="port number parsing"
5
6badport() {
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}
13goodport() {
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
21badport 0
22badport 65536
23badport 131073
24badport 2000blah
25badport blah2000
26
27goodport 1
28goodport 22
29goodport 2222
30goodport 22222
31goodport 65535
32