8000 Expand FIPS TLS e2e coverage with host-run cipher probes and broader listener rejection checks by Elmo33 · Pull Request #2030 · Altinity/clickhouse-operator · GitHub
[go: up one dir, main page]

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tests/e2e/kubectl.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,11 @@ def run_shell(cmd, timeout=600, ok_to_fail=False, shell=None, retry_transient=Fa
assert code == 0, error()


def delete_kind(kind, name, ns=None, ok_to_fail=False, shell=None):
def delete_kind(kind, name, ns=None, ok_to_fail=False, shell=None, wait=True):
with When(f"Delete {kind} {name}"):
wait_flag = "" if wait else "--wait=false"
launch(
f"delete {kind} {name} -v 5 --now --timeout=600s",
f"delete {kind} {name} -v 5 --now --timeout=600s {wait_flag}".strip(),
ns=ns,
timeout=600,
ok_to_fail=ok_to_fail,
Expand Down Expand Up @@ -233,7 +234,7 @@ def delete_all(kind, ns=None):
# OR mid-restart — e.g. chopconf in test_030008)
# makes `kubectl delete --timeout` exit non-zero; we recover via
# the force-clear loop below, so this must not raise here.
delete_kind(kind, name, ns=ns, ok_to_fail=True)
delete_kind(kind, name, ns=ns, ok_to_fail=True, wait=False)
# Stuck/re-attached finalizer recovery. The operator can RE-ATTACH
# a finalizer after a clear while it is restarting, so a single
# wait_object would race the restart and raise. Re-clear + re-delete
Expand All @@ -244,7 +245,7 @@ def delete_all(kind, ns=None):
if get_count(kind, name=name, ns=ns) == 0:
break
force_clear_finalizers(kind, name, ns=ns)
delete_kind(kind, name, ns=ns, ok_to_fail=True)
delete_kind(kind, name, ns=ns, ok_to_fail=True, wait=False)
# Only sleep if another re-check follows; skip on the last
# attempt so a genuinely-stuck CR hits the final wait_object
# (the authoritative leak assertion) without an extra wait.
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/manifests/chi/test-030003.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ spec:
<dhParamsFile>/etc/clickhouse-server/secrets.d/dhparam.pem/clickhouse-certs/dhparam.pem</dhParamsFile>
<!-- Server-auth TLS only: clients validate this certificate; the server does not require client certificates (not mTLS). -->
<verificationMode>none</verificationMode>
<disableProtocols>sslv2,sslv3,tlsv1,tlsv1_1</disableProtocols>
<disableProtocols>sslv2,sslv3,tlsv1,tlsv1_1,tlsv1_2</disableProtocols>
<cipherSuites>TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384</cipherSuites>
</server>
<client>
<caConfig>/etc/clickhouse-server/secrets.d/ca.crt/clickhouse-certs/ca.crt</caConfig>
<loadDefaultCAFile>false</loadDefaultCAFile>
<verificationMode>strict</verificationMode>
<disableProtocols>sslv2,sslv3,tlsv1,tlsv1_1</disableProtocols>
<disableProtocols>sslv2,sslv3,tlsv1,tlsv1_1,tlsv1_2</disableProtocols>
<cipherSuites>TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384</cipherSuites>
</client>
</openSSL>
Expand Down
33 changes: 33 additions & 0 deletions tests/e2e/manifests/chi/test-030017-chi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: "clickhouse.altinity.com/v1"
kind: "ClickHouseInstallation"
metadata:
name: test-030017-chi
spec:
# chi-...-0-0.<ns>.127.0.0.1.nip.io → 127.0.0.1 on the host; operator Ping(:8443)
# hits local openssl s_server, not a real ClickHouse HTTPS listener.
namespaceDomainPattern: "%s.127.0.0.1.nip.io"
reconcile:
host:
wait:
exclude: "no"
queries: "no"
probes:
startup: "no"
readiness: "no"
templates:
podTemplates:
- name: clickhouse
spec:
containers:
- name: clickhouse
image: altinity/clickhouse-server:25.3.8.30001.altinityfips
configuration:
clusters:
- name: default
secure: "yes"
insecure: "no"
templates:
podTemplate: clickhouse
layout:
shardsCount: 1
replicasCount: 1
4 changes: 2 additions & 2 deletions tests/e2e/manifests/chk/test-030003.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ spec:
<privateKeyFile>/etc/clickhouse-server/secrets.d/server.key/clickhouse-certs/server.key</privateKeyFile>
<!-- Server-auth TLS only: clients validate this certificate; the server does not require client certificates (not mTLS). -->
<verificationMode>none</verificationMode>
<disableProtocols>sslv2,sslv3,tlsv1,tlsv1_1</disableProtocols>
<disableProtocols>sslv2,sslv3,tlsv1,tlsv1_1,tlsv1_2</disableProtocols>
<cipherSuites>TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384</cipherSuites>
</server>
<client>
<caConfig>/etc/clickhouse-server/secrets.d/ca.crt/clickhouse-certs/ca.crt</caConfig>
<loadDefaultCAFile>false</loadDefaultCAFile>
<verificationMode>strict</verificationMode>
<disableProtocols>sslv2,sslv3,tlsv1,tlsv1_1</disableProtocols>
<disableProtocols>sslv2,sslv3,tlsv1,tlsv1_1,tlsv1_2</disableProtocols>
<cipherSuites>TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384</cipherSuites>
</client>
</openSSL>
Expand Down
30 changes: 0 additions & 30 deletions tests/e2e/run_tests_acvp_local.sh

This file was deleted.

13 changes: 11 additions & 2 deletions tests/e2e/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,18 @@ def get_shell(self, timeout=600):
def create_test_namespace(self, force=False):
"""Create unique test namespace for test."""

random_namespace = self.name[self.name.find('test_0'):self.name.find('. ')].replace("_", "-") + "-" + str(uuid.uuid1())
# Derive prefix from scenario id: test_010001, test_010006_2, test_039, etc.
# Nested TestStep names may not contain ". ", so slicing on ". " is unsafe.
match = re.search(r"test_\d+(?:_\d+)?", self.name)
assert match, error(f"cannot derive namespace prefix from test name: {self.name!r}")

random_namespace = (
match.group(0).replace("_", "-")
+ "-"
+ str(uuid.uuid1())
)

if not force: # (self.cflags & PARALLEL) and not force:
if not force: # (self.cflags & PARALLEL) and not force:
self.context.test_namespace = random_namespace

self.context.operator_namespace = self.context.test_namespace
Expand Down
Loading
Loading
0