diff options
Diffstat (limited to 'bigtop-packages/src/charm/kafka/layer-kafka/actions/smoke-test')
-rwxr-xr-x | bigtop-packages/src/charm/kafka/layer-kafka/actions/smoke-test | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bigtop-packages/src/charm/kafka/layer-kafka/actions/smoke-test b/bigtop-packages/src/charm/kafka/layer-kafka/actions/smoke-test index 5c1435a1..a6cd3b6f 100755 --- a/bigtop-packages/src/charm/kafka/layer-kafka/actions/smoke-test +++ b/bigtop-packages/src/charm/kafka/layer-kafka/actions/smoke-test @@ -21,6 +21,7 @@ import subprocess from charmhelpers.core import hookenv, host from charms.reactive import is_state from jujubigdata.utils import run_as +from time import time if not is_state('kafka.started'): @@ -28,7 +29,7 @@ if not is_state('kafka.started'): # Define smoke test params -topic_name = "smoketest" +topic_name = "smoketest_{}".format(int(time())) topic_partitions = 1 topic_replication = 1 @@ -48,7 +49,7 @@ if host.service_available('kafka-server') and host.service_running('kafka-server '--replication-factor', topic_replication, capture_output=True) except subprocess.CalledProcessError as e: - kafkautils.fail('Kafka command failed', e.output) + kafkautils.fail('Kafka command failed: {}'.format(e.output)) # List topics try: @@ -56,9 +57,9 @@ if host.service_available('kafka-server') and host.service_running('kafka-server '--zookeeper', zookeepers, '--list', capture_output=True) except subprocess.CalledProcessError as e: - kafkautils.fail('Kafka command failed', e.output) + kafkautils.fail('Kafka command failed: {}'.format(e.output)) # If we haven't failed yet, we passed hookenv.action_set({'outcome': 'success'}) else: - kafkautils.fail('Kafka service is not running') + kafkautils.fail('kafka-server service is not running') |