From cd2e8a5c540002d17e2dc1d1a65764257b4f515a Mon Sep 17 00:00:00 2001 From: Amber Charitos Date: Fri, 20 Oct 2023 17:30:07 +0100 Subject: [PATCH] set_config --- tests/integration/helpers.py | 4 ++-- tests/integration/test_policy.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/integration/helpers.py b/tests/integration/helpers.py index a53b2fc..7ccff9b 100644 --- a/tests/integration/helpers.py +++ b/tests/integration/helpers.py @@ -34,7 +34,7 @@ connection-password=trino """ RANGER_NAME = "ranger-k8s" -GROUP_MANAGEMENT = """ +GROUP_MANAGEMENT = """\ relation_6: users: - name: user1 @@ -116,7 +116,7 @@ async def run_connector_action(ops_test, action, params, user): async def create_group_policy(ops_test, ranger_url): ranger = RangerClient(ranger_url, RANGER_AUTH) policy = RangerPolicy() - policy.service = "relation_2" + policy.service = "relation_6" policy.name = "tpch - catalog, schema, table, column" policy.resources = { "schema": RangerPolicyResource({"values": ["*"]}), diff --git a/tests/integration/test_policy.py b/tests/integration/test_policy.py index ca2b5fd..6165a8e 100644 --- a/tests/integration/test_policy.py +++ b/tests/integration/test_policy.py @@ -60,6 +60,7 @@ async def deploy(ops_test: OpsTest): timeout=1200, ) await ops_test.model.integrate(RANGER_NAME, POSTGRES_NAME) + await ops_test.model.set_config({"update-status-hook-interval": "1m"}) await ops_test.model.wait_for_idle( apps=[POSTGRES_NAME, RANGER_NAME], status="active", @@ -74,11 +75,10 @@ async def deploy(ops_test: OpsTest): raise_on_blocked=False, timeout=1200, ) - time.sleep(10) - app = ops_test.model.applications.get("ranger-k8s") - logging.info("configuring ranger values") - await app.set_config({"user-group-configuration": f"{GROUP_MANAGEMENT}"}) - time.sleep(10) + + logging.info("updating config") + app: Application = ops_test.model.applications.get("ranger-k8s") + app.set_config({"user-group-configuration": GROUP_MANAGEMENT}) await ops_test.model.wait_for_idle( apps=[APP_NAME, RANGER_NAME], status="active",