diff --git a/tests/rptest/tests/topic_creation_test.py b/tests/rptest/tests/topic_creation_test.py index 67fb87dcc9d52..7374dffa938ab 100644 --- a/tests/rptest/tests/topic_creation_test.py +++ b/tests/rptest/tests/topic_creation_test.py @@ -210,6 +210,50 @@ def test_create_topic_with_single_configuration_property(self): cfgs = rpk.describe_topic_configs(topic=name) assert str(cfgs[p][0]) == str(property_value) + @cluster(num_nodes=3) + @matrix(cloud_storage_enable_remote_read=[True, False], + cloud_storage_enable_remote_write=[True, False], + topic_remote_read=[True, False, None], + topic_remote_write=[True, False, None]) + def test_shadow_indexing_mode(self, cloud_storage_enable_remote_read, + cloud_storage_enable_remote_write, + topic_remote_read, topic_remote_write): + to_bool = lambda x: True if x == "true" else False + from_bool = lambda x: "true" if x else "false" + + rpk = RpkTool(self.redpanda) + + expected_read = topic_remote_read if topic_remote_read is not None \ + else cloud_storage_enable_remote_read + expected_write = topic_remote_write if topic_remote_write is not None \ + else cloud_storage_enable_remote_write + + self.redpanda.set_cluster_config( + { + "cloud_storage_enable_remote_read": + cloud_storage_enable_remote_read, + "cloud_storage_enable_remote_write": + cloud_storage_enable_remote_write + }, + expect_restart=True) + + config = {} + if topic_remote_read is not None: + config["redpanda.remote.read"] = from_bool(topic_remote_read) + if topic_remote_write is not None: + config["redpanda.remote.write"] = from_bool(topic_remote_write) + + topic = self._topic_name() + rpk.create_topic(topic=topic, partitions=1, replicas=3, config=config) + + ret = rpk.describe_topic_configs(topic=topic) + + + read = to_bool(ret["redpanda.remote.read"][0]) + write = to_bool(ret["redpanda.remote.write"][0]) + assert read == expected_read, f"{read} != {expected_read}" + assert write == expected_write, f"{write} != {expected_write}" + # When quickly recreating topics after deleting them, redpanda's topic # dir creation can trip up over the topic dir deletion. This is not