2019-09-10 09:42:55 +08:00
|
|
|
use t::APISIX 'no_plan';
|
2019-06-22 08:24:02 +08:00
|
|
|
|
2019-09-27 19:11:37 +08:00
|
|
|
master_on();
|
|
|
|
repeat_each(1);
|
2019-06-22 08:24:02 +08:00
|
|
|
no_long_string();
|
|
|
|
no_root_location();
|
|
|
|
no_shuffle();
|
2019-09-27 19:11:37 +08:00
|
|
|
|
2019-06-22 08:24:02 +08:00
|
|
|
run_tests;
|
|
|
|
|
|
|
|
__DATA__
|
|
|
|
|
|
|
|
=== TEST 1: sanity
|
|
|
|
--- request
|
|
|
|
GET /apisix/status
|
|
|
|
--- response_body eval
|
|
|
|
qr/"accepted":/
|
|
|
|
--- no_error_log
|
|
|
|
[error]
|
2019-09-27 19:11:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=== 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]
|