Skip to content

Commit

Permalink
Increment: Modify 'RouteActionNonForwardingAction' test to be a separ…
Browse files Browse the repository at this point in the history
…ate testcase
  • Loading branch information
Aditya-Sood committed Aug 2, 2023
1 parent 5f6f416 commit 212c198
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions xds/internal/resolver/xds_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1813,7 +1813,7 @@ func (s) TestXDSResolverHTTPFilters(t *testing.T) {
}{

{
name: "route type not RouteActionRoute",
name: "route type RouteActionUnsupported invalid for client",
ldsFilters: []xdsresource.HTTPFilter{
{Name: "foo", Filter: &filterBuilder{path: &path}, Config: filterCfg{s: "foo1"}},
},
Expand All @@ -1828,8 +1828,28 @@ func (s) TestXDSResolverHTTPFilters(t *testing.T) {
"B": {Weight: 1},
},
ActionType: xdsresource.RouteActionUnsupported,
}, {
Prefix: newStringP("2"),
}},
},
},
},
rpcRes: map[string][][]string{
"1": {
{"build:foo1", "override:foo2", "build:bar1", "override:bar2", "newstream:foo1", "newstream:bar1", "done:bar1", "done:foo1"},
},
},
selectErr: errUnsupportedClientRouteAction.Error(),
},
{
name: "route type RouteActionNonForwardingAction invalid for client",
ldsFilters: []xdsresource.HTTPFilter{
{Name: "foo", Filter: &filterBuilder{path: &path}, Config: filterCfg{s: "foo1"}},
},
rtCfgUpdate: xdsresource.RouteConfigUpdate{
VirtualHosts: []*xdsresource.VirtualHost{
{
Domains: []string{targetStr},
Routes: []*xdsresource.Route{{
Prefix: newStringP("1"),
WeightedClusters: map[string]xdsresource.WeightedCluster{
"A": {Weight: 1},
"B": {Weight: 1},
Expand All @@ -1843,9 +1863,6 @@ func (s) TestXDSResolverHTTPFilters(t *testing.T) {
"1": {
{"build:foo1", "override:foo2", "build:bar1", "override:bar2", "newstream:foo1", "newstream:bar1", "done:bar1", "done:foo1"},
},
"2": {
{"build:foo1", "override:foo2", "build:bar1", "override:bar2", "newstream:foo1", "newstream:bar1", "done:bar1", "done:foo1"},
},
},
selectErr: errUnsupportedClientRouteAction.Error(),
},
Expand Down

0 comments on commit 212c198

Please sign in to comment.