Skip to content

Commit

Permalink
Fix preexisting auth
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Smolar <[email protected]>
  • Loading branch information
Jakub Smolar committed Sep 9, 2024
1 parent c216cfb commit 684f7a9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions testsuite/kuadrant/policy/authorization/auth_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def wait_for_ready(self):
success = self.wait_until(
lambda obj: len(obj.model.status.conditions) > 0
and all(x.status == "True" for x in obj.model.status.conditions)
and obj.model.status.summary.ready is True
)
assert success, f"{self.kind()} did not get ready in time"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ def _route(hostname, gateway):


@pytest.fixture(scope="module")
def setup_authorization(request, blame, cluster, label): # pylint: disable=unused-argument
def setup_authorization(request, blame, cluster, module_label): # pylint: disable=unused-argument
"""Factory method for creating AuthConfigs in the test run"""

def _authorization(route, sharding_label=None):
auth = AuthConfig.create_instance(
cluster,
blame("ac"),
route,
labels={"testRun": label, "sharding": sharding_label},
labels={"testRun": module_label, "sharding": sharding_label},
)
auth.responses.add_success_header("header", JsonResponse({"anything": Value(sharding_label)}))
request.addfinalizer(auth.delete)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@


@pytest.fixture(scope="module")
def setup_authorino(cluster, blame, testconfig, label, request):
def setup_authorino(cluster, blame, testconfig, module_label, request):
"""Authorino instance"""

def _authorino(sharding_label):
authorino = AuthorinoCR.create_instance(
cluster,
blame("authorino"),
blame("fart"),
image=weakget(testconfig)["authorino"]["image"] % None,
label_selectors=[f"sharding={sharding_label}", f"testRun={label}"],
label_selectors=[f"sharding={sharding_label}", f"testRun={module_label}"],
)
request.addfinalizer(authorino.delete)
authorino.commit()
Expand Down Expand Up @@ -59,7 +59,9 @@ def test_preexisting_auth(
route2 = setup_route(hostname.hostname, gw2)
auth = setup_authorization(route2, "B")
auth.wait_for_ready()
auth.refresh()

if auth.model.status.summary.hostsReady == []:
print("a")

assert (
hostname.hostname in auth.model.status.summary.hostsReady
Expand Down

0 comments on commit 684f7a9

Please sign in to comment.