Skip to content

Fix broken TLS + X509 tests that never enabled TLS#815

Open
filipcirtog wants to merge 6 commits intomasterfrom
02-20-fix_tls_tests
Open

Fix broken TLS + X509 tests that never enabled TLS#815
filipcirtog wants to merge 6 commits intomasterfrom
02-20-fix_tls_tests

Conversation

@filipcirtog
Copy link
Collaborator

@filipcirtog filipcirtog commented Feb 20, 2026

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

  • Add missing update() calls and set certsSecretPrefix/tls.ca in RS and SC tests to properly enable TLS
  • Add test_connectivity_with_ssl to verify TLS with SSL-enabled client
  • Increase X509 timeout to 1200s/2000s for auth transitions
  • Remove standalone test from Evergreen

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you added changelog file?

Copy link
Collaborator Author

filipcirtog commented Feb 20, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@filipcirtog filipcirtog added the skip-changelog Use this label in Pull Request to not require new changelog entry file label Feb 20, 2026 — with Graphite App
@filipcirtog filipcirtog changed the title fix tls tests Fix TLS and X509 simultaneous tests and multicluster replicaset test Feb 20, 2026
@filipcirtog filipcirtog changed the base branch from 02-20-remove_stale_mdb_load to graphite-base/815 February 20, 2026 11:49
@filipcirtog filipcirtog changed the base branch from graphite-base/815 to master February 20, 2026 11:49
@github-actions
Copy link

github-actions bot commented Feb 20, 2026

⚠️ (this preview might not be accurate if the PR is not rebased on current master branch)

MCK 1.7.1 Release Notes

Other Changes

  • Container images: Merged the init-database and init-appdb init container images into a single init-database image. The init-appdb image will no longer be published and does not affect existing deployments.
  • Helm Chart: Removed operator.baseName Helm value. This value was never intended to be consumed by operator users and was never documented. The value controls the prefix for workload RBAC resource names (mongodb-kubernetes default), but changing it could break the operator and workloads because the operator is not aware of custom prefixes. With this change, the Helm chart will no longer allow customisation and the relevant resources will be deployed with predefined names (ServiceAccount with names mongodb-kubernetes-appdb, mongodb-kubernetes-database-pods, mongodb-kubernetes-ops-manager, Role with name mongodb-kubernetes-appdb and RoleBinding with name mongodb-kubernetes-appdb).

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, call update(), and add SSL connectivity assertions before enabling X509 auth.
  • Fix the multicluster clusterwide replicaset test to use the correct spec.security.authentication structure and ensure spec changes are applied via try_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_st task 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
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
@filipcirtog filipcirtog changed the title Fix TLS and X509 simultaneous tests and multicluster replicaset test Fix TLS and X509 simultaneous tests Feb 20, 2026
@filipcirtog filipcirtog marked this pull request as ready for review February 20, 2026 15:54
@filipcirtog filipcirtog requested a review from a team as a code owner February 20, 2026 15:54
@filipcirtog filipcirtog changed the title Fix TLS and X509 simultaneous tests Fix TLS and X509 tests Feb 20, 2026
@nammn
Copy link
Collaborator

nammn commented Feb 24, 2026

The changes make sense, but can you update your pr description with the why rather than what?

@filipcirtog filipcirtog changed the title Fix TLS and X509 tests Fix broken TLS + X509 tests that never enabled TLS Mar 4, 2026
@filipcirtog filipcirtog requested a review from a team as a code owner March 10, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use this label in Pull Request to not require new changelog entry file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants