kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maniku...@apache.org
Subject [kafka] branch 2.6 updated: KAFKA-10214: Fix zookeeper_tls_test.py system test
Date Wed, 01 Jul 2020 11:42:05 GMT
This is an automated email from the ASF dual-hosted git repository.

manikumar pushed a commit to branch 2.6
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/2.6 by this push:
     new e5a18ee  KAFKA-10214: Fix zookeeper_tls_test.py system test
e5a18ee is described below

commit e5a18ee7dc0197edaefb9ca0ff5682c61c2251a8
Author: Chia-Ping Tsai <chia7712@gmail.com>
AuthorDate: Wed Jul 1 17:08:54 2020 +0530

    KAFKA-10214: Fix zookeeper_tls_test.py system test
    
    After 3661f981fff2653aaf1d5ee0b6dde3410b5498db security_config is cached. Hence, the
later changes to security flag can't impact the security_config used by later tests.
    
    issue: https://issues.apache.org/jira/browse/KAFKA-10214
    
    Author: Chia-Ping Tsai <chia7712@gmail.com>
    
    Reviewers: Ron Dagostino <rdagostino@confluent.io>, Manikumar Reddy <manikumar.reddy@gmail.com>
    
    Closes #8949 from chia7712/KAFKA-10214
    
    (cherry picked from commit 6094af897436f2e24764ad99cfa6e81391baa916)
    Signed-off-by: Manikumar Reddy <mkumar@xtreems.local>
---
 tests/kafkatest/services/kafka/kafka.py              | 6 ++++++
 tests/kafkatest/services/security/security_config.py | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/tests/kafkatest/services/kafka/kafka.py b/tests/kafkatest/services/kafka/kafka.py
index 04797f6..cbd5a06 100644
--- a/tests/kafkatest/services/kafka/kafka.py
+++ b/tests/kafkatest/services/kafka/kafka.py
@@ -225,6 +225,12 @@ class KafkaService(KafkaPathResolverMixin, JmxMixin, Service):
             for port in self.port_mappings.values():
                 if port.open:
                     self._security_config.enable_security_protocol(port.security_protocol)
+        if self.zk.zk_sasl:
+            self._security_config.enable_sasl()
+            self._security_config.zk_sasl = self.zk.zk_sasl
+        if self.zk_client_secure:
+            self._security_config.enable_ssl()
+            self._security_config.zk_tls = self.zk_client_secure
         return self._security_config
 
     def open_port(self, listener_name):
diff --git a/tests/kafkatest/services/security/security_config.py b/tests/kafkatest/services/security/security_config.py
index 2fb4f47..3d8397b 100644
--- a/tests/kafkatest/services/security/security_config.py
+++ b/tests/kafkatest/services/security/security_config.py
@@ -211,6 +211,12 @@ class SecurityConfig(TemplateRenderer):
                               listener_security_config=self.listener_security_config,
                               tls_version=self.tls_version)
 
+    def enable_sasl(self):
+        self.has_sasl = True
+
+    def enable_ssl(self):
+        self.has_ssl = True
+
     def enable_security_protocol(self, security_protocol):
         self.has_sasl = self.has_sasl or self.is_sasl(security_protocol)
         self.has_ssl = self.has_ssl or self.is_ssl(security_protocol)


Mime
View raw message