diff --git a/rockspec/apisix-master-0.rockspec b/rockspec/apisix-master-0.rockspec index 883cd42f..6e391d0f 100644 --- a/rockspec/apisix-master-0.rockspec +++ b/rockspec/apisix-master-0.rockspec @@ -32,7 +32,7 @@ description = { dependencies = { "lua-resty-ctxdump = 0.1-0", - "lua-resty-dns-client = 5.2.0", + "lua-resty-dns-client = 5.2.3", "lua-resty-template = 2.0", "lua-resty-etcd = 1.6.0", "api7-lua-resty-http = 0.2.0", diff --git a/t/node/upstream-domain.t b/t/node/upstream-domain.t index 63069fda..2cf71dd8 100644 --- a/t/node/upstream-domain.t +++ b/t/node/upstream-domain.t @@ -399,3 +399,51 @@ GET /t 1980, 1981, 1981 --- no_error_log [error] + + + +=== TEST 15: set route(with upstream) +--- config + location /t { + content_by_lua_block { + local t = require("lib.test_admin").test + local code, body = t('/apisix/admin/routes/1', + ngx.HTTP_PUT, + [[{ + "uri": "/hello", + "upstream": { + "nodes": { + "foo.com.": 0, + "127.0.0.1:1980": 1 + }, + "type": "roundrobin", + "desc": "new upstream" + }, + "service_id": "1" + }]] + ) + + if code >= 300 then + ngx.status = code + end + ngx.say(body) + } + } +--- request +GET /t +--- response_body +passed +--- no_error_log +[error] + + + +=== TEST 16: hit routes, parse the domain of upstream node +--- request +GET /hello +--- response_body +hello world +--- error_log eval +qr/dns resolver domain: foo.com. to \d+.\d+.\d+.\d+/ +--- no_error_log +[error]