diff options
author | Colin Watson <cjwatson@debian.org> | 2010-03-31 00:48:57 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2010-03-31 00:48:57 +0100 |
commit | d1a87e462e1db89f19cd960588d0c6b287cb5ccc (patch) | |
tree | f0d13e1687800f36a3c4322b94ac5230ad17bdbf /regress/portnum.sh | |
parent | 964476f91b66c475d5b8fa1e8b28d39a97a1b56e (diff) | |
parent | 004a7fb9c6a00b13dc98f56599918a54a3506d10 (diff) |
merge 5.4p1
Diffstat (limited to 'regress/portnum.sh')
-rw-r--r-- | regress/portnum.sh | 34 |
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 | |||
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 | : | ||
18 | else | ||
19 | fail "$tid rejected valid port $port" | ||
20 | fi | ||
21 | } | ||
22 | |||
23 | badport 0 | ||
24 | badport 65536 | ||
25 | badport 131073 | ||
26 | badport 2000blah | ||
27 | badport blah2000 | ||
28 | |||
29 | goodport 1 | ||
30 | goodport 22 | ||
31 | goodport 2222 | ||
32 | goodport 22222 | ||
33 | goodport 65535 | ||
34 | |||