Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated zookeeper flag with bootstrap #3700

Merged
merged 4 commits into from
Feb 24, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions tests/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -4507,17 +4507,18 @@ void test_kafka_topics(const char *fmt, ...) {
int r;
va_list ap;
test_timing_t t_cmd;
const char *kpath, *zk;
ladislavmacoun marked this conversation as resolved.
Show resolved Hide resolved
const char *kpath, *brokers;

kpath = test_getenv("KAFKA_PATH", NULL);
zk = test_getenv("ZK_ADDRESS", NULL);
brokers = test_getenv("BROKERS", NULL);

if (!kpath || !zk)
TEST_FAIL("%s: KAFKA_PATH and ZK_ADDRESS must be set",
if (!kpath || !brokers)
TEST_FAIL("%s: KAFKA_PATH and BROKERS must be set",
__FUNCTION__);

r = rd_snprintf(cmd, sizeof(cmd),
"%s/bin/kafka-topics.sh --zookeeper %s ", kpath, zk);
"%s/bin/kafka-topics.sh --bootstrap-server %s ",
kpath, brokers);
TEST_ASSERT(r < (int)sizeof(cmd));

va_start(ap, fmt);
Expand Down Expand Up @@ -5164,7 +5165,7 @@ void test_report_add(struct test *test, const char *fmt, ...) {
}

/**
* Returns 1 if KAFKA_PATH and ZK_ADDRESS is set to se we can use the
* Returns 1 if KAFKA_PATH and BROKERS is set to se we can use the
ladislavmacoun marked this conversation as resolved.
Show resolved Hide resolved
* kafka-topics.sh script to manually create topics.
*
* If \p skip is set TEST_SKIP() will be called with a helpful message.
Expand All @@ -5181,11 +5182,11 @@ int test_can_create_topics(int skip) {
#else

if (!test_getenv("KAFKA_PATH", NULL) ||
!test_getenv("ZK_ADDRESS", NULL)) {
!test_getenv("BROKERS", NULL)) {
if (skip)
TEST_SKIP(
"Cannot create topics "
"(set KAFKA_PATH and ZK_ADDRESS)\n");
"(set KAFKA_PATH and BROKERS)\n");
ladislavmacoun marked this conversation as resolved.
Show resolved Hide resolved
return 0;
}

Expand Down