Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DPE-6192] fix TLS tests that flakely fails on CA mismatch #77

Merged
merged 1 commit into from
Dec 19, 2024
Merged
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
21 changes: 15 additions & 6 deletions tests/integration/tls_tests/test_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,18 @@ async def test_tls_reenabled(ops_test: OpsTest) -> None:
async def test_mongos_tls_ca_mismatch(ops_test: OpsTest) -> None:
"""Tests that mongos charm can disable TLS."""
await toggle_tls_mongos(ops_test, enable=False)

await ops_test.model.deploy(
CERTS_APP_NAME, application_name=DIFFERENT_CERTS_APP_NAME, channel="edge"
)

await ops_test.model.wait_for_idle(
apps=[MONGOS_APP_NAME],
idle_period=60,
timeout=TIMEOUT,
raise_on_blocked=False,
)

await ops_test.model.wait_for_idle(
apps=[DIFFERENT_CERTS_APP_NAME],
idle_period=20,
Expand Down Expand Up @@ -246,12 +255,12 @@ async def rotate_and_verify_certs(ops_test: OpsTest) -> None:
for unit in ops_test.model.applications[MONGOS_APP_NAME].units:
original_tls_info[unit.name] = {}

original_tls_info[unit.name]["external_cert_contents"] = (
await get_file_contents(ops_test, unit, EXTERNAL_CERT_PATH)
)
original_tls_info[unit.name]["internal_cert_contents"] = (
await get_file_contents(ops_test, unit, INTERNAL_CERT_PATH)
)
original_tls_info[unit.name][
"external_cert_contents"
] = await get_file_contents(ops_test, unit, EXTERNAL_CERT_PATH)
original_tls_info[unit.name][
"internal_cert_contents"
] = await get_file_contents(ops_test, unit, INTERNAL_CERT_PATH)
original_tls_info[unit.name]["external_cert_time"] = await time_file_created(
ops_test, unit.name, EXTERNAL_CERT_PATH
)
Expand Down
Loading