Skip to content

Commit 98a08b2

Browse files
dt: Test to verify relaxed tiered storage topic configs
Signed-off-by: Michael Boquard <[email protected]>
1 parent 2ed2a65 commit 98a08b2

File tree

1 file changed

+85
-2
lines changed

1 file changed

+85
-2
lines changed

tests/rptest/tests/license_enforcement_test.py

+85-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
from ducktape.mark import matrix
1313

1414
from rptest.services.cluster import cluster
15-
from rptest.clients.rpk import RpkTool
15+
from rptest.clients.rpk import RpkTool, RpkException
1616
from rptest.services.admin import Admin
17-
from rptest.services.redpanda import LoggingConfig
17+
from rptest.services.redpanda import LoggingConfig, SISettings
1818
from rptest.tests.redpanda_test import RedpandaTest
1919
from rptest.services.redpanda_installer import RedpandaInstaller
2020
from rptest.utils.mode_checks import skip_fips_mode
@@ -201,3 +201,86 @@ def test_enterprise_cluster_bootstrap(self, root_driven_bootstrap):
201201
timeout_sec=60,
202202
backoff_sec=1,
203203
err_msg="The cluster hasn't stabilized")
204+
205+
206+
class LicenseEnforcementPermittedTopicParams(RedpandaTest):
207+
"""
208+
Tests that validate that topics properties whose controlling cluster config
209+
is disabled do not cause any issues in regards to license enforcement.
210+
"""
211+
def __init__(self, *args, **kwargs):
212+
super().__init__(*args, **kwargs)
213+
214+
self.rpk = RpkTool(self.redpanda)
215+
216+
def setUp(self):
217+
pass
218+
219+
@cluster(num_nodes=3)
220+
@matrix(enable_cloud_storage=[False, True])
221+
def test_cloud_storage_topic_params(self, enable_cloud_storage):
222+
"""
223+
This test verifies that if a license isn't installed and `cloud_storage_enabled`
224+
is set to `False`, then topics may be created with TS settingss set to true, e.g.
225+
`redpanda.remote.write`.
226+
"""
227+
if enable_cloud_storage:
228+
si_settings = SISettings(self.test_context)
229+
self.redpanda.set_si_settings(si_settings)
230+
231+
super().setUp()
232+
233+
self.redpanda.set_environment(
234+
{'__REDPANDA_DISABLE_BUILTIN_TRIAL_LICENSE': True})
235+
self.redpanda.restart_nodes(self.redpanda.nodes)
236+
self.redpanda.wait_until(self.redpanda.healthy,
237+
timeout_sec=60,
238+
backoff_sec=1,
239+
err_msg="The cluster hasn't stabilized")
240+
241+
try:
242+
self.rpk.create_topic("test",
243+
config={"redpanda.remote.write": "true"})
244+
assert not enable_cloud_storage, "Should have failed to create topic with redpanda.remote.write set and cloud_storage_enabled set to True"
245+
except RpkException as e:
246+
assert enable_cloud_storage, f"Should not have failed to create topic with redpanda.remote.write set and cloud_storage_enabled set to False: {e}"
247+
248+
@cluster(num_nodes=3)
249+
def test_upgrade_with_topic_configs(self):
250+
"""
251+
This test verifies that if a license isn't installed and `cloud_storage_enabled`
252+
is set to `False` and topics exist with tiered storage capabilities, the upgrade
253+
will still succeed
254+
"""
255+
installer = self.redpanda._installer
256+
prev_version = installer.highest_from_prior_feature_version(
257+
RedpandaInstaller.HEAD)
258+
latest_version = installer.head_version()
259+
self.logger.info(
260+
f"Testing with versions: {prev_version=} {latest_version=}")
261+
262+
self.logger.info(f"Starting all nodes with version: {prev_version}")
263+
installer.install(self.redpanda.nodes, prev_version)
264+
self.redpanda.start(nodes=self.redpanda.nodes,
265+
omit_seeds_on_idx_one=False)
266+
self.redpanda.wait_until(self.redpanda.healthy,
267+
timeout_sec=60,
268+
backoff_sec=1,
269+
err_msg="The cluster hasn't stabilized")
270+
self.logger.debug(
271+
"Creating a topic with redpanda.remote.write set to true")
272+
self.rpk.create_topic("test", config={"redpanda.remote.write": "true"})
273+
self.logger.info(
274+
"Disabling the trial license to simulate that the license expired")
275+
self.redpanda.set_environment(
276+
{'__REDPANDA_DISABLE_BUILTIN_TRIAL_LICENSE': True})
277+
self.redpanda.restart_nodes(self.redpanda.nodes)
278+
self.redpanda.wait_until(self.redpanda.healthy,
279+
timeout_sec=60,
280+
backoff_sec=1,
281+
err_msg="The cluster hasn't stabilized")
282+
283+
installer.install(self.redpanda.nodes, latest_version)
284+
self.redpanda.start(nodes=self.redpanda.nodes,
285+
auto_assign_node_id=True,
286+
omit_seeds_on_idx_one=False)

0 commit comments

Comments
 (0)