Skip to content

Commit c42e708

Browse files
committed
tests: fixed default lua path to load resty.core from many test cases.
1 parent f4f153d commit c42e708

12 files changed

+41
-41
lines changed

t/004-require.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ __DATA__
2424

2525
=== TEST 1: sanity
2626
--- stream_config eval
27-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
27+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
2828
--- stream_server_config
2929
# load
3030
content_by_lua_block {

t/014-bugs.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ __DATA__
4343

4444
=== TEST 1: sanity
4545
--- stream_config eval
46-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
46+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
4747
--- stream_server_config
4848
content_by_lua_block {
4949
package.loaded.foo = nil;
@@ -87,7 +87,7 @@ Hi"
8787

8888
=== TEST 4: lua_code_cache off + setkeepalive
8989
--- stream_config eval
90-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
90+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
9191
--- stream_server_config
9292
lua_code_cache off;
9393
content_by_lua_block {

t/023-preread/req-socket.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ received: d
5959

6060
=== TEST 2: attempt to use the req socket across request boundary
6161
--- stream_config eval
62-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
62+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
6363
--- stream_server_config
6464
preread_by_lua_block {
6565
local test = require "test"
@@ -104,7 +104,7 @@ end
104104
=== TEST 3: receive until on request_body - receiveuntil(1) on the last byte of the body
105105
See https://groups.google.com/group/openresty/browse_thread/thread/43cf01da3c681aba for details
106106
--- stream_config eval
107-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
107+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
108108
--- stream_server_config
109109
preread_by_lua_block {
110110
local test = require "test"

t/023-preread/socket-keepalive.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ __DATA__
2626

2727
=== TEST 1: sanity
2828
--- stream_config eval
29-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
29+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
3030
--- stream_server_config
3131
preread_by_lua_block {
3232
local test = require "test"
@@ -97,7 +97,7 @@ lua tcp socket get keepalive peer: using connection
9797
9898
=== TEST 2: free up the whole connection pool if no active connections
9999
--- stream_config eval
100-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
100+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
101101
--- stream_server_config
102102
preread_by_lua_block {
103103
local test = require "test"

t/025-codecache.t

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ qr/\[alert\] \S+ stream lua_code_cache is off; this will hurt performance/
179179

180180
=== TEST 6: code cache explicitly off (affects require) + content_by_lua
181181
--- stream_config eval
182-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';
182+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';
183183
lua_code_cache off;"
184184

185185
--- stream_server_config
@@ -216,7 +216,7 @@ qr/\[alert\] \S+ stream lua_code_cache is off; this will hurt performance/
216216

217217
=== TEST 7: code cache explicitly off (affects require) + content_by_lua_file
218218
--- stream_config eval
219-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';
219+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';
220220
lua_code_cache off;"
221221

222222
--- stream_server_config
@@ -298,7 +298,7 @@ qr/\[alert\] \S+ stream lua_code_cache is off; this will hurt performance/
298298

299299
=== TEST 10: no clear builtin libs (misc)
300300
--- stream_config eval
301-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
301+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
302302

303303
--- stream_server_config
304304
lua_code_cache off;
@@ -334,7 +334,7 @@ qr/\[alert\] \S+ stream lua_code_cache is off; this will hurt performance/
334334

335335
=== TEST 11: do not skip luarocks
336336
--- stream_config eval
337-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';
337+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';
338338
lua_code_cache off;"
339339

340340
--- stream_server_config
@@ -385,7 +385,7 @@ qr/\[alert\] \S+ stream lua_code_cache is off; this will hurt performance/
385385

386386
=== TEST 12: do not skip luarocks*
387387
--- stream_config eval
388-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';
388+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';
389389
lua_code_cache off;"
390390
--- stream_server_config
391391

@@ -438,7 +438,7 @@ qr/\[alert\] \S+ stream lua_code_cache is off; this will hurt performance/
438438

439439
=== TEST 13: clear _G table
440440
--- stream_config eval
441-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
441+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
442442
--- stream_server_config
443443
lua_code_cache off;
444444
content_by_lua_block {
@@ -780,7 +780,7 @@ qr/\[alert\] \S+ stream lua_code_cache is off; this will hurt performance/,
780780
781781
=== TEST 22: cosocket connection pool timeout (after Lua VM destroys)
782782
--- stream_config eval
783-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
783+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
784784
--- stream_server_config
785785
lua_code_cache off;
786786
content_by_lua_block {
@@ -843,7 +843,7 @@ qr/\blua tcp socket keepalive: free connection pool [0-9A-F]+ for "127.0.0.1:/,
843843
844844
=== TEST 23: cosocket connection pool timeout (before Lua VM destroys)
845845
--- stream_config eval
846-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
846+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
847847
--- stream_server_config
848848
lua_code_cache off;
849849
content_by_lua_block {

t/058-tcp-socket.t

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ close: 1 nil
947947
948948
=== TEST 19: cannot survive across request boundary (send)
949949
--- stream_config eval
950-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
950+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
951951
--- stream_server_config
952952
content_by_lua_block {
953953
local test = require "test"
@@ -997,7 +997,7 @@ received: OK|failed to send request: closed)\$"
997997
998998
=== TEST 20: cannot survive across request boundary (receive)
999999
--- stream_config eval
1000-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
1000+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
10011001
--- stream_server_config
10021002
content_by_lua_block {
10031003
local test = require "test"
@@ -1063,7 +1063,7 @@ received: OK|failed to receive a line: closed \[nil\])$/
10631063

10641064
=== TEST 21: cannot survive across request boundary (close)
10651065
--- stream_config eval
1066-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
1066+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
10671067
--- stream_server_config
10681068
content_by_lua_block {
10691069
local test = require "test"
@@ -1123,7 +1123,7 @@ received: OK|failed to close: closed)$/
11231123

11241124
=== TEST 22: cannot survive across request boundary (connect)
11251125
--- stream_config eval
1126-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
1126+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
11271127
--- stream_server_config
11281128
content_by_lua_block {
11291129
local test = require "test"
@@ -2247,7 +2247,7 @@ lua clean up the timer for pending ngx.sleep
22472247

22482248
=== TEST 41: bad request tries to connect
22492249
--- stream_config eval
2250-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
2250+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
22512251
--- stream_server_config
22522252
content_by_lua_block {
22532253
local test = require "test"
@@ -2298,7 +2298,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):14: bad request/
22982298

22992299
=== TEST 42: bad request tries to receive
23002300
--- stream_config eval
2301-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
2301+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
23022302
--- stream_server_config
23032303
content_by_lua_block {
23042304
local test = require "test"
@@ -2344,7 +2344,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):13: bad request/
23442344

23452345
=== TEST 43: bad request tries to send
23462346
--- stream_config eval
2347-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
2347+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
23482348
--- stream_server_config
23492349
content_by_lua_block {
23502350
local test = require "test"
@@ -2389,7 +2389,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):12: bad request/
23892389

23902390
=== TEST 44: bad request tries to close
23912391
--- stream_config eval
2392-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
2392+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
23932393
--- stream_server_config
23942394
content_by_lua_block {
23952395
local test = require "test"
@@ -2434,7 +2434,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):12: bad request/
24342434

24352435
=== TEST 45: bad request tries to set keepalive
24362436
--- stream_config eval
2437-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
2437+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
24382438
--- stream_server_config
24392439
content_by_lua_block {
24402440
local test = require "test"
@@ -2479,7 +2479,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):12: bad request/
24792479

24802480
=== TEST 46: bad request tries to receiveuntil
24812481
--- stream_config eval
2482-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
2482+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
24832483
--- stream_server_config
24842484
content_by_lua_block {
24852485
local test = require "test"

t/064-pcall.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ __DATA__
2222

2323
=== TEST 1: pcall works
2424
--- stream_config eval
25-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
25+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
2626
--- stream_server_config
2727
content_by_lua_block {
2828
function f(a, b)
@@ -54,7 +54,7 @@ $/s
5454

5555
=== TEST 2: xpcall works
5656
--- stream_config eval
57-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
57+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
5858
--- stream_server_config
5959
content_by_lua_block {
6060
function f(a, b)

t/067-req-socket.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ found the end of the stream
293293

294294
=== TEST 4: attempt to use the req socket across request boundary
295295
--- stream_config eval
296-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
296+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
297297
--- stream_server_config
298298
content_by_lua_block {
299299
local test = require "test"
@@ -337,7 +337,7 @@ end
337337
=== TEST 5: receive until on request_body - receiveuntil(1) on the last byte of the body
338338
See https://groups.google.com/group/openresty/browse_thread/thread/43cf01da3c681aba for details
339339
--- stream_config eval
340-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
340+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
341341
--- stream_server_config
342342
content_by_lua_block {
343343
local test = require "test"
@@ -404,7 +404,7 @@ done
404404

405405
=== TEST 6: pipelined POST requests
406406
--- stream_config eval
407-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
407+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
408408
--- stream_server_config
409409
content_by_lua_block {
410410
local test = require "test"

t/087-udp-socket.t

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ probe syscall.socket.return, syscall.connect.return {
640640

641641
=== TEST 13: bad request tries to setpeer
642642
--- stream_config eval
643-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
643+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
644644
--- stream_server_config
645645

646646
content_by_lua_block {
@@ -686,7 +686,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):12: bad request/
686686

687687
=== TEST 14: bad request tries to send
688688
--- stream_config eval
689-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
689+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
690690
--- stream_server_config
691691

692692
content_by_lua_block {
@@ -732,7 +732,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):12: bad request/
732732

733733
=== TEST 15: bad request tries to receive
734734
--- stream_config eval
735-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
735+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
736736
--- stream_server_config
737737

738738
content_by_lua_block {
@@ -781,7 +781,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):13: bad request/
781781

782782
=== TEST 16: bad request tries to close
783783
--- stream_config eval
784-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
784+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
785785
--- stream_server_config
786786
content_by_lua_block {
787787
local test = require "test"
@@ -827,7 +827,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):13: bad request/
827827

828828
=== TEST 17: bad request tries to receive
829829
--- stream_config eval
830-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
830+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
831831
--- stream_server_config
832832
content_by_lua_block {
833833
local test = require "test"
@@ -872,7 +872,7 @@ qr/runtime error: content_by_lua\(nginx\.conf:\d+\):12: bad request/
872872

873873
=== TEST 18: the upper bound of port range should be 2^16 - 1
874874
--- stream_config eval
875-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
875+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
876876
--- stream_server_config
877877
content_by_lua_block {
878878
local sock = ngx.socket.udp()

t/106-timer.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ qr/received: Server: \S+/,
308308

309309
=== TEST 6: tcp cosocket in timer handler (keep-alive connections)
310310
--- stream_config eval
311-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
311+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
312312

313313
--- stream_server_config
314314
content_by_lua_block {
@@ -572,7 +572,7 @@ qr/\[lua\] log_by_lua\(nginx\.conf:\d+\):\d+: elapsed: 0\.0(?:6[4-9]|7[0-6])/,
572572
TODO
573573
--- SKIP
574574
--- stream_config eval
575-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
575+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
576576

577577
--- stream_server_config
578578
log_by_lua_block {

t/108-timer-safe.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ qr/received: Server: \S+/,
220220

221221
=== TEST 4: tcp cosocket in timer handler (keep-alive connections)
222222
--- stream_config eval
223-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
223+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
224224

225225
--- stream_server_config
226226
content_by_lua_block {
@@ -487,7 +487,7 @@ qr/\[lua\] log_by_lua\(nginx\.conf:\d+\):\d+: elapsed: 0\.0(?:6[4-9]|7[0-6])/,
487487
TODO
488488
--- SKIP
489489
--- stream_config eval
490-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
490+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
491491

492492
--- stream_server_config
493493
echo hello;

t/142-req-udp-socket.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ received: hello world! my
5353

5454
=== TEST 2: pipelined POST requests
5555
--- dgram_config eval
56-
"lua_package_path '$::HtmlDir/?.lua;./?.lua';"
56+
"lua_package_path '$::HtmlDir/?.lua;./?.lua;;';"
5757
--- dgram_server_config
5858
content_by_lua_block {
5959
local test = require "test"

0 commit comments

Comments
 (0)