Fix two issues with the test framework and new CSDS (#27840)

pull/27844/head
Lidi Zheng 3 years ago committed by GitHub
parent 70b26a1c7c
commit e2f5ad8184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      tools/run_tests/xds_k8s_test_driver/framework/xds_k8s_testcase.py
  2. 4
      tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_testcase.py

@ -329,15 +329,15 @@ class XdsKubernetesTestCase(absltest.TestCase, metaclass=abc.ABCMeta):
for xds_config in config.xds_config:
seen.add(xds_config.WhichOneof('per_xds_config'))
for generic_xds_config in config.generic_xds_configs:
if re.search(r'\.Listener$', generic_xds_config['typeUrl']):
if re.search(r'\.Listener$', generic_xds_config.type_url):
seen.add('listener_config')
elif re.search(r'\.RouteConfiguration$',
generic_xds_config['typeUrl']):
generic_xds_config.type_url):
seen.add('route_config')
elif re.search(r'\.Cluster$', generic_xds_config['typeUrl']):
elif re.search(r'\.Cluster$', generic_xds_config.type_url):
seen.add('cluster_config')
elif re.search(r'\.ClusterLoadAssignment$',
generic_xds_config['typeUrl']):
generic_xds_config.type_url):
seen.add('endpoint_config')
logger.debug('Received xDS config dump: %s',
json_format.MessageToJson(config, indent=2))

@ -115,10 +115,10 @@ class DumpedXdsConfig(dict):
generic_xds_config['typeUrl']):
self.rds = generic_xds_config["xdsConfig"]
elif re.search(r'\.Cluster$', generic_xds_config['typeUrl']):
self.cds = generic_xds_config["xdsConfig"]
self.cds.append(generic_xds_config["xdsConfig"])
elif re.search(r'\.ClusterLoadAssignment$',
generic_xds_config['typeUrl']):
self.eds = generic_xds_config["xdsConfig"]
self.eds.append(generic_xds_config["xdsConfig"])
except Exception as e:
logging.debug('Parsing dumped xDS config failed with %s: %s',
type(e), e)

Loading…
Cancel
Save