You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by cm...@apache.org on 2021/07/20 23:38:35 UTC
[kafka] branch 3.0 updated: MINOR: Fix ZooKeeperAuthorizerTest for
KRaft (#11095)
This is an automated email from the ASF dual-hosted git repository.
cmccabe pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/3.0 by this push:
new dc0ca06 MINOR: Fix ZooKeeperAuthorizerTest for KRaft (#11095)
dc0ca06 is described below
commit dc0ca06f528b8f31e8ba87848f413a530469f297
Author: Ron Dagostino <rd...@confluent.io>
AuthorDate: Tue Jul 20 19:35:14 2021 -0400
MINOR: Fix ZooKeeperAuthorizerTest for KRaft (#11095)
This patch fixes the ZooKeeperAuthorizerTest for KRaft. The system test was not
configuring/reconfiguring/restarting the remote controller quorum with the correct security settings.
Reviewers: Colin P. McCabe <cm...@apache.org>
---
tests/kafkatest/tests/core/zookeeper_authorizer_test.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/tests/kafkatest/tests/core/zookeeper_authorizer_test.py b/tests/kafkatest/tests/core/zookeeper_authorizer_test.py
index e684564..97c20c0 100644
--- a/tests/kafkatest/tests/core/zookeeper_authorizer_test.py
+++ b/tests/kafkatest/tests/core/zookeeper_authorizer_test.py
@@ -55,9 +55,15 @@ class ZooKeeperAuthorizerTest(Test):
broker_security_protocol = "SSL"
broker_principal = "User:CN=systemtest"
client_security_protocol = "SASL_PLAINTEXT"
+ client_sasl_mechanism = 'GSSAPI'
client_principal = "User:client"
self.kafka.interbroker_security_protocol = broker_security_protocol
self.kafka.security_protocol = client_security_protocol
+ self.kafka.client_sasl_mechanism = client_sasl_mechanism
+ if self.kafka.quorum_info.using_kraft:
+ controller_quorum = self.kafka.controller_quorum
+ controller_quorum.controller_security_protocol = broker_security_protocol
+ controller_quorum.intercontroller_security_protocol = broker_security_protocol
self.kafka.start()
# alter client quotas
@@ -70,6 +76,13 @@ class ZooKeeperAuthorizerTest(Test):
node.account.ssh(alter_client_quotas_cmd)
# set authorizer, restart with broker as super user
+ if (metadata_quorum == quorum.remote_kraft):
+ # we need to explicitly reconfigure/restart any remote controller quorum
+ self.kafka.logger.info("Restarting Remote KRaft Controller with authorizer and broker principal as super user")
+ controller_quorum = self.kafka.controller_quorum
+ controller_quorum.authorizer_class_name = KafkaService.ACL_AUTHORIZER
+ controller_quorum.server_prop_overrides = [["super.users", broker_principal]] # for broker to work with an authorizer
+ controller_quorum.restart_cluster()
self.kafka.logger.info("Restarting Kafka with authorizer and broker principal as super user")
self.kafka.authorizer_class_name = KafkaService.ACL_AUTHORIZER
self.kafka.server_prop_overrides = [["super.users", broker_principal]] # for broker to work with an authorizer