From 41126c9919c3737492a2989b81ee2d20e9cfde13 Mon Sep 17 00:00:00 2001 From: Ioannis Kavvadias Date: Tue, 12 Nov 2024 13:27:36 +0000 Subject: [PATCH] dt: simplify pkcs12 test pkcs12 test doesn't need to test that topic creation works when pkcs12 is not active. This is being actively tested by every other test that implements a non-P12 TLSProvider --- tests/rptest/tests/pkcs12_test.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/rptest/tests/pkcs12_test.py b/tests/rptest/tests/pkcs12_test.py index cc23ba17f25f4..39241157b80bd 100644 --- a/tests/rptest/tests/pkcs12_test.py +++ b/tests/rptest/tests/pkcs12_test.py @@ -10,7 +10,6 @@ import socket from ducktape.cluster.cluster import ClusterNode -from ducktape.mark import matrix from ducktape.services.service import Service from rptest.utils.mode_checks import skip_fips_mode from rptest.clients.rpk import RpkTool @@ -22,9 +21,8 @@ class P12TLSProvider(TLSProvider): - def __init__(self, tls: TLSCertManager, use_pkcs12: bool): + def __init__(self, tls: TLSCertManager): self.tls = tls - self.use_pkcs12 = use_pkcs12 @property def ca(self) -> CertificateAuthority: @@ -41,7 +39,7 @@ def create_service_client_cert(self, _: Service, name: str) -> Certificate: common_name=name) def use_pkcs12_file(self) -> bool: - return self.use_pkcs12 + return True def p12_password(self, node: ClusterNode) -> str: assert node.name in self.tls.certs, f"No certificate associated with node {node.name}" @@ -64,9 +62,9 @@ def setUp(self): # Skip set up to allow test to control how Redpanda's TLS settings are configured pass - def _prepare_cluster(self, use_pkcs12: bool): + def _prepare_cluster(self): self.tls = TLSCertManager(self.logger) - self.provider = P12TLSProvider(self.tls, use_pkcs12) + self.provider = P12TLSProvider(self.tls) self.user_cert = self.tls.create_cert(socket.gethostname(), common_name="walterP", name="user") @@ -94,12 +92,11 @@ def _prepare_cluster(self, use_pkcs12: bool): # https://www.redhat.com/en/blog/fips-140-3-changes-pkcs-12 @skip_fips_mode @cluster(num_nodes=3) - @matrix(use_pkcs12=[True, False]) - def test_smoke(self, use_pkcs12: bool): + def test_smoke(self): """ Simple smoke test to verify that the PKCS12 file is being used """ - self._prepare_cluster(use_pkcs12) + self._prepare_cluster() TOPIC_NAME = "foo" self.rpk.create_topic(TOPIC_NAME) topics = [t for t in self.rpk.list_topics()]