Skip to content

Commit

Permalink
Add smoke test for authpolicy attached directly to gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
averevki committed Dec 5, 2023
1 parent 244b2a5 commit 17db78d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Empty file.
17 changes: 17 additions & 0 deletions testsuite/tests/kuadrant/gateway/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Conftest for gateway tests"""
import pytest

from testsuite.openshift.objects.auth_config.auth_policy import AuthPolicy


@pytest.fixture(scope="module")
def authorization(gateway, authorization_name, openshift, module_label):
"""Create AuthPolicy attached to gateway"""
return AuthPolicy.create_instance(openshift, authorization_name, gateway, labels={"testRun": module_label})


@pytest.fixture(scope="module", autouse=True)
def commit(request, authorization):
"""Only commit authorization component"""
request.addfinalizer(authorization.delete)
authorization.commit()
9 changes: 9 additions & 0 deletions testsuite/tests/kuadrant/gateway/test_basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""Test for AuthPolicy attached directly to gateway"""
import pytest


@pytest.mark.issue("https://github.com/Kuadrant/kuadrant-operator/pull/287")
def test_authpolicy_attached_to_gateway(client):
"""Test if AuthPolicy attached directly to gateway works"""
response = client.get("/get")
assert response.status_code == 200

0 comments on commit 17db78d

Please sign in to comment.