- djm@cvs.openbsd.org 2010/01/13 01:40:16
[openssh-git.git] / regress / portnum.sh
blob82abbc9f0d622b9d8023f0398ee34a735e10cfd0
1 # $OpenBSD: portnum.sh,v 1.1 2009/08/13 00:57:17 djm Exp $
2 # Placed in the Public Domain.
4 tid="port number parsing"
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"
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"
21 badport 0
22 badport 65536
23 badport 131073
24 badport 2000blah
25 badport blah2000
27 goodport 1
28 goodport 22
29 goodport 2222
30 goodport 22222
31 goodport 65535