summaryrefslogtreecommitdiff
path: root/regress/portnum.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/portnum.sh')
-rw-r--r--regress/portnum.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/regress/portnum.sh b/regress/portnum.sh
new file mode 100644
index 000000000..1de0680fe
--- /dev/null
+++ b/regress/portnum.sh
@@ -0,0 +1,34 @@
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 :
18 else
19 fail "$tid rejected valid port $port"
20 fi
21}
22
23badport 0
24badport 65536
25badport 131073
26badport 2000blah
27badport blah2000
28
29goodport 1
30goodport 22
31goodport 2222
32goodport 22222
33goodport 65535
34