Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
shreemaan-abhishek committed Sep 27, 2024
1 parent c42b888 commit 91d9c43
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions apisix/plugins/splunk-hec-logging.lua
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ local function send_to_splunk(conf, entries)
method = "POST",
body = table_concat(t),
headers = request_headers,
keepalive_timeout = conf.endpoint.keepalive_timeout
})

if not res then
Expand Down
37 changes: 37 additions & 0 deletions t/plugin/splunk-hec-logging.t
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,40 @@ passed
tail -n 1 ci/pod/vector/splunk.log
--- response_body eval
qr/.*test batched data.*/
=== TEST 13: set route with keepalive_timeout (success write)
--- 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 = {
type = "roundrobin",
nodes = {
["127.0.0.1:1980"] = 1
}
},
plugins = {
["splunk-hec-logging"] = {
endpoint = {
uri = "http://127.0.0.1:18088/services/collector",
token = "BD274822-96AA-4DA6-90EC-18940FB2414C",
keepalive_timeout = 5000
},
batch_max_size = 1,
inactive_timeout = 1
}
}
})
if code >= 300 then
ngx.status = code
end
ngx.say(body)
}
}
--- response_body
passed

0 comments on commit 91d9c43

Please sign in to comment.