Browse Source

MINOR: add list_topics command to help debug tests

Author: Xavier Léauté <xavier@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #2052 from xvrl/test-add-list-topics
pull/1336/merge
Xavier Léauté 8 years ago committed by Ewen Cheslack-Postava
parent
commit
74014af833
  1. 9
      tests/kafkatest/services/kafka/kafka.py

9
tests/kafkatest/services/kafka/kafka.py

@ -296,6 +296,15 @@ class KafkaService(KafkaPathResolverMixin, JmxMixin, Service): @@ -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]

Loading…
Cancel
Save