Skip to content

Commit

Permalink
scale up before password rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
paulomach committed Jun 26, 2023
1 parent 816f4bd commit ffc1c70
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,23 @@ async def test_scale_up_and_down(ops_test: OpsTest) -> None:
assert len(not_online_member_addresses) == 0


@pytest.mark.abort_on_fail
async def test_scale_up_after_scale_down(ops_test: OpsTest) -> None:
"""Confirm storage reuse works."""
async with ops_test.fast_forward():
random_unit = ops_test.model.applications[APP_NAME].units[0]

await scale_application(ops_test, APP_NAME, 3)

cluster_status = await get_cluster_status(ops_test, random_unit)
online_member_addresses = [
member["address"]
for _, member in cluster_status["defaultreplicaset"]["topology"].items()
if member["status"] == "online"
]
assert len(online_member_addresses) == 3


@pytest.mark.abort_on_fail
async def test_password_rotation(ops_test: OpsTest):
"""Rotate password and confirm changes."""
Expand Down Expand Up @@ -285,20 +302,3 @@ async def test_exporter_endpoints(ops_test: OpsTest) -> None:
assert "mysql_exporter_last_scrape_error 0" in resp.data.decode(
"utf8"
), "Scrape error in mysql_exporter"


@pytest.mark.abort_on_fail
async def test_scale_up_after_scale_down(ops_test: OpsTest) -> None:
"""Confirm storage reuse works."""
async with ops_test.fast_forward():
random_unit = ops_test.model.applications[APP_NAME].units[0]

await scale_application(ops_test, APP_NAME, 3)

cluster_status = await get_cluster_status(ops_test, random_unit)
online_member_addresses = [
member["address"]
for _, member in cluster_status["defaultreplicaset"]["topology"].items()
if member["status"] == "online"
]
assert len(online_member_addresses) == 3

0 comments on commit ffc1c70

Please sign in to comment.