File tree Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Original file line number Diff line number Diff line change
1
+ # vim:set ft= ts=4 sw=4 et fdm=marker:
2
+ use lib ' lib' ;
3
+ use Test::Nginx::Socket::Lua;
4
+ use Cwd qw( cwd) ;
5
+
6
+ my $pwd = cwd();
7
+
8
+ our $HttpConfig = qq{
9
+ lua_package_path "$pwd /lib/?.lua;;";
10
+ } ;
11
+
12
+ $ENV {TEST_NGINX_RESOLVER } = ' 8.8.8.8' ;
13
+
14
+ # worker_connections(1014);
15
+ # master_on();
16
+ workers(2);
17
+ # log_level('warn');
18
+
19
+ repeat_each(2);
20
+ # repeat_each(1);
21
+
22
+ plan tests => repeat_each() * (blocks() * 3);
23
+
24
+ # no_diff();
25
+ # no_long_string();
26
+ run_tests();
27
+
28
+
29
+ __DATA__
30
+
31
+ === TEST 1: request_uri (check the default path)
32
+ --- config
33
+ location /lua {
34
+ content_by_lua '
35
+ local http = require "resty.http"
36
+ local httpc = http.new()
37
+
38
+ local res, err = httpc:request_uri("http://127.0.0.1:"..ngx.var.server_port)
39
+
40
+ if res and 200 == res.status then
41
+ ngx.print("OK")
42
+ else
43
+ ngx.print("FAIL")
44
+ end
45
+ ';
46
+ }
47
+
48
+ location =/ {
49
+ content_by_lua '
50
+ ngx.print("OK")
51
+ ';
52
+ }
53
+ --- request
54
+ GET /lua
55
+ --- response_body_like chop
56
+ OK$
57
+ --- no_error_log
58
+ [error]
59
+
You can’t perform that action at this time.
0 commit comments