def test_overrides_set(self):
        topic = self.topics[0].name
        rpk = RpkTool(self.redpanda)
        original_output = rpk.describe_topic_configs(topic)
        self.logger.info(f"original_output={original_output}")
        assert original_output["redpanda.remote.read"][0] == "true"
        assert original_output["redpanda.remote.write"][0] == "true"

        rpk.alter_topic_config(topic, "redpanda.remote.read", "false")
        rpk.alter_topic_config(topic, "redpanda.remote.read", "false")
        altered_output = rpk.describe_topic_configs(topic)
        self.logger.info(f"altered_output={altered_output}")
        assert altered_output["redpanda.remote.read"][0] == "false"
        assert altered_output["redpanda.remote.write"][0] == "false"
Esempio n. 2
0
 def describe_topic_configs(self, topic: str):
     rpk = RpkTool(self._redpanda)
     configs = rpk.describe_topic_configs(topic)
     return {
         key: TopicConfigValue(value=value[0], source=value[1])
         for key, value in configs.items()
     }
Esempio n. 3
0
 def _restore_topic(self, topic_spec, overrides={}):
     """Restore individual topic"""
     self.logger.info(f"Restore topic called. Topic-manifest: {topic_spec}")
     conf = {
         'redpanda.remote.recovery': 'true',
         #'redpanda.remote.write': 'true',
     }
     conf.update(overrides)
     self.logger.info(f"Confg: {conf}")
     topic = topic_spec.name
     npart = topic_spec.partition_count
     nrepl = topic_spec.replication_factor
     rpk = RpkTool(self.redpanda)
     rpk.create_topic(topic, npart, nrepl, conf)
     time.sleep(10)
     rpk.describe_topic(topic)
     rpk.describe_topic_configs(topic)
    def test_overrides_remove(self):
        topic = self.topics[0].name
        rpk = RpkTool(self.redpanda)
        original_output = rpk.describe_topic_configs(topic)
        self.logger.info(f"original_output={original_output}")
        assert original_output["redpanda.remote.read"][0] == "true"
        assert original_output["redpanda.remote.write"][0] == "true"

        # disable shadow indexing for topic
        rpk.alter_topic_config(topic, "redpanda.remote.read", "false")
        rpk.alter_topic_config(topic, "redpanda.remote.write", "false")
        altered_output = rpk.describe_topic_configs(topic)
        self.logger.info(f"altered_output={altered_output}")
        assert altered_output["redpanda.remote.read"][0] == "false"
        assert altered_output["redpanda.remote.write"][0] == "false"

        # delete topic configs (value from configuration should be used)
        rpk.delete_topic_config(topic, "redpanda.remote.read")
        rpk.delete_topic_config(topic, "redpanda.remote.write")
        altered_output = rpk.describe_topic_configs(topic)
        self.logger.info(f"altered_output={altered_output}")
        assert altered_output["redpanda.remote.read"][0] == "true"
        assert altered_output["redpanda.remote.write"][0] == "true"