aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStaffan Olsson <staffan@repos.se>2016-09-06 06:02:39 +0200
committerStaffan Olsson <staffan@repos.se>2016-09-06 06:02:39 +0200
commit920278f0271e8ac756637772e81c167c76e465a3 (patch)
treed8f72e17dab707c962c449edbdc488d0d2dcf561
parent8ff7ca24c5efc3a91d0f75bfdae31357b1fe6ebd (diff)
downloadkubernetes-kafka-920278f0271e8ac756637772e81c167c76e465a3.tar.gz
kubernetes-kafka-920278f0271e8ac756637772e81c167c76e465a3.tar.bz2
kubernetes-kafka-920278f0271e8ac756637772e81c167c76e465a3.zip
Peer review revealed that some test commands were flawed. Only --old-producer producers would post what was piped.
-rw-r--r--test/test.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/test/test.sh b/test/test.sh
index ac3cc1c..244580e 100644
--- a/test/test.sh
+++ b/test/test.sh
@@ -1,16 +1,22 @@
+# Run ls ./bin here to see the toolbox
+kubectl exec -ti testclient -- /bin/bash
+
+# List topics
+kubectl exec testclient -- ./bin/kafka-topics.sh --zookeeper zookeeper:2181 --list
+
# Create topic
kubectl exec testclient -- ./bin/kafka-topics.sh --zookeeper zookeeper:2181 --topic test1 --create --partitions 1 --replication-factor 1
# Set one of your terminals to listen to messages on the test topic
kubectl exec -ti testclient -- ./bin/kafka-console-consumer.sh --zookeeper zookeeper:2181 --topic test1 --from-beginning
-# Go ahead and produce topics, haven't found a way to do this directly through kubectl exec
-kubectl exec -ti testclient -- /bin/bash
-echo "Test $(date)" | ./bin/kafka-console-producer.sh --broker-list kafka-0.broker.kafka.svc.cluster.local:9092 --topic test1
-echo "Test $(date)" | ./bin/kafka-console-producer.sh --broker-list kafka-1.broker:9092,kafka-2.broker:9092 --topic test1
-# "WARN Removing server from bootstrap.servers as DNS resolution failed: kafka-X.broker:9092"
-echo "Test $(date)" | ./bin/kafka-console-producer.sh --broker-list kafka-0.broker:9092,kafka-1.broker:9092,kafka-2.broker:9092,kafka-X.broker:9092 --topic test1
+# Go ahead and produce messages
+echo "Write a message followed by enter, exit using Ctrl+C"
+kubectl exec -ti testclient -- ./bin/kafka-console-producer.sh --broker-list kafka-0.broker.kafka.svc.cluster.local:9092 --topic test1
+
+# Bootstrap even if two nodes are down (shorter name requires same namespace)
+kubectl exec -ti testclient -- ./bin/kafka-console-producer.sh --broker-list kafka-0.broker:9092,kafka-1.broker:9092,kafka-2.broker:9092 --topic test1
# Topic 2, replicated
./bin/kafka-topics.sh --zookeeper zookeeper:2181 --describe --topic topic2