[PSM Interop] Check for active ADS in Security and URL Map tests (#34968)

`test_client.wait_for_server_channel_ready` was not called in `SecurityXdsKubernetesTestCase` and `XdsUrlMapTestCase`.
Initial PR: https://github.com/grpc/grpc/pull/34631.

Closes #34968

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/34968 from sergiitk:psm-interop-secure-tests-ads a71b422c1c
PiperOrigin-RevId: 583180208
pull/35005/head
Sergii Tkachenko 1 year ago committed by Copybara-Service
parent 0a71e076f8
commit 5281789883
  1. 4
      tools/run_tests/xds_k8s_test_driver/framework/xds_gamma_testcase.py
  2. 54
      tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_testcase.py
  3. 3
      tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_testcase.py

@ -130,6 +130,8 @@ class GammaXdsKubernetesTestCase(xds_k8s_testcase.RegularXdsKubernetesTestCase):
# To compensate for this, we double the timeout for GAMMA tests.
return self._start_test_client(
server_target,
wait_for_active_channel_timeout=datetime.timedelta(minutes=10),
wait_for_server_channel_ready_timeout=datetime.timedelta(
minutes=10
),
**kwargs,
)

@ -739,6 +739,30 @@ class IsolatedXdsKubernetesTestCase(
force=self.force_cleanup, force_namespace=self.force_cleanup
)
def _start_test_client(
self,
server_target: str,
*,
wait_for_active_ads: bool = True,
wait_for_server_channel_ready: bool = True,
wait_for_active_ads_timeout: Optional[_timedelta] = None,
wait_for_server_channel_ready_timeout: Optional[_timedelta] = None,
**kwargs,
) -> XdsTestClient:
test_client = self.client_runner.run(
server_target=server_target, **kwargs
)
if wait_for_active_ads:
test_client.wait_for_active_xds_channel(
xds_server_uri=self.xds_server_uri,
timeout=wait_for_active_ads_timeout,
)
if wait_for_server_channel_ready:
test_client.wait_for_server_channel_ready(
timeout=wait_for_server_channel_ready_timeout,
)
return test_client
class RegularXdsKubernetesTestCase(IsolatedXdsKubernetesTestCase):
"""Regular test case base class for testing PSM features in isolation."""
@ -822,26 +846,6 @@ class RegularXdsKubernetesTestCase(IsolatedXdsKubernetesTestCase):
) -> XdsTestClient:
return self._start_test_client(test_server.xds_uri, **kwargs)
def _start_test_client(
self,
server_target: str,
*,
wait_for_active_ads_timeout: Optional[_timedelta] = None,
wait_for_active_channel_timeout: Optional[_timedelta] = None,
**kwargs,
) -> XdsTestClient:
test_client = self.client_runner.run(
server_target=server_target, **kwargs
)
test_client.wait_for_active_xds_channel(
xds_server_uri=self.xds_server_uri,
timeout=wait_for_active_ads_timeout,
)
test_client.wait_for_server_channel_ready(
timeout=wait_for_active_channel_timeout,
)
return test_client
class AppNetXdsKubernetesTestCase(RegularXdsKubernetesTestCase):
td: TrafficDirectorAppNetManager
@ -964,12 +968,12 @@ class SecurityXdsKubernetesTestCase(IsolatedXdsKubernetesTestCase):
wait_for_server_channel_ready=True,
**kwargs,
) -> XdsTestClient:
test_client = self.client_runner.run(
server_target=test_server.xds_uri, secure_mode=True, **kwargs
return self._start_test_client(
server_target=test_server.xds_uri,
wait_for_server_channel_ready=wait_for_server_channel_ready,
secure_mode=True,
**kwargs,
)
if wait_for_server_channel_ready:
test_client.wait_for_server_channel_ready()
return test_client
def assertTestAppSecurity(
self,

@ -479,6 +479,9 @@ class XdsUrlMapTestCase(
super().run(result)
def test_client_config(self):
self.test_client.wait_for_active_xds_channel(
xds_server_uri=GcpResourceManager().xds_server_uri,
)
retryer = retryers.constant_retryer(
wait_fixed=datetime.timedelta(
seconds=_URL_MAP_PROPAGATE_CHECK_INTERVAL_SEC

Loading…
Cancel
Save