Skip to content

Commit

Permalink
more test conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Nov 26, 2024
1 parent a6f5fd5 commit b55c754
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 26 deletions.
28 changes: 15 additions & 13 deletions spec/02-integration/09-hybrid_mode/02-start_stop_spec.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
local helpers = require "spec.helpers"


for _, inc_sync in ipairs { "on", "off" } do
for _, v in ipairs({ {"off", "off"}, {"on", "off"}, {"on", "on"}, }) do
local rpc, inc_sync = v[1], v[2]

describe("invalid config are rejected" .. " inc_sync=" .. inc_sync, function()
describe("role is control_plane", function()
it("can not disable admin_listen", function()
Expand All @@ -12,7 +14,7 @@ describe("invalid config are rejected" .. " inc_sync=" .. inc_sync, function()
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
admin_listen = "off",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
})

Expand All @@ -28,7 +30,7 @@ describe("invalid config are rejected" .. " inc_sync=" .. inc_sync, function()
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
cluster_listen = "off",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
})

Expand All @@ -44,7 +46,7 @@ describe("invalid config are rejected" .. " inc_sync=" .. inc_sync, function()
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
database = "off",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
})

Expand All @@ -60,7 +62,7 @@ describe("invalid config are rejected" .. " inc_sync=" .. inc_sync, function()
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
cluster_mtls = "pki",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
})

Expand All @@ -78,7 +80,7 @@ describe("invalid config are rejected" .. " inc_sync=" .. inc_sync, function()
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
proxy_listen = "off",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
})

Expand All @@ -93,7 +95,7 @@ describe("invalid config are rejected" .. " inc_sync=" .. inc_sync, function()
prefix = "servroot2",
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
})

Expand All @@ -111,7 +113,7 @@ describe("invalid config are rejected" .. " inc_sync=" .. inc_sync, function()
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
cluster_dp_labels = "w@:_a",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
})

Expand All @@ -129,7 +131,7 @@ describe("invalid config are rejected" .. " inc_sync=" .. inc_sync, function()
cluster_cert_key = "spec/fixtures/kong_clustering.key",
proxy_listen = "0.0.0.0:" .. helpers.get_available_port(),
cluster_dp_labels = "Aa-._zZ_key:Aa-._zZ_val",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
})
assert.True(ok)
Expand All @@ -145,7 +147,7 @@ describe("invalid config are rejected" .. " inc_sync=" .. inc_sync, function()
nginx_conf = "spec/fixtures/custom_nginx.template",
database = param[2],
prefix = "servroot2",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
})

Expand All @@ -160,7 +162,7 @@ describe("invalid config are rejected" .. " inc_sync=" .. inc_sync, function()
database = param[2],
prefix = "servroot2",
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
})

Expand All @@ -185,7 +187,7 @@ describe("when CP exits before DP" .. " inc_sync=" .. inc_sync, function()
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
cluster_listen = "127.0.0.1:9005",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
}))
assert(helpers.start_kong({
Expand All @@ -196,7 +198,7 @@ describe("when CP exits before DP" .. " inc_sync=" .. inc_sync, function()
cluster_control_plane = "127.0.0.1:9005",
proxy_listen = "0.0.0.0:9002",
database = "off",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
-- EE [[
-- vitals uses the clustering strategy by default, and it logs the exact
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ local function start_kong_debug(env)
end


for _, inc_sync in ipairs { "on", "off" } do
for _, v in ipairs({ {"off", "off"}, {"on", "off"}, {"on", "on"}, }) do
local rpc, inc_sync = v[1], v[2]

for _, strategy in helpers.each_strategy() do
describe("node id persistence " .. " inc_sync=" .. inc_sync, function()

Expand All @@ -94,7 +96,7 @@ for _, strategy in helpers.each_strategy() do
cluster_cert_key = "spec/fixtures/kong_clustering.key",
cluster_listen = "127.0.0.1:9005",
nginx_conf = "spec/fixtures/custom_nginx.template",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
}

Expand All @@ -110,7 +112,7 @@ for _, strategy in helpers.each_strategy() do
database = "off",
untrusted_lua = "on",
nginx_conf = "spec/fixtures/custom_nginx.template",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
worker_state_update_frequency = 1,
}
Expand Down
8 changes: 5 additions & 3 deletions spec/02-integration/09-hybrid_mode/11-status_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ local helpers = require "spec.helpers"
local cp_status_port = helpers.get_available_port()
local dp_status_port = 8100

for _, inc_sync in ipairs { "on", "off" } do
for _, v in ipairs({ {"off", "off"}, {"on", "off"}, {"on", "on"}, }) do
local rpc, inc_sync = v[1], v[2]

for _, strategy in helpers.each_strategy() do

describe("Hybrid Mode - status ready #" .. strategy .. " inc_sync=" .. inc_sync, function()
Expand All @@ -22,7 +24,7 @@ for _, strategy in helpers.each_strategy() do
proxy_listen = "127.0.0.1:9002",
nginx_main_worker_processes = 8,
status_listen = "127.0.0.1:" .. dp_status_port,
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
})
end
Expand All @@ -37,7 +39,7 @@ for _, strategy in helpers.each_strategy() do
cluster_listen = "127.0.0.1:9005",
nginx_conf = "spec/fixtures/custom_nginx.template",
status_listen = "127.0.0.1:" .. cp_status_port,
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
})
end
Expand Down
10 changes: 6 additions & 4 deletions spec/02-integration/20-wasm/10-wasmtime_spec.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
local helpers = require "spec.helpers"
local fmt = string.format

for _, inc_sync in ipairs { "off", "on" } do
for _, v in ipairs({ {"off", "off"}, {"on", "off"}, {"on", "on"}, }) do
local rpc, inc_sync = v[1], v[2]

for _, role in ipairs({"traditional", "control_plane", "data_plane"}) do

describe("#wasm wasmtime (role: " .. role .. ")", function()
Expand All @@ -19,7 +21,7 @@ describe("#wasm wasmtime (role: " .. role .. ")", function()
role = role,
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
}))

Expand Down Expand Up @@ -95,7 +97,7 @@ describe("#wasm wasmtime (role: " .. role .. ")", function()
status_listen = "127.0.0.1:" .. status_port,
nginx_main_worker_processes = 2,

cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
}))

Expand All @@ -118,7 +120,7 @@ describe("#wasm wasmtime (role: " .. role .. ")", function()
cluster_cert_key = "spec/fixtures/kong_clustering.key",
status_listen = "off",
nginx_main_worker_processes = 2,
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
}))
end
Expand Down
8 changes: 5 additions & 3 deletions spec/03-plugins/09-key-auth/04-hybrid_mode_spec.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
local helpers = require "spec.helpers"


for _, inc_sync in ipairs { "on", "off" } do
for _, v in ipairs({ {"off", "off"}, {"on", "off"}, {"on", "on"}, }) do
local rpc, inc_sync = v[1], v[2]

for _, strategy in helpers.each_strategy({"postgres"}) do
describe("Plugin: key-auth (access) [#" .. strategy .. " inc_sync=" .. inc_sync .. "] auto-expiring keys", function()
-- Give a bit of time to reduce test flakyness on slow setups
Expand Down Expand Up @@ -40,7 +42,7 @@ for _, strategy in helpers.each_strategy({"postgres"}) do
cluster_listen = "127.0.0.1:9005",
cluster_telemetry_listen = "127.0.0.1:9006",
nginx_conf = "spec/fixtures/custom_nginx.template",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
}))

Expand All @@ -54,7 +56,7 @@ for _, strategy in helpers.each_strategy({"postgres"}) do
cluster_control_plane = "127.0.0.1:9005",
cluster_telemetry_endpoint = "127.0.0.1:9006",
proxy_listen = "0.0.0.0:9002",
cluster_rpc = "on",
cluster_rpc = rpc,
cluster_incremental_sync = inc_sync,
}))
end)
Expand Down

0 comments on commit b55c754

Please sign in to comment.