Skip to content

Commit

Permalink
update integration test to request audit endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
AmberCharitos committed Jul 23, 2024
1 parent 7086652 commit 4973989
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 12 additions & 10 deletions tests/integration/test_opensearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async def deploy_opensearch(lxd_model: Model):
lxd_model: The LXD model.
"""
await asyncio.gather(
lxd_model.deploy("ch:opensearch", num_units=1, channel="2/edge"),
lxd_model.deploy("ch:opensearch", num_units=2, channel="2/edge"),
lxd_model.deploy(
"self-signed-certificates", num_units=1, channel="edge"
),
Expand Down Expand Up @@ -146,18 +146,19 @@ async def deploy_ranger(
controller_name=lxd_controller_name,
)
await k8s_model.wait_for_idle(
apps=[APP_NAME, POSTGRES_NAME],
apps=[POSTGRES_NAME],
status="active",
raise_on_blocked=False,
timeout=1500,
)
await k8s_model.integrate(APP_NAME, "opensearch")
await k8s_model.wait_for_idle(
apps=[APP_NAME],
status="active",
raise_on_blocked=False,
timeout=1500,
)
async with ops_test.fast_forward():
await k8s_model.wait_for_idle(
apps=[APP_NAME],
status="active",
raise_on_blocked=False,
timeout=1500,
)


@pytest.mark.abort_on_fail
Expand All @@ -170,7 +171,8 @@ async def test_ranger_ui(self, ops_test: OpsTest):
url = await get_unit_url(
ops_test, application=APP_NAME, unit=0, port=6080
)
logger.info("curling app address: %s", url)
audit_url = f"{url}/service/assets/accessAudit"
logger.info("curling app address: %s", audit_url)

response = requests.get(url, timeout=300, verify=False) # nosec
response = requests.get(audit_url, timeout=300, verify=False) # nosec
assert response.status_code == 200
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ allowlist_externals =
commands_pre =
sudo sysctl -w vm.max_map_count=262144 vm.swappiness=0 net.ipv4.tcp_retries2=5
commands =
pytest {[vars]tst_path}integration/test_opensearch.py -v --tb native --ignore={[vars]tst_path}unit --log-cli-level=INFO -s {posargs} --keep-models
pytest {[vars]tst_path}integration/test_opensearch.py -v --tb native --ignore={[vars]tst_path}unit --log-cli-level=INFO -s {posargs}

[testenv:unit]
description = Run tests
Expand Down

0 comments on commit 4973989

Please sign in to comment.