forked from Kuadrant/testsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add smoke test for authpolicy attached directly to gateway
- Loading branch information
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |