Skip to content

Commit

Permalink
Merge pull request #77 from canonical/DPE-6192-fix-tls-test
Browse files Browse the repository at this point in the history
[DPE-6192] fix TLS tests that flakely fails on CA mismatch
  • Loading branch information
MiaAltieri authored Dec 19, 2024
2 parents fe3efad + a18cb7f commit 576a114
Showing 1 changed file with 15 additions and 6 deletions.
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

0 comments on commit 576a114

Please sign in to comment.