From 74014af8332c6ec95133cd7fda3848bcd7fb4ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20L=C3=A9aut=C3=A9?= Date: Fri, 21 Oct 2016 14:52:06 -0700 Subject: [PATCH] MINOR: add list_topics command to help debug tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Author: Xavier Léauté Reviewers: Ewen Cheslack-Postava Closes #2052 from xvrl/test-add-list-topics --- tests/kafkatest/services/kafka/kafka.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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]