diff --git a/tests/kafkatest/services/kafka/kafka.py b/tests/kafkatest/services/kafka/kafka.py index 0caee9a4b2a..89cc312cb35 100644 --- a/tests/kafkatest/services/kafka/kafka.py +++ b/tests/kafkatest/services/kafka/kafka.py @@ -296,6 +296,15 @@ class KafkaService(KafkaPathResolverMixin, JmxMixin, Service): output += line return output + def list_topics(self, topic, node=None): + if node is None: + node = self.nodes[0] + cmd = "%s --zookeeper %s --list" % \ + (self.path.script("kafka-topics.sh", node), self.zk.connect_setting()) + for line in node.account.ssh_capture(cmd): + if not line.startswith("SLF4J"): + yield line.rstrip() + def alter_message_format(self, topic, msg_format_version, node=None): if node is None: node = self.nodes[0]