|
6 | 6 | import logging |
7 | 7 |
|
8 | 8 | import pytest |
9 | | -from juju import tag |
10 | 9 | from pytest_operator.plugin import OpsTest |
11 | 10 | from tenacity import Retrying, stop_after_delay, wait_fixed |
12 | 11 |
|
@@ -44,7 +43,7 @@ async def test_app_force_removal(ops_test: OpsTest, charm: str): |
44 | 43 | application_name=APPLICATION_NAME, |
45 | 44 | num_units=1, |
46 | 45 | base=CHARM_BASE, |
47 | | - storage={"pgdata": {"pool": "lxd-btrfs", "size": 8045}}, |
| 46 | + storage={"pgdata": {"pool": "lxd-btrfs", "size": 8046}}, |
48 | 47 | config={"profile": "testing"}, |
49 | 48 | ) |
50 | 49 |
|
@@ -143,14 +142,9 @@ async def test_app_resources_conflicts_v3(ops_test: OpsTest, charm: str): |
143 | 142 | garbage_storage = await get_any_deatached_storage(ops_test) |
144 | 143 |
|
145 | 144 | logger.info("deploying duplicate application with attached storage") |
146 | | - await ops_test.model.deploy( |
147 | | - charm, |
148 | | - application_name=DUP_APPLICATION_NAME, |
149 | | - num_units=1, |
150 | | - base=CHARM_BASE, |
151 | | - attach_storage=[tag.storage(garbage_storage)], |
152 | | - config={"profile": "testing"}, |
153 | | - ) |
| 145 | + deploy_cmd = f"deploy ./{charm} {DUP_APPLICATION_NAME} --model={ops_test.model.info.name} --attach-storage={garbage_storage} --config profile=testing".split() |
| 146 | + return_code, _, _ = await ops_test.juju(*deploy_cmd) |
| 147 | + assert return_code == 0, "Failed to add unit with storage" |
154 | 148 |
|
155 | 149 | # Reducing the update status frequency to speed up the triggering of deferred events. |
156 | 150 | await ops_test.model.set_config({"update-status-hook-interval": "10s"}) |
|
0 commit comments