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

dt/license_enforcement: delay disabling trial license #24426

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
26 changes: 20 additions & 6 deletions tests/rptest/tests/license_enforcement_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ def setUp(self):
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously the test relied on the fact that the previous major version
(v24.2) did not do strict license enforcement.
We can no longer rely on that since the head version became v25.1 and the
previous major version v24.3 which does do strict license enforcement.

Does this allude to a future problem with real clusters and upgrading? If so, "delay" doesn't sound like a robust solution. Is this a test only issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a test only issue?

Yes.

Does this allude to a future problem with real clusters and upgrading?

I don't think so. Do you?

The underlying logic of upgrading from v24.2.x -> v24.3.x is the same (wrt. upgrade blocking) as upgrading from v24.3.x -> v25.1.x. And the test assertions are the same as well. The test needed changing because it needs some initialization (setting up a starting cluster that has an enterprise feature enabled and has an invalid license state). This test initialization logic is what needed changing now that the previous_version moved from v24.2.x to v24.3.x.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @pgellert makes sense!

def test_license_enforcement(self, clean_node_before_recovery,
clean_node_after_recovery):
self.redpanda.set_environment(
{'__REDPANDA_DISABLE_BUILTIN_TRIAL_LICENSE': True})

installer = self.redpanda._installer
prev_version = installer.highest_from_prior_feature_version(
RedpandaInstaller.HEAD)
Expand All @@ -73,6 +70,16 @@ def test_license_enforcement(self, clean_node_before_recovery,
self.redpanda.set_cluster_config(
{"partition_autobalancing_mode": "continuous"})

self.logger.info(
"Disabling the trial license to simulate that the license expired")
self.redpanda.set_environment(
{'__REDPANDA_DISABLE_BUILTIN_TRIAL_LICENSE': True})
self.redpanda.restart_nodes(self.redpanda.nodes)
self.redpanda.wait_until(self.redpanda.healthy,
timeout_sec=60,
backoff_sec=1,
err_msg="The cluster hasn't stabilized")

first_upgraded = self.redpanda.nodes[0]
self.logger.info(
f"Upgrading node {first_upgraded} expecting it to crash")
Expand Down Expand Up @@ -112,9 +119,6 @@ def test_license_enforcement(self, clean_node_before_recovery,
@cluster(num_nodes=5, log_allow_list=LOG_ALLOW_LIST)
@matrix(clean_node_before_upgrade=[False, True])
def test_escape_hatch_license_variable(self, clean_node_before_upgrade):
self.redpanda.set_environment(
{'__REDPANDA_DISABLE_BUILTIN_TRIAL_LICENSE': True})

installer = self.redpanda._installer
prev_version = installer.highest_from_prior_feature_version(
RedpandaInstaller.HEAD)
Expand All @@ -136,6 +140,16 @@ def test_escape_hatch_license_variable(self, clean_node_before_upgrade):
self.redpanda.set_cluster_config(
{"partition_autobalancing_mode": "continuous"})

self.logger.info(
"Disabling the trial license to simulate that the license expired")
self.redpanda.set_environment(
{'__REDPANDA_DISABLE_BUILTIN_TRIAL_LICENSE': True})
self.redpanda.restart_nodes(self.redpanda.nodes)
self.redpanda.wait_until(self.redpanda.healthy,
timeout_sec=60,
backoff_sec=1,
err_msg="The cluster hasn't stabilized")

first_upgraded = self.redpanda.nodes[0]
first_upgraded_id = self.redpanda.node_id(first_upgraded)
self.logger.info(
Expand Down
Loading