From 75827cc1ea2d7b82ba5b620c9a97ab26b91ea30f Mon Sep 17 00:00:00 2001 From: phala Date: Wed, 19 Jun 2024 08:14:01 +0200 Subject: [PATCH 1/2] Rename KindExposer to LoadBalancerServiceExposer - Long but more fitting name --- testsuite/config/exposer.py | 4 ++-- testsuite/gateway/exposers.py | 4 ++-- .../tests/kuadrant/authorino/operator/raw_http/conftest.py | 4 ++-- testsuite/tests/kuadrant/authorino/operator/tls/conftest.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/testsuite/config/exposer.py b/testsuite/config/exposer.py index 7d51d945..a620e0f5 100644 --- a/testsuite/config/exposer.py +++ b/testsuite/config/exposer.py @@ -1,8 +1,8 @@ """Translates string to an Exposer class that can initialized""" -from testsuite.gateway.exposers import OpenShiftExposer, KindExposer +from testsuite.gateway.exposers import OpenShiftExposer, LoadBalancerServiceExposer -EXPOSERS = {"openshift": OpenShiftExposer, "kind": KindExposer} +EXPOSERS = {"openshift": OpenShiftExposer, "kind": LoadBalancerServiceExposer} # pylint: disable=unused-argument diff --git a/testsuite/gateway/exposers.py b/testsuite/gateway/exposers.py index 6a58fc98..8a6a6c9e 100644 --- a/testsuite/gateway/exposers.py +++ b/testsuite/gateway/exposers.py @@ -63,8 +63,8 @@ def hostname(self): return self._hostname -class KindExposer(Exposer): - """Exposer using loadbalancer service for Gateway""" +class LoadBalancerServiceExposer(Exposer): + """Exposer using Load Balancer service for Gateway""" def expose_hostname(self, name, gateway: Gateway) -> Hostname: return StaticLocalHostname( diff --git a/testsuite/tests/kuadrant/authorino/operator/raw_http/conftest.py b/testsuite/tests/kuadrant/authorino/operator/raw_http/conftest.py index 3f39740b..5d03b1b9 100644 --- a/testsuite/tests/kuadrant/authorino/operator/raw_http/conftest.py +++ b/testsuite/tests/kuadrant/authorino/operator/raw_http/conftest.py @@ -2,7 +2,7 @@ import pytest -from testsuite.gateway.exposers import KindExposer +from testsuite.gateway.exposers import LoadBalancerServiceExposer from testsuite.policy.authorization import Value, JsonResponse from testsuite.httpx import KuadrantClient from testsuite.policy.authorization.auth_config import AuthConfig @@ -29,7 +29,7 @@ def client(authorino_route): @pytest.fixture(scope="module") def authorino_route(request, exposer, authorino, blame, openshift): """Add route for authorino http port to be able to access it.""" - if isinstance(exposer, KindExposer): + if isinstance(exposer, LoadBalancerServiceExposer): pytest.skip("raw_http is not available on Kind") route = OpenshiftRoute.create_instance( diff --git a/testsuite/tests/kuadrant/authorino/operator/tls/conftest.py b/testsuite/tests/kuadrant/authorino/operator/tls/conftest.py index d7ed1236..d1d81c40 100644 --- a/testsuite/tests/kuadrant/authorino/operator/tls/conftest.py +++ b/testsuite/tests/kuadrant/authorino/operator/tls/conftest.py @@ -8,7 +8,7 @@ from testsuite.openshift import Selector from testsuite.gateway import Exposer from testsuite.gateway.envoy.tls import TLSEnvoy -from testsuite.gateway.exposers import KindExposer, OpenShiftExposer +from testsuite.gateway.exposers import LoadBalancerServiceExposer, OpenShiftExposer from testsuite.openshift.secret import TLSSecret from testsuite.utils import cert_builder @@ -183,7 +183,7 @@ def gateway( @pytest.fixture(scope="module") def exposer(request, testconfig, hub_openshift) -> Exposer: """Exposer object instance with TLS passthrough""" - if testconfig["default_exposer"] == KindExposer: + if testconfig["default_exposer"] == LoadBalancerServiceExposer: pytest.skip("TLS tests do not work on Kind") exposer = OpenShiftExposer(hub_openshift) request.addfinalizer(exposer.delete) From ca19e65ec90760047294e29cf7967a21fbe71abf Mon Sep 17 00:00:00 2001 From: phala Date: Wed, 19 Jun 2024 08:20:58 +0200 Subject: [PATCH 2/2] Add kubernetes exposer option --- testsuite/config/exposer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/config/exposer.py b/testsuite/config/exposer.py index a620e0f5..a7a6eaff 100644 --- a/testsuite/config/exposer.py +++ b/testsuite/config/exposer.py @@ -2,7 +2,7 @@ from testsuite.gateway.exposers import OpenShiftExposer, LoadBalancerServiceExposer -EXPOSERS = {"openshift": OpenShiftExposer, "kind": LoadBalancerServiceExposer} +EXPOSERS = {"openshift": OpenShiftExposer, "kind": LoadBalancerServiceExposer, "kubernetes": LoadBalancerServiceExposer} # pylint: disable=unused-argument