From commits-return-14991-apmail-kafka-commits-archive=kafka.apache.org@kafka.apache.org Wed Jul 1 11:40:24 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 8537019150 for ; Wed, 1 Jul 2020 11:40:24 +0000 (UTC) Received: (qmail 8045 invoked by uid 500); 1 Jul 2020 11:40:23 -0000 Delivered-To: apmail-kafka-commits-archive@kafka.apache.org Received: (qmail 8014 invoked by uid 500); 1 Jul 2020 11:40:23 -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 7997 invoked by uid 99); 1 Jul 2020 11:40:23 -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:40:23 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id E143C890B8; Wed, 1 Jul 2020 11:40:22 +0000 (UTC) Date: Wed, 01 Jul 2020 11:40:18 +0000 To: "commits@kafka.apache.org" Subject: [kafka] branch trunk 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: <159360361462.31932.11807638709057128487@gitbox.apache.org> From: manikumar@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: kafka X-Git-Refname: refs/heads/trunk X-Git-Reftype: branch X-Git-Oldrev: f3a9ce4a69d17db7b8ba21134eb8118070176e48 X-Git-Newrev: 6094af897436f2e24764ad99cfa6e81391baa916 X-Git-Rev: 6094af897436f2e24764ad99cfa6e81391baa916 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 trunk in repository https://gitbox.apache.org/repos/asf/kafka.git The following commit(s) were added to refs/heads/trunk by this push: new 6094af8 KAFKA-10214: Fix zookeeper_tls_test.py system test 6094af8 is described below commit 6094af897436f2e24764ad99cfa6e81391baa916 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 --- 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 22ba69b..e8fa5933 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)