Skip to content

Commit

Permalink
disable aproxy conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
cbartz committed Sep 5, 2024
1 parent acfc35a commit e45878e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
from tests.integration.helpers.lxd import LXDInstanceHelper, ensure_charm_has_runner
from tests.integration.helpers.openstack import OpenStackInstanceHelper, PrivateEndpointConfigs
from tests.status_name import ACTIVE
from utilities import execute_command
from utilities import execute_command, get_env_var

# The following line is required because we are using request.getfixturevalue in conjunction
# with pytest-asyncio. See https://github.com/pytest-dev/pytest-asyncio/issues/112
Expand Down Expand Up @@ -443,11 +443,12 @@ async def app_openstack_runner_fixture(

# The openstack charm is likely to be deployed on a self-hosted runner with aproxy active,
# which means that we cannot properly test proxy-related issues (because aproxy will forward
# everything anyway), therefore we disable aproxy.
logging.info(
"Assuming to be executed on a runner with aproxy running, therefore disabling aproxy..."
)
execute_command(["sudo", "/usr/bin/snap", "disable", "aproxy"], check_exit=True)
# everything anyway), therefore we disable aproxy in this case.
if get_env_var("RUNNER_NAME") == "self-hosted":
logging.info(
"Assuming to be executed on a runner with aproxy running, therefore disabling aproxy..."
)
execute_command(["sudo", "/usr/bin/snap", "disable", "aproxy"], check_exit=True)

await model.wait_for_idle(apps=[application.name], status=ACTIVE, timeout=90 * 60)

Expand Down

0 comments on commit e45878e

Please sign in to comment.