From commits-return-14994-apmail-kafka-commits-archive=kafka.apache.org@kafka.apache.org Wed Jul 1 11:42:10 2020 Return-Path: X-Original-To: apmail-kafka-commits-archive@www.apache.org Delivered-To: apmail-kafka-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id 691BE1916B for ; Wed, 1 Jul 2020 11:42:10 +0000 (UTC) Received: (qmail 12416 invoked by uid 500); 1 Jul 2020 11:42:09 -0000 Delivered-To: apmail-kafka-commits-archive@kafka.apache.org Received: (qmail 12390 invoked by uid 500); 1 Jul 2020 11:42:09 -0000 Mailing-List: contact commits-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list commits@kafka.apache.org Received: (qmail 12380 invoked by uid 99); 1 Jul 2020 11:42:09 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Jul 2020 11:42:09 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 71A92890B8; Wed, 1 Jul 2020 11:42:09 +0000 (UTC) Date: Wed, 01 Jul 2020 11:42:05 +0000 To: "commits@kafka.apache.org" Subject: [kafka] branch 2.6 updated: KAFKA-10214: Fix zookeeper_tls_test.py system test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <159360372134.30882.2414156837897538212@gitbox.apache.org> From: manikumar@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: kafka X-Git-Refname: refs/heads/2.6 X-Git-Reftype: branch X-Git-Oldrev: ecc77f74212ef0643339d4f6738508812ff57509 X-Git-Newrev: e5a18ee7dc0197edaefb9ca0ff5682c61c2251a8 X-Git-Rev: e5a18ee7dc0197edaefb9ca0ff5682c61c2251a8 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated 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 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 Reviewers: Ron Dagostino , Manikumar Reddy Closes #8949 from chia7712/KAFKA-10214 (cherry picked from commit 6094af897436f2e24764ad99cfa6e81391baa916) Signed-off-by: Manikumar Reddy --- 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)