-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathnode-status.t
More file actions
57 lines (48 loc) · 1.01 KB
/
node-status.t
File metadata and controls
57 lines (48 loc) · 1.01 KB
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
use t::APISIX 'no_plan';
master_on();
repeat_each(1);
no_long_string();
no_root_location();
no_shuffle();
run_tests;
__DATA__
=== TEST 1: sanity
--- config
location /t {
content_by_lua_block {
ngx.sleep(0.5)
local t = require("lib.test_admin").test
local code, body, body_org = t('/apisix/status', ngx.HTTP_GET)
if code >= 300 then
ngx.status = code
end
ngx.say(body_org)
}
}
--- request
GET /t
--- response_body eval
qr/"accepted":/
--- no_error_log
[error]
=== TEST 2: get node status
--- config
location /t {
content_by_lua_block {
ngx.sleep(0.5)
local t = require("lib.test_admin").test
local code, body, body_org = t('/apisix/admin/node_status',
ngx.HTTP_GET
)
if code >= 300 then
ngx.status = code
end
ngx.say(body_org)
}
}
--- request
GET /t
--- response_body eval
qr/"accepted"/
--- no_error_log
[error]