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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
| | From 3f807e104572b38143a1015be57d875088ceaebb Mon Sep 17 00:00:00 2001
From: Alexander Barton <alex@barton.de>
Date: Thu, 17 Apr 2014 23:57:38 +0200
Subject: [PATCH] Test suite: Don't use DNS lookups
Different operating systems do behave quite differently when doing DNS
lookups, for example "127.0.0.1" sometimes resolves to "localhost" and
sometimes to "localhost.localdomain" (for example OpenBSD). And other
systems resolve "localhost" to the real host name (for example Cygwin).
So not using DNS at all makes the test site much more portable.
---
src/testsuite/channel-test.e | 2 +-
src/testsuite/check-idle.e | 2 +-
src/testsuite/connect-test.e | 2 +-
src/testsuite/invite-test.e | 2 +-
src/testsuite/join-test.e | 2 +-
src/testsuite/kick-test.e | 2 +-
src/testsuite/message-test.e | 31 ++++++++++++-------------------
src/testsuite/misc-test.e | 8 ++++----
src/testsuite/mode-test.e | 2 +-
src/testsuite/ngircd-test1.conf | 1 +
src/testsuite/ngircd-test2.conf | 1 +
src/testsuite/opless-channel-test.e | 2 +-
src/testsuite/server-link-test.e | 2 +-
src/testsuite/stress-A.e | 2 +-
src/testsuite/who-test.e | 6 +++---
src/testsuite/whois-test.e | 14 +++++++-------
16 files changed, 38 insertions(+), 43 deletions(-)
diff --git a/src/testsuite/channel-test.e b/src/testsuite/channel-test.e
index dd7eb66..39ad16a 100644
--- a/src/testsuite/channel-test.e
+++ b/src/testsuite/channel-test.e
@@ -1,7 +1,7 @@
# ngIRCd test suite
# Channel test
-spawn telnet localhost 6789
+spawn telnet 127.0.0.1 6789
expect {
timeout { exit 1 }
"Connected"
diff --git a/src/testsuite/check-idle.e b/src/testsuite/check-idle.e
index 41b8eb4..ad112b2 100644
--- a/src/testsuite/check-idle.e
+++ b/src/testsuite/check-idle.e
@@ -1,7 +1,7 @@
# ngIRCd test suite
# Idle test
-spawn telnet localhost 6789
+spawn telnet 127.0.0.1 6789
expect {
timeout { exit 1 }
"Connected"
diff --git a/src/testsuite/connect-test.e b/src/testsuite/connect-test.e
index 662f5f7..b51be0d 100644
--- a/src/testsuite/connect-test.e
+++ b/src/testsuite/connect-test.e
@@ -1,7 +1,7 @@
# ngIRCd test suite
# Server connect test
-spawn telnet localhost 6789
+spawn telnet 127.0.0.1 6789
expect {
timeout { exit 1 }
"Connected"
diff --git a/src/testsuite/invite-test.e b/src/testsuite/invite-test.e
index 3716d19..5179d8a 100644
--- a/src/testsuite/invite-test.e
+++ b/src/testsuite/invite-test.e
@@ -1,7 +1,7 @@
# ngIRCd test suite
# INVITE test
-spawn telnet localhost 6789
+spawn telnet 127.0.0.1 6789
expect {
timeout { exit 1 }
"Connected"
diff --git a/src/testsuite/join-test.e b/src/testsuite/join-test.e
index 28b4c54..c088f5c 100644
--- a/src/testsuite/join-test.e
+++ b/src/testsuite/join-test.e
@@ -1,7 +1,7 @@
# ngIRCd test suite
# JOIN test
-spawn telnet localhost 6789
+spawn telnet 127.0.0.1 6789
expect {
timeout { exit 1 }
"Connected"
diff --git a/src/testsuite/kick-test.e b/src/testsuite/kick-test.e
index 3d3c1ee..89da611 100644
--- a/src/testsuite/kick-test.e
+++ b/src/testsuite/kick-test.e
@@ -1,7 +1,7 @@
# ngIRCd test suite
# KICK test
-spawn telnet localhost 6789
+spawn telnet 127.0.0.1 6789
expect {
timeout { exit 1 }
"Connected"
diff --git a/src/testsuite/message-test.e b/src/testsuite/message-test.e
index 0e70640..5dc325d 100644
--- a/src/testsuite/message-test.e
+++ b/src/testsuite/message-test.e
@@ -1,7 +1,7 @@
# ngIRCd test suite
# PRIVMSG and NOTICE test
-spawn telnet localhost 6789
+spawn telnet 127.0.0.1 6789
expect {
timeout { exit 1 }
"Connected"
@@ -72,24 +72,17 @@ expect {
"MODE nick :-b"
}
-# The following two tests using "localhost" as host name
-# had to be disabled, because there are operating systems
-# out there, that use "localhost.<domain>" as host name
-# for 127.0.0.1 instead of just "localhost".
-# (for example OpenBSD 4, OpenSolaris, ...)
-#
-#send "privmsg ~user\%localhost :test\r"
-#expect {
-# timeout { exit 1 }
-# "@* PRIVMSG nick :test"
-#}
-#
-#send "privmsg Nick!~User@LocalHost :test\r"
-#expect {
-# timeout { exit 1 }
-# "@* PRIVMSG nick :test"
-# "401"
-#}
+send "privmsg ~user\%127.0.0.1 :test\r"
+expect {
+ timeout { exit 1 }
+ "@* PRIVMSG nick :test"
+}
+
+send "privmsg Nick!~User@127.0.0.1 :test\r"
+expect {
+ timeout { exit 1 }
+ "@* PRIVMSG nick :test"
+}
send "away :away\r"
expect {
diff --git a/src/testsuite/misc-test.e b/src/testsuite/misc-test.e
index a83bc5b..f69e7c3 100644
--- a/src/testsuite/misc-test.e
+++ b/src/testsuite/misc-test.e
@@ -1,7 +1,7 @@
# ngIRCd test suite
# Misc test
-spawn telnet localhost 6789
+spawn telnet 127.0.0.1 6789
expect {
timeout { exit 1 }
"Connected"
@@ -130,7 +130,7 @@ expect {
send "userhost nick\r"
expect {
timeout { exit 1 }
- -re ":ngircd.test.server 302 nick :?nick=+.*@(localhos.*|127.0.0.1)"
+ -re ":ngircd.test.server 302 nick :?nick=+.*@127.0.0.1"
}
send "userhost doesnotexist\r"
@@ -142,7 +142,7 @@ expect {
send "userhost nick doesnotexist nick doesnotexist\r"
expect {
timeout { exit 1 }
- -re ":ngircd.test.server 302 nick :nick=+.*@(localhos.*|127.0.0.1) nick=+.*@(localhos.*|127.0.0.1)"
+ -re ":ngircd.test.server 302 nick :nick=+.*@127.0.0.1 nick=+.*@127.0.0.1"
}
send "away :testing\r"
@@ -154,7 +154,7 @@ expect {
send "userhost nick nick nick nick nick nick\r"
expect {
timeout { exit 1 }
- -re ":ngircd.test.server 302 nick :nick=-.*@(localhos.*|127.0.0.1) nick=-.*@(localhos.*|127.0.0.1) nick=-.*@(localhos.*|127.0.0.1) nick=-.*@(localhos.*|127.0.0.1) nick=-.*@(localhos.*|127.0.0.1)\r"
+ -re ":ngircd.test.server 302 nick :nick=-.*@127.0.0.1 nick=-.*@127.0.0.1 nick=-.*@127.0.0.1 nick=-.*@127.0.0.1 nick=-.*@127.0.0.1\r"
}
send "quit\r"
diff --git a/src/testsuite/mode-test.e b/src/testsuite/mode-test.e
index d6726a4..86e4f2d 100644
--- a/src/testsuite/mode-test.e
+++ b/src/testsuite/mode-test.e
@@ -1,7 +1,7 @@
# ngIRCd test suite
# MODE test
-spawn telnet localhost 6789
+spawn telnet 127.0.0.1 6789
expect {
timeout { exit 1 }
"Connected"
diff --git a/src/testsuite/ngircd-test1.conf b/src/testsuite/ngircd-test1.conf
index 0d0cccc..4dec533 100644
--- a/src/testsuite/ngircd-test1.conf
+++ b/src/testsuite/ngircd-test1.conf
@@ -17,6 +17,7 @@
OperCanUseMode = yes
Ident = no
IncludeDir = /var/empty
+ DNS = no
PAM = no
[Operator]
diff --git a/src/testsuite/ngircd-test2.conf b/src/testsuite/ngircd-test2.conf
index c9d7f6c..0d24c4a 100644
--- a/src/testsuite/ngircd-test2.conf
+++ b/src/testsuite/ngircd-test2.conf
@@ -17,6 +17,7 @@
OperCanUseMode = yes
Ident = no
IncludeDir = /var/empty
+ DNS = no
PAM = no
[Operator]
diff --git a/src/testsuite/opless-channel-test.e b/src/testsuite/opless-channel-test.e
index 7d94172..4611fe1 100644
--- a/src/testsuite/opless-channel-test.e
+++ b/src/testsuite/opless-channel-test.e
@@ -1,7 +1,7 @@
# ngIRCd test suite
# Op-less channel test
-spawn telnet localhost 6789
+spawn telnet 127.0.0.1 6789
expect {
timeout { exit 1 }
"Connected"
diff --git a/src/testsuite/server-link-test.e b/src/testsuite/server-link-test.e
index cf3fae8..910f8c8 100644
--- a/src/testsuite/server-link-test.e
+++ b/src/testsuite/server-link-test.e
@@ -1,7 +1,7 @@
# ngIRCd test suite
# server-server link test
-spawn telnet localhost 6790
+spawn telnet 127.0.0.1 6790
expect {
timeout { exit 1 }
"Connected"
diff --git a/src/testsuite/stress-A.e b/src/testsuite/stress-A.e
index 256d5d1..d51adaa 100644
--- a/src/testsuite/stress-A.e
+++ b/src/testsuite/stress-A.e
@@ -3,7 +3,7 @@
set timeout 30
-spawn telnet localhost 6789
+spawn telnet 127.0.0.1 6789
expect {
timeout { exit 1 }
"Connected"
diff --git a/src/testsuite/who-test.e b/src/testsuite/who-test.e
index a41e6b6..39d50ed 100644
--- a/src/testsuite/who-test.e
+++ b/src/testsuite/who-test.e
@@ -1,7 +1,7 @@
# ngIRCd test suite
# WHO test
-spawn telnet localhost 6789
+spawn telnet 127.0.0.1 6789
expect {
timeout { exit 1 }
"Connected"
@@ -62,7 +62,7 @@ expect {
":ngircd.test.server 352 nick #channel * * ngircd.test.server nick G@ :0 Real Name"
}
-send "who localhos*\r"
+send "who 127.0.0.*\r"
expect {
timeout { exit 1 }
":ngircd.test.server 352 nick \* * * ngircd.test.server nick G :0 Real Name"
@@ -120,7 +120,7 @@ expect {
"305 nick"
}
-send "who ??cal*ho*\r"
+send "who ??7.*0*\r"
expect {
timeout { exit 1 }
":ngircd.test.server 352 nick \* * * ngircd.test.server nick H* :0 Real Name"
diff --git a/src/testsuite/whois-test.e b/src/testsuite/whois-test.e
index 16b1184..44eee66 100644
--- a/src/testsuite/whois-test.e
+++ b/src/testsuite/whois-test.e
@@ -1,7 +1,7 @@
# ngIRCd test suite
# WHOIS test
-spawn telnet localhost 6789
+spawn telnet 127.0.0.1 6789
expect {
timeout { exit 1 }
"Connected"
@@ -17,7 +17,7 @@ expect {
send "whois nick\r"
expect {
timeout { exit 1 }
- "311 nick nick ~user localhost* \* :Real Name\r"
+ "311 nick nick ~user 127.0.0.1 \* :Real Name\r"
}
expect {
timeout { exit 1 }
@@ -27,25 +27,25 @@ expect {
send "whois *\r"
expect {
timeout { exit 1 }
- "311 nick nick ~user localhost* \* :Real Name\r"
+ "311 nick nick ~user 127.0.0.1* \* :Real Name\r"
}
send "whois n*\r"
expect {
timeout { exit 1 }
- "311 nick nick ~user localhost* \* :Real Name\r"
+ "311 nick nick ~user 127.0.0.1* \* :Real Name\r"
}
send "whois ?ick\r"
expect {
timeout { exit 1 }
- "311 nick nick ~user localhost* \* :Real Name\r"
+ "311 nick nick ~user 127.0.0.1* \* :Real Name\r"
}
send "whois ????,n?*k\r"
expect {
timeout { exit 1 }
- "311 nick nick ~user localhost* \* :Real Name\r"
+ "311 nick nick ~user 127.0.0.1* \* :Real Name\r"
}
send "whois unknown\r"
@@ -61,7 +61,7 @@ expect {
send "whois ngircd.test.server2 nick\r"
expect {
timeout { exit 1 }
- ":ngircd.test.server2 311 nick nick ~user localhost* \* :Real Name\r"
+ ":ngircd.test.server2 311 nick nick ~user 127.0.0.1* \* :Real Name\r"
}
send "whois nosuchserver unknown\r"
--
1.9.1
|