From 90761b18c437522a0f0ce1b7da6ad1b56dcea889 Mon Sep 17 00:00:00 2001 From: Brent Yarger Date: Fri, 23 Aug 2024 11:54:45 -0700 Subject: [PATCH] fix tests, fix missig slash in socket path --- kong/tools/stream_api.lua | 2 +- spec/01-unit/03-conf_loader_spec.lua | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/kong/tools/stream_api.lua b/kong/tools/stream_api.lua index 6e1af84ae66f..29bb9f453ebd 100644 --- a/kong/tools/stream_api.lua +++ b/kong/tools/stream_api.lua @@ -40,7 +40,7 @@ local HEADER_LEN = #st_pack(PACK_F, MAX_KEY_LEN, MAX_DATA_LEN) -- this module may be loaded before `kong.configuration` is initialized local SOCKET_PATH = "unix:" .. ngx.config.prefix() .. "/" - .. constants.SOCKET_DIRECTORY .. constants.SOCKETS.STREAM_RPC + .. constants.SOCKET_DIRECTORY .. "/" .. constants.SOCKETS.STREAM_RPC local stream_api = {} diff --git a/spec/01-unit/03-conf_loader_spec.lua b/spec/01-unit/03-conf_loader_spec.lua index ea83099f5386..a5f0d3f5b202 100644 --- a/spec/01-unit/03-conf_loader_spec.lua +++ b/spec/01-unit/03-conf_loader_spec.lua @@ -2472,6 +2472,14 @@ describe("Configuration loader", function() -- CONF_BASIC prefix = true, socket_path = true, + socket_path = true, + worker_events_sock = true, + stream_worker_events_sock = true, + stream_rpc_sock = true, + stream_config_sock = true, + stream_tls_passthrough_sock = true, + stream_tls_terminate_sock = true, + cluster_proxy_ssl_terminator_sock = true, vaults = true, database = true, lmdb_environment_path = true, @@ -2522,7 +2530,7 @@ describe("Configuration loader", function() } local conf = assert(conf_loader(nil, nil, { pre_cmd = true })) for k, _ in pairs(conf) do - assert.equal(true, FIELDS[k]) + assert.equal(true, FIELDS[k], "key " .. k .. " is not in FIELDS") end end) end)