Fix broken TLS + X509 tests that never enabled TLS#815
Fix broken TLS + X509 tests that never enabled TLS#815filipcirtog wants to merge 6 commits intomasterfrom
Conversation
323bb8b to
2569f38
Compare
2569f38 to
b9bb721
Compare
9e6145b to
c5f3d11
Compare
b9bb721 to
e662b8d
Compare
MCK 1.7.1 Release NotesOther Changes
|
e662b8d to
972b3cc
Compare
972b3cc to
2544596
Compare
There was a problem hiding this comment.
Pull request overview
This PR adjusts E2E tests to correctly apply and validate TLS enablement before switching authentication to X509, and fixes spec update handling in a multicluster replicaset test.
Changes:
- Update the RS and SC “TLS + X509 simultaneously” tests to explicitly enable TLS via
certsSecretPrefix+tls.ca, callupdate(), and add SSL connectivity assertions before enabling X509 auth. - Fix the multicluster clusterwide replicaset test to use the correct
spec.security.authenticationstructure and ensure spec changes are applied viatry_load()/update(). - Remove the standalone variant of the “TLS + X509 simultaneously” test from Evergreen configuration (and delete the standalone test file).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docker/mongodb-kubernetes-tests/tests/tls/e2e_configure_tls_and_x509_simultaneously_standalone.py | Removes the standalone TLS+X509 simultaneous E2E test module. |
| docker/mongodb-kubernetes-tests/tests/tls/e2e_configure_tls_and_x509_simultaneously_rs.py | Enables TLS through spec updates, adds SSL connectivity test, then enables X509 auth. |
| docker/mongodb-kubernetes-tests/tests/tls/e2e_configure_tls_and_x509_simultaneously_sc.py | Same as RS but for sharded cluster; adds TLS enablement step + SSL connectivity check before X509 auth. |
| docker/mongodb-kubernetes-tests/tests/multicluster/multi_2_cluster_clusterwide_replicaset.py | Fixes auth spec shape (dict vs tuple), adds missing update() calls, uses try_load() in fixtures. |
| .evergreen.yml | Removes the standalone TLS+X509 task from the relevant task group. |
| .evergreen-tasks.yml | Removes the standalone TLS+X509 task definition. |
Comments suppressed due to low confidence (1)
.evergreen.yml:748
- PR description discusses fixing the standalone TLS+X509 simultaneous test, but this change removes the
e2e_configure_tls_and_x509_simultaneously_sttask from Evergreen (and the standalone test file/task appears to be deleted). Either update the PR description/title to reflect that the standalone coverage was removed, or restore/replace the standalone test so coverage remains consistent with the stated intent.
# e2e_x509_task_group
- e2e_configure_tls_and_x509_simultaneously_rs
- e2e_configure_tls_and_x509_simultaneously_sc
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -10,6 +10,7 @@ | |||
| from tests.shardedcluster.conftest import enable_multi_cluster_deployment, get_mongos_service_names | |||
There was a problem hiding this comment.
This module currently has an unused import (ShardedClusterTester). With the repo's flake8 config selecting F codes, this will raise an F401 unused-import error and fail lint. Remove the unused import (or use it if intended).
|
The changes make sense, but can you update your pr description with the why rather than what? |

Summary
TLS + X509 tests (RS, SC, Standalone) were broken: Tests modified spec.security but never set certsSecretPrefix or called update(), so IsTLSEnabled() always returned false and the automation config never included TLS settings. Tests passed without actually validating TLS behavior.
Standalone doesn't support TLS + X509 simultaneously: MongoDB standalone deployments don't support X509 authentication, so the standalone test was removed rather than fixed.
Multicluster test: Omitted update() calls.
Proof of Work
Checklist
skip-changeloglabel if not needed