add regex header matching

pull/25115/head
Menghan Li 4 years ago
parent fe52ed2a82
commit be3369ceae
  1. 22
      tools/run_tests/run_xds_tests.py

@ -1223,6 +1223,28 @@ def test_header_matching(gcp, original_backend_service, instance_group,
"EmptyCall": original_backend_instances,
"UnaryCall": alternate_backend_instances
}),
(
[{
'priority': 0,
# Header RegexMatch -> alternate_backend_service.
# EmptyCall is sent with the metadata.
'matchRules': [{
'prefixMatch':
'/',
'headerMatches': [{
'headerName':
_TEST_METADATA_KEY,
'regexMatch':
"^%s.*%s$" % (_TEST_METADATA_VALUE_EMPTY[:2],
_TEST_METADATA_VALUE_EMPTY[-2:])
}]
}],
'service': alternate_backend_service.url
}],
{
"EmptyCall": alternate_backend_instances,
"UnaryCall": original_backend_instances
}),
]
for (route_rules, expected_instances) in test_cases:

Loading…
Cancel
Save