summaryrefslogtreecommitdiff
path: root/rts.exp
blob: fbea93baad9e9190f606366b5b6b90e45f064d9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
--- tcpclient prints usage message without enough arguments
tcpclient: usage: tcpclient [ -hHrRdDqQv ] [ -i localip ] [ -p localport ] [ -T timeoutconn ] [ -l localname ] [ -t timeoutinfo ] host port program
100
--- tcpclient prints error message with unknown port name
tcpclient: fatal: unable to figure out port number for nonexistentport
111
--- tcpclient prints error message when connection fails
tcpclient: unable to connect to 127.0.0.1 port 16: connection refused
111
--- tcpclient -q does not print error message when connection fails
111
--- tcpclient understands empty host name as synonym for 0
tcpclient: unable to connect to 127.0.0.1 port 16: connection refused
111
--- tcpclient understands unbracketed IP address
tcpclient: unable to connect to 127.0.0.1 port 16: connection refused
111
--- tcpclient understands bracketed IP address
tcpclient: unable to connect to 127.0.0.1 port 16: connection refused
111
--- tcpclient prints error message with unknown host name
tcpclient: fatal: unable to figure out IP address for nonexistent.local.
111
--- tcpserver prints usage message without enough arguments
tcpserver: usage: tcpserver [ -1pPhHrRoOdDqQv ] [ -c limit ] [ -x rules.cdb ] [ -B banner ] [ -g gid ] [ -u uid ] [ -b backlog ] [ -l localname ] [ -t timeout ] host port program
100
--- tcpserver prints error message with unknown port name
tcpserver: fatal: unable to figure out port number for nonexistentport
111
--- tcpserver prints error message with unknown host name
tcpserver: fatal: unable to figure out IP address for nonexistent.local.
111
--- tcpserver prints error message with non-local host name
tcpserver: fatal: unable to bind: address not available
111
--- tcpserver sets basic environment variables
PROTO=TCP
TCPLOCALHOST=Local
TCPLOCALIP=127.0.0.1
TCPLOCALPORT=50016
TCPREMOTEHOST=
TCPREMOTEIP=127.0.0.1
TCPREMOTEPORT=50017
TCPREMOTEINFO=
0
--- tcpclient sets basic environment variables
PROTO=TCP
TCPLOCALHOST=Local
TCPLOCALIP=127.0.0.1
TCPLOCALPORT=50017
TCPREMOTEHOST=
TCPREMOTEIP=127.0.0.1
TCPREMOTEPORT=50016
TCPREMOTEINFO=
0
--- tcpclient -v works
tcpclient: connected to 127.0.0.1 port 50016
ok
0
--- tcpserver prints error message with used port
tcpserver: fatal: unable to bind: address already used
111
--- tcpcat works; tcpserver -B works
bannerok
0
--- mconnect works
bannerok
0
--- tcprules prints usage message without enough arguments
tcprules: usage: tcprules rules.cdb rules.tmp
100
--- tcprules prints error message if it cannot create tmp
tcprules: fatal: unable to create /dev/nonexistent/tmp: file does not exist
111
--- tcprules prints error message if it cannot move tmp to cdb
tcprules: fatal: unable to move test.tmp to /dev/nonexistent/cdb: file does not exist
111
--- tcprules creates a cdb file
0
--- tcprulescheck sees deny
rule 1.2.3.4:
deny connection
0
--- tcprulescheck does not apply deny to another host
default:
allow connection
0
--- tcprules replaces a cdb file
0
--- tcprulescheck finds rule with address and info
rule joe@127.0.0.1:
set environment variable which=first
allow connection
0
--- tcprulescheck finds rule with address
rule 18.23.0.32:
set environment variable which=second
allow connection
0
--- tcprulescheck finds one-dot wildcard
rule 127.:
set environment variable which=third
allow connection
0
--- tcprulescheck finds zero-dot wildcard
rule :
set environment variable which=fourth
allow connection
0
--- tcprules handles comments, address ranges, multiple variables
0
rule 127.0.:
set environment variable which=first
set environment variable where=whatever
allow connection
rule 127.1.:
set environment variable which=first
set environment variable where=whatever
allow connection
rule 127.2.:
set environment variable which=first
set environment variable where=whatever
allow connection
rule 127.3.:
set environment variable which=first
set environment variable where=whatever
allow connection
rule 127.4.:
set environment variable which=first
set environment variable where=whatever
allow connection
rule 127.5.:
set environment variable which=first
set environment variable where=whatever
allow connection
default:
allow connection
default:
allow connection
default:
allow connection
default:
allow connection
default:
allow connection
--- addcr leaves an empty file alone
0
--- addcr leaves a partial final line alone
test0
--- addcr adds CR after the first line
test^M
0
--- addcr adds CR after the second line
test^M
test2^M
0
--- addcr handles nulls
t^@st^M
0
--- delcr leaves an empty file alone
0
--- delcr leaves a non-CR line alone
test
0
--- delcr removes CR if a line has it
test
0
--- delcr converts CR CR LF to CR LF
test^M
0
--- delcr removes CR from a partial final line
test0
--- delcr handles a non-CR partial final line
test0
--- delcr handles nulls
t^@st
0
--- fixcr leaves an empty file alone
0
--- fixcr leaves a partial final line alone
test0
--- fixcr adds CR after the first line
test^M
0
--- fixcr adds CR after the second line
test^M
test2^M
0
--- fixcr does not add CR if a line has it
test^M
0
--- fixcr handles nulls
t^@st^M
0
--- recordio works
... < test $
... > test $
... < [EOF]$
... > [EOF]$
--- recordio handles multiple-line packets
... < test $
... < test2 $
... > test $
... > test2 $
... < [EOF]$
... > [EOF]$
--- recordio handles partial final lines
... < test+$
... > test+$
... < [EOF]$
... > [EOF]$
--- argv0 works
zero
0
--- argv0 requires arguments
argv0: usage: argv0 realname program [ arg ... ]
100