Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests(clustering): start/stop when incremental on #13852

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 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,8 @@
local helpers = require "spec.helpers"


describe("invalid config are rejected", function()
for _, inc_sync in ipairs { "on", "off" } do
describe("invalid config are rejected" .. " inc_sync=" .. inc_sync, function()
describe("role is control_plane", function()
it("can not disable admin_listen", function()
local ok, err = helpers.start_kong({
Expand All @@ -11,6 +12,7 @@ describe("invalid config are rejected", function()
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
admin_listen = "off",
cluster_incremental_sync = inc_sync,
})

assert.False(ok)
Expand All @@ -25,6 +27,7 @@ describe("invalid config are rejected", function()
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
cluster_listen = "off",
cluster_incremental_sync = inc_sync,
})

assert.False(ok)
Expand All @@ -39,6 +42,7 @@ describe("invalid config are rejected", function()
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
database = "off",
cluster_incremental_sync = inc_sync,
})

assert.False(ok)
Expand All @@ -53,6 +57,7 @@ describe("invalid config are rejected", function()
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
cluster_mtls = "pki",
cluster_incremental_sync = inc_sync,
})

assert.False(ok)
Expand All @@ -69,6 +74,7 @@ describe("invalid config are rejected", function()
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
proxy_listen = "off",
cluster_incremental_sync = inc_sync,
})

assert.False(ok)
Expand All @@ -82,6 +88,7 @@ describe("invalid config are rejected", function()
prefix = "servroot2",
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
cluster_incremental_sync = inc_sync,
})

assert.False(ok)
Expand All @@ -97,7 +104,8 @@ describe("invalid config are rejected", function()
prefix = "servroot2",
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
cluster_dp_labels = "w@:_a"
cluster_dp_labels = "w@:_a",
cluster_incremental_sync = inc_sync,
})

assert.False(ok)
Expand All @@ -113,7 +121,8 @@ describe("invalid config are rejected", function()
cluster_cert = "spec/fixtures/kong_clustering.crt",
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_dp_labels = "Aa-._zZ_key:Aa-._zZ_val",
cluster_incremental_sync = inc_sync,
})
assert.True(ok)
helpers.stop_kong("servroot2")
Expand All @@ -128,6 +137,7 @@ describe("invalid config are rejected", function()
nginx_conf = "spec/fixtures/custom_nginx.template",
database = param[2],
prefix = "servroot2",
cluster_incremental_sync = inc_sync,
})

assert.False(ok)
Expand All @@ -141,6 +151,7 @@ describe("invalid config are rejected", function()
database = param[2],
prefix = "servroot2",
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_incremental_sync = inc_sync,
})

assert.False(ok)
Expand All @@ -151,7 +162,7 @@ describe("invalid config are rejected", function()
end)

-- note that lagacy modes still error when CP exits
describe("when CP exits before DP", function()
describe("when CP exits before DP" .. " inc_sync=" .. inc_sync, function()
local need_exit = true

lazy_setup(function()
Expand All @@ -164,6 +175,7 @@ describe("when CP exits before DP", function()
cluster_cert = "spec/fixtures/kong_clustering.crt",
cluster_cert_key = "spec/fixtures/kong_clustering.key",
cluster_listen = "127.0.0.1:9005",
cluster_incremental_sync = inc_sync,
}))
assert(helpers.start_kong({
role = "data_plane",
Expand All @@ -173,6 +185,7 @@ describe("when CP exits before DP", function()
cluster_control_plane = "127.0.0.1:9005",
proxy_listen = "0.0.0.0:9002",
database = "off",
cluster_incremental_sync = inc_sync,
-- EE [[
-- vitals uses the clustering strategy by default, and it logs the exact
-- same "error while receiving frame from peer" error strings that this
Expand All @@ -196,3 +209,4 @@ describe("when CP exits before DP", function()
assert.logfile("servroot2/logs/error.log").has.no.line("error while receiving frame from peer", true)
end)
end)
end -- for inc_sync
Loading