- (dtucker) [regress/portnum.sh] Import new test.

This commit is contained in:
Darren Tucker 2009-10-07 11:00:58 +11:00
parent b99c6e1499
commit a25ab01845
2 changed files with 33 additions and 0 deletions

View File

@ -116,6 +116,7 @@
- dtucker@cvs.openbsd.org 2009/10/06 23:51:49
[regress/ssh2putty.sh]
Add OpenBSD tag to make syncs easier
- (dtucker) [regress/portnum.sh] Import new test.
20091002
- (djm) [Makefile.in] Mention readconf.o in ssh-keysign's make deps.

32
regress/portnum.sh Normal file
View File

@ -0,0 +1,32 @@
# $OpenBSD: portnum.sh,v 1.1 2009/08/13 00:57:17 djm Exp $
# Placed in the Public Domain.
tid="port number parsing"
badport() {
port=$1
verbose "$tid: invalid port $port"
if ${SSH} -F $OBJ/ssh_proxy -p $port somehost true 2>/dev/null ; then
fail "$tid accepted invalid port $port"
fi
}
goodport() {
port=$1
verbose "$tid: valid port $port"
if ! ${SSH} -F $OBJ/ssh_proxy -p $port somehost true 2>/dev/null ; then
fail "$tid rejected valid port $port"
fi
}
badport 0
badport 65536
badport 131073
badport 2000blah
badport blah2000
goodport 1
goodport 22
goodport 2222
goodport 22222
goodport 65535