Skip to content

Commit cf88765

Browse files
committed
tests: switched to 127.0.0.2 instead of agentzh.org for timeout-related tests.
1 parent 01735c2 commit cf88765

18 files changed

+54
-52
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ before_script:
9696

9797
script:
9898
- sudo iptables -I OUTPUT 1 -p udp --dport 10086 -j REJECT
99+
- sudo iptables -A OUTPUT -p tcp --dst 127.0.0.2 --dport 12345 -j DROP
100+
- sudo iptables -A OUTPUT -p udp --dst 127.0.0.2 --dport 12345 -j DROP
99101
- cd luajit2/
100102
- make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT -msse4.2' > build.log 2>&1 || (cat build.log && exit 1)
101103
- sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1)

t/023-rewrite/client-abort.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ bad things happen
199199
200200
location = /sub {
201201
proxy_ignore_client_abort on;
202-
proxy_pass http://agentzh.org:12345/;
202+
proxy_pass http://127.0.0.2:12345/;
203203
}
204204

205205
location = /sleep {
@@ -240,7 +240,7 @@ client prematurely closed connection
240240
241241
location = /sub {
242242
proxy_ignore_client_abort off;
243-
proxy_pass http://agentzh.org:12345/;
243+
proxy_pass http://127.0.0.2:12345/;
244244
}
245245
--- request
246246
GET /t

t/023-rewrite/tcp-socket-timeout.t

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ __DATA__
4646
location /t1 {
4747
rewrite_by_lua '
4848
local sock = ngx.socket.tcp()
49-
local ok, err = sock:connect("agentzh.org", 12345)
49+
local ok, err = sock:connect("127.0.0.2", 12345)
5050
if not ok then
5151
ngx.say("failed to connect: ", err)
5252
return
@@ -63,7 +63,7 @@ GET /t1
6363
failed to connect: timeout
6464
--- error_log
6565
lua tcp socket connect timeout: 100
66-
lua tcp socket connect timed out, when connecting to 172.105.207.225:12345
66+
lua tcp socket connect timed out, when connecting to 127.0.0.2:12345
6767
--- timeout: 10
6868

6969

@@ -79,7 +79,7 @@ lua tcp socket connect timed out, when connecting to 172.105.207.225:12345
7979
rewrite_by_lua '
8080
local sock = ngx.socket.tcp()
8181
sock:settimeout(150)
82-
local ok, err = sock:connect("agentzh.org", 12345)
82+
local ok, err = sock:connect("127.0.0.2", 12345)
8383
if not ok then
8484
ngx.say("failed to connect: ", err)
8585
return
@@ -114,7 +114,7 @@ lua tcp socket connect timeout: 150
114114
rewrite_by_lua '
115115
local sock = ngx.socket.tcp()
116116
sock:settimeout(nil)
117-
local ok, err = sock:connect("agentzh.org", 12345)
117+
local ok, err = sock:connect("127.0.0.2", 12345)
118118
if not ok then
119119
ngx.say("failed to connect: ", err)
120120
return
@@ -149,7 +149,7 @@ lua tcp socket connect timeout: 102
149149
rewrite_by_lua '
150150
local sock = ngx.socket.tcp()
151151
sock:settimeout(0)
152-
local ok, err = sock:connect("agentzh.org", 12345)
152+
local ok, err = sock:connect("127.0.0.2", 12345)
153153
if not ok then
154154
ngx.say("failed to connect: ", err)
155155
return
@@ -185,7 +185,7 @@ lua tcp socket connect timeout: 102
185185
rewrite_by_lua '
186186
local sock = ngx.socket.tcp()
187187
sock:settimeout(-1)
188-
local ok, err = sock:connect("agentzh.org", 12345)
188+
local ok, err = sock:connect("127.0.0.2", 12345)
189189
if not ok then
190190
ngx.say("failed to connect: ", err)
191191
return

t/023-rewrite/tcp-socket.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ qr/connect\(\) failed \(\d+: Connection refused\)/
304304
location /test {
305305
rewrite_by_lua '
306306
local sock = ngx.socket.tcp()
307-
local ok, err = sock:connect("agentzh.org", 12345)
307+
local ok, err = sock:connect("127.0.0.2", 12345)
308308
ngx.say("connect: ", ok, " ", err)
309309
310310
local bytes
@@ -329,7 +329,7 @@ send: nil closed
329329
receive: nil closed
330330
close: nil closed
331331
--- error_log
332-
lua tcp socket connect timed out, when connecting to 172.105.207.225:12345
332+
lua tcp socket connect timed out, when connecting to 127.0.0.2:12345
333333
--- timeout: 10
334334
335335

t/023-rewrite/uthread-exit.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ exiting the user thread
311311
ngx.thread.spawn(f)
312312
ngx.say("after")
313313
local sock = ngx.socket.tcp()
314-
local ok, err = sock:connect("agentzh.org", 12345)
314+
local ok, err = sock:connect("127.0.0.2", 12345)
315315
if not ok then
316316
ngx.say("failed to connect: ", err)
317317
return
@@ -521,7 +521,7 @@ after
521521
ngx.say("after")
522522
local sock = ngx.socket.tcp()
523523
sock:settimeout(12000)
524-
local ok, err = sock:connect("172.105.207.225", 12345)
524+
local ok, err = sock:connect("127.0.0.2", 12345)
525525
if not ok then
526526
ngx.say("failed to connect: ", err)
527527
return

t/024-access/client-abort.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ bad things happen
200200
201201
location = /sub {
202202
proxy_ignore_client_abort on;
203-
proxy_pass http://agentzh.org:12345/;
203+
proxy_pass http://127.0.0.2:12345/;
204204
}
205205

206206
location = /sleep {
@@ -241,7 +241,7 @@ client prematurely closed connection
241241
242242
location = /sub {
243243
proxy_ignore_client_abort off;
244-
proxy_pass http://agentzh.org:12345/;
244+
proxy_pass http://127.0.0.2:12345/;
245245
}
246246
--- request
247247
GET /t

t/024-access/uthread-exit.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ after
502502
ngx.say("after")
503503
local sock = ngx.socket.tcp()
504504
sock:settimeout(12000)
505-
local ok, err = sock:connect("172.105.207.225", 12345)
505+
local ok, err = sock:connect("127.0.0.2", 12345)
506506
if not ok then
507507
ngx.say("failed to connect: ", err)
508508
return

t/027-multi-capture.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ proxy_cache_path conf/cache levels=1:2 keys_zone=STATIC:10m inactive=10m max_siz
743743

744744
location = /proxy {
745745
proxy_cache STATIC;
746-
proxy_pass http://agentzh.org:12345;
746+
proxy_pass http://127.0.0.2:12345;
747747
proxy_cache_key $proxy_host$uri$args;
748748
proxy_cache_valid any 1s;
749749
#proxy_http_version 1.1;

t/030-uri-args.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ done
421421
ngx.req.set_uri_args("hello")
422422
ngx.req.set_uri("/bar", true);
423423
';
424-
proxy_pass http://agentzh.org:12345;
424+
proxy_pass http://127.0.0.2:12345;
425425
}
426426
--- request
427427
GET /foo?world
@@ -568,7 +568,7 @@ HTTP/1.0 ca%20t=%25
568568
ngx.req.set_uri("/bar", true);
569569
ngx.exit(503)
570570
';
571-
proxy_pass http://agentzh.org:12345;
571+
proxy_pass http://127.0.0.2:12345;
572572
}
573573
--- request
574574
GET /foo?world

t/058-tcp-socket.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ qr/connect\(\) failed \(\d+: Connection refused\)/
298298
location /test {
299299
content_by_lua '
300300
local sock = ngx.socket.tcp()
301-
local ok, err = sock:connect("agentzh.org", 12345)
301+
local ok, err = sock:connect("127.0.0.2", 12345)
302302
ngx.say("connect: ", ok, " ", err)
303303
304304
local bytes
@@ -321,7 +321,7 @@ send: nil closed
321321
receive: nil closed
322322
close: nil closed
323323
--- error_log
324-
lua tcp socket connect timed out, when connecting to 172.105.207.225:12345
324+
lua tcp socket connect timed out, when connecting to 127.0.0.2:12345
325325
--- timeout: 10
326326
327327
@@ -3315,7 +3315,7 @@ close: 1 nil
33153315
33163316
local thr = ngx.thread.spawn(function ()
33173317
sock = ngx.socket.tcp()
3318-
local ok, err = sock:connect("agentzh.org", 12345)
3318+
local ok, err = sock:connect("127.0.0.2", 12345)
33193319
if not ok then
33203320
ngx.say("failed to connect: ", err)
33213321
return

0 commit comments

Comments
 (0)