2019-04-11 16:53:21 +08:00
|
|
|
use t::APIMeta 'no_plan';
|
|
|
|
|
2019-05-06 16:02:28 +08:00
|
|
|
repeat_each(2);
|
2019-04-11 16:53:21 +08:00
|
|
|
no_long_string();
|
|
|
|
log_level('info');
|
|
|
|
|
|
|
|
run_tests;
|
|
|
|
|
|
|
|
__DATA__
|
|
|
|
|
|
|
|
=== TEST 1: sanity
|
|
|
|
--- config
|
|
|
|
location /t {
|
|
|
|
content_by_lua_block {
|
|
|
|
local encode_json = require "cjson.safe" .encode
|
2019-05-06 14:40:10 +08:00
|
|
|
local config = require("apimeta.core.config").read()
|
2019-05-06 10:14:39 +08:00
|
|
|
|
2019-04-11 16:53:21 +08:00
|
|
|
ngx.say("etcd host: ", config.etcd.host)
|
|
|
|
ngx.say("etcd prefix: ", config.etcd.prefix)
|
2019-05-06 10:14:39 +08:00
|
|
|
ngx.say("plugins: ", encode_json(config.plugins))
|
2019-04-11 16:53:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
--- request
|
|
|
|
GET /t
|
|
|
|
--- response_body
|
|
|
|
etcd host: http://127.0.0.1:2379
|
|
|
|
etcd prefix: /v2/keys
|
2019-05-07 15:58:44 +08:00
|
|
|
plugins: ["example-plugin","not-exist-plugin"]
|