Skip to content

Commit

Permalink
Improve testutils.MarshalAny (#6617)
Browse files Browse the repository at this point in the history
  • Loading branch information
ulascansenturk authored Sep 18, 2023
1 parent 3156151 commit 130bc42
Show file tree
Hide file tree
Showing 27 changed files with 648 additions and 632 deletions.
14 changes: 8 additions & 6 deletions internal/testutils/marshal_any.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,21 @@
package testutils

import (
"fmt"
"testing"

"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"google.golang.org/protobuf/protoadapt"
"google.golang.org/protobuf/types/known/anypb"
)

// MarshalAny is a convenience function to marshal protobuf messages into any
// protos. It will panic if the marshaling fails.
func MarshalAny(m proto.Message) *anypb.Any {
a, err := ptypes.MarshalAny(m)
// protos. function will fail the test with a fatal error if the marshaling fails.
func MarshalAny(t *testing.T, m proto.Message) *anypb.Any {
t.Helper()

a, err := anypb.New(protoadapt.MessageV2Of(m))
if err != nil {
panic(fmt.Sprintf("ptypes.MarshalAny(%+v) failed: %v", m, err))
t.Fatalf("Failed to marshal proto %+v into an Any: %v", m, err)
}
return a
}
25 changes: 17 additions & 8 deletions internal/testutils/xds/e2e/clientresources.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ import (
"net"
"strconv"

"google.golang.org/protobuf/protoadapt"

"github.com/envoyproxy/go-control-plane/pkg/wellknown"
"github.com/golang/protobuf/proto"
"google.golang.org/grpc/internal/testutils"
"google.golang.org/protobuf/types/known/anypb"

v3clusterpb "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3"
Expand Down Expand Up @@ -106,7 +107,7 @@ var RouterHTTPFilter = HTTPFilter("router", &v3routerpb.Router{})
// DefaultClientListener returns a basic xds Listener resource to be used on
// the client side.
func DefaultClientListener(target, routeName string) *v3listenerpb.Listener {
hcm := testutils.MarshalAny(&v3httppb.HttpConnectionManager{
hcm := marshalAny(&v3httppb.HttpConnectionManager{
RouteSpecifier: &v3httppb.HttpConnectionManager_Rds{Rds: &v3httppb.Rds{
ConfigSource: &v3corepb.ConfigSource{
ConfigSourceSpecifier: &v3corepb.ConfigSource_Ads{Ads: &v3corepb.AggregatedConfigSource{}},
Expand All @@ -128,6 +129,14 @@ func DefaultClientListener(target, routeName string) *v3listenerpb.Listener {
}
}

func marshalAny(m proto.Message) *anypb.Any {
a, err := anypb.New(protoadapt.MessageV2Of(m))
if err != nil {
panic(fmt.Sprintf("anypb.New(%+v) failed: %v", m, err))
}
return a
}

// DefaultServerListener returns a basic xds Listener resource to be used on
// the server side.
func DefaultServerListener(host string, port uint32, secLevel SecurityLevel) *v3listenerpb.Listener {
Expand Down Expand Up @@ -163,7 +172,7 @@ func DefaultServerListener(host string, port uint32, secLevel SecurityLevel) *v3
ts = &v3corepb.TransportSocket{
Name: "envoy.transport_sockets.tls",
ConfigType: &v3corepb.TransportSocket_TypedConfig{
TypedConfig: testutils.MarshalAny(tlsContext),
TypedConfig: marshalAny(tlsContext),
},
}
}
Expand Down Expand Up @@ -205,7 +214,7 @@ func DefaultServerListener(host string, port uint32, secLevel SecurityLevel) *v3
{
Name: "filter-1",
ConfigType: &v3listenerpb.Filter_TypedConfig{
TypedConfig: testutils.MarshalAny(&v3httppb.HttpConnectionManager{
TypedConfig: marshalAny(&v3httppb.HttpConnectionManager{
RouteSpecifier: &v3httppb.HttpConnectionManager_RouteConfig{
RouteConfig: &v3routepb.RouteConfiguration{
Name: "routeName",
Expand Down Expand Up @@ -253,7 +262,7 @@ func DefaultServerListener(host string, port uint32, secLevel SecurityLevel) *v3
{
Name: "filter-1",
ConfigType: &v3listenerpb.Filter_TypedConfig{
TypedConfig: testutils.MarshalAny(&v3httppb.HttpConnectionManager{
TypedConfig: marshalAny(&v3httppb.HttpConnectionManager{
RouteSpecifier: &v3httppb.HttpConnectionManager_RouteConfig{
RouteConfig: &v3routepb.RouteConfiguration{
Name: "routeName",
Expand Down Expand Up @@ -285,7 +294,7 @@ func HTTPFilter(name string, config proto.Message) *v3httppb.HttpFilter {
return &v3httppb.HttpFilter{
Name: name,
ConfigType: &v3httppb.HttpFilter_TypedConfig{
TypedConfig: testutils.MarshalAny(config),
TypedConfig: marshalAny(config),
},
}
}
Expand Down Expand Up @@ -570,7 +579,7 @@ func ClusterResourceWithOptions(opts ClusterOptions) *v3clusterpb.Cluster {
cluster.ClusterDiscoveryType = &v3clusterpb.Cluster_ClusterType{
ClusterType: &v3clusterpb.Cluster_CustomClusterType{
Name: "envoy.clusters.aggregate",
TypedConfig: testutils.MarshalAny(&v3aggregateclusterpb.ClusterConfig{
TypedConfig: marshalAny(&v3aggregateclusterpb.ClusterConfig{
Clusters: opts.ChildNames,
}),
},
Expand All @@ -580,7 +589,7 @@ func ClusterResourceWithOptions(opts ClusterOptions) *v3clusterpb.Cluster {
cluster.TransportSocket = &v3corepb.TransportSocket{
Name: "envoy.transport_sockets.tls",
ConfigType: &v3corepb.TransportSocket_TypedConfig{
TypedConfig: testutils.MarshalAny(tlsContext),
TypedConfig: marshalAny(tlsContext),
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/xds/rbac/converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (s) TestBuildLoggerErrors(t *testing.T) {
loggerConfig: &v3rbacpb.RBAC_AuditLoggingOptions_AuditLoggerConfig{
AuditLogger: &v3corepb.TypedExtensionConfig{
Name: "TestAuditLoggerBuffer",
TypedConfig: testutils.MarshalAny(&v3rbacpb.RBAC_AuditLoggingOptions{}),
TypedConfig: testutils.MarshalAny(t, &v3rbacpb.RBAC_AuditLoggingOptions{}),
},
},
expectedError: "custom config not implemented for type ",
Expand Down
14 changes: 7 additions & 7 deletions test/xds/xds_client_custom_lb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ import (
// wrrLocality is a helper that takes a proto message and returns a
// WrrLocalityProto with the proto message marshaled into a proto.Any as a
// child.
func wrrLocality(m proto.Message) *v3wrrlocalitypb.WrrLocality {
func wrrLocality(t *testing.T, m proto.Message) *v3wrrlocalitypb.WrrLocality {
return &v3wrrlocalitypb.WrrLocality{
EndpointPickingPolicy: &v3clusterpb.LoadBalancingPolicy{
Policies: []*v3clusterpb.LoadBalancingPolicy_Policy{
{
TypedExtensionConfig: &v3corepb.TypedExtensionConfig{
TypedConfig: testutils.MarshalAny(m),
TypedConfig: testutils.MarshalAny(t, m),
},
},
},
Expand All @@ -78,7 +78,7 @@ func clusterWithLBConfiguration(clusterName, edsServiceName string, secLevel e2e
Policies: []*v3clusterpb.LoadBalancingPolicy_Policy{
{
TypedExtensionConfig: &v3corepb.TypedExtensionConfig{
TypedConfig: testutils.MarshalAny(m),
TypedConfig: testutils.MarshalAny(&testing.T{}, m),
},
},
},
Expand Down Expand Up @@ -132,7 +132,7 @@ func (s) TestWrrLocality(t *testing.T) {
}{
{
name: "rr_child",
wrrLocalityConfiguration: wrrLocality(&v3roundrobinpb.RoundRobin{}),
wrrLocalityConfiguration: wrrLocality(t, &v3roundrobinpb.RoundRobin{}),
// Each addresses expected probability is locality weight of
// locality / total locality weights multiplied by 1 / number of
// endpoints in each locality (due to round robin across endpoints
Expand All @@ -157,7 +157,7 @@ func (s) TestWrrLocality(t *testing.T) {
// (e.g. Address 1 for locality 1, and Address 3 for locality 2).
{
name: "custom_lb_child_pick_first",
wrrLocalityConfiguration: wrrLocality(&v3xdsxdstypepb.TypedStruct{
wrrLocalityConfiguration: wrrLocality(t, &v3xdsxdstypepb.TypedStruct{
TypeUrl: "type.googleapis.com/pick_first",
Value: &structpb.Struct{},
}),
Expand All @@ -178,7 +178,7 @@ func (s) TestWrrLocality(t *testing.T) {
// above.
{
name: "custom_lb_child_wrr/",
wrrLocalityConfiguration: wrrLocality(&v3clientsideweightedroundrobinpb.ClientSideWeightedRoundRobin{
wrrLocalityConfiguration: wrrLocality(t, &v3clientsideweightedroundrobinpb.ClientSideWeightedRoundRobin{
EnableOobLoadReport: &wrapperspb.BoolValue{
Value: false,
},
Expand All @@ -203,7 +203,7 @@ func (s) TestWrrLocality(t *testing.T) {
},
{
name: "custom_lb_least_request",
wrrLocalityConfiguration: wrrLocality(&v3leastrequestpb.LeastRequest{
wrrLocalityConfiguration: wrrLocality(t, &v3leastrequestpb.LeastRequest{
ChoiceCount: wrapperspb.UInt32(2),
}),
// The test performs a Unary RPC, and blocks until the RPC returns,
Expand Down
6 changes: 3 additions & 3 deletions test/xds/xds_rls_clusterspecifier_plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import (

// defaultClientResourcesWithRLSCSP returns a set of resources (LDS, RDS, CDS, EDS) for a
// client to connect to a server with a RLS Load Balancer as a child of Cluster Manager.
func defaultClientResourcesWithRLSCSP(lb e2e.LoadBalancingPolicy, params e2e.ResourceParams, rlsProto *rlspb.RouteLookupConfig) e2e.UpdateOptions {
func defaultClientResourcesWithRLSCSP(t *testing.T, lb e2e.LoadBalancingPolicy, params e2e.ResourceParams, rlsProto *rlspb.RouteLookupConfig) e2e.UpdateOptions {
routeConfigName := "route-" + params.DialTarget
clusterName := "cluster-" + params.DialTarget
endpointsName := "endpoints-" + params.DialTarget
Expand All @@ -58,7 +58,7 @@ func defaultClientResourcesWithRLSCSP(lb e2e.LoadBalancingPolicy, params e2e.Res
ListenerName: params.DialTarget,
ClusterSpecifierType: e2e.RouteConfigClusterSpecifierTypeClusterSpecifierPlugin,
ClusterSpecifierPluginName: "rls-csp",
ClusterSpecifierPluginConfig: testutils.MarshalAny(&rlspb.RouteLookupClusterSpecifier{
ClusterSpecifierPluginConfig: testutils.MarshalAny(t, &rlspb.RouteLookupClusterSpecifier{
RouteLookupConfig: rlsProto,
}),
})},
Expand Down Expand Up @@ -127,7 +127,7 @@ func testRLSinxDS(t *testing.T, lbPolicy e2e.LoadBalancingPolicy) {
}

const serviceName = "my-service-client-side-xds"
resources := defaultClientResourcesWithRLSCSP(lbPolicy, e2e.ResourceParams{
resources := defaultClientResourcesWithRLSCSP(t, lbPolicy, e2e.ResourceParams{
DialTarget: serviceName,
NodeID: nodeID,
Host: "localhost",
Expand Down
16 changes: 8 additions & 8 deletions test/xds/xds_security_config_nack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (s) TestUnmarshalListener_WithUpdateValidatorFunc(t *testing.T) {
securityConfig: &v3corepb.TransportSocket{
Name: "envoy.transport_sockets.tls",
ConfigType: &v3corepb.TransportSocket_TypedConfig{
TypedConfig: testutils.MarshalAny(&v3tlspb.DownstreamTlsContext{
TypedConfig: testutils.MarshalAny(t, &v3tlspb.DownstreamTlsContext{
CommonTlsContext: &v3tlspb.CommonTlsContext{
TlsCertificateProviderInstance: &v3tlspb.CertificateProviderPluginInstance{
InstanceName: missingIdentityProviderInstance,
Expand All @@ -76,7 +76,7 @@ func (s) TestUnmarshalListener_WithUpdateValidatorFunc(t *testing.T) {
securityConfig: &v3corepb.TransportSocket{
Name: "envoy.transport_sockets.tls",
ConfigType: &v3corepb.TransportSocket_TypedConfig{
TypedConfig: testutils.MarshalAny(&v3tlspb.DownstreamTlsContext{
TypedConfig: testutils.MarshalAny(t, &v3tlspb.DownstreamTlsContext{
CommonTlsContext: &v3tlspb.CommonTlsContext{
TlsCertificateProviderInstance: &v3tlspb.CertificateProviderPluginInstance{
InstanceName: missingIdentityProviderInstance,
Expand All @@ -99,7 +99,7 @@ func (s) TestUnmarshalListener_WithUpdateValidatorFunc(t *testing.T) {
securityConfig: &v3corepb.TransportSocket{
Name: "envoy.transport_sockets.tls",
ConfigType: &v3corepb.TransportSocket_TypedConfig{
TypedConfig: testutils.MarshalAny(&v3tlspb.DownstreamTlsContext{
TypedConfig: testutils.MarshalAny(t, &v3tlspb.DownstreamTlsContext{
CommonTlsContext: &v3tlspb.CommonTlsContext{
TlsCertificateProviderInstance: &v3tlspb.CertificateProviderPluginInstance{
InstanceName: e2e.ServerSideCertProviderInstance,
Expand All @@ -122,7 +122,7 @@ func (s) TestUnmarshalListener_WithUpdateValidatorFunc(t *testing.T) {
securityConfig: &v3corepb.TransportSocket{
Name: "envoy.transport_sockets.tls",
ConfigType: &v3corepb.TransportSocket_TypedConfig{
TypedConfig: testutils.MarshalAny(&v3tlspb.DownstreamTlsContext{
TypedConfig: testutils.MarshalAny(t, &v3tlspb.DownstreamTlsContext{
CommonTlsContext: &v3tlspb.CommonTlsContext{
TlsCertificateProviderInstance: &v3tlspb.CertificateProviderPluginInstance{
InstanceName: e2e.ServerSideCertProviderInstance,
Expand Down Expand Up @@ -227,7 +227,7 @@ func (s) TestUnmarshalCluster_WithUpdateValidatorFunc(t *testing.T) {
securityConfig: &v3corepb.TransportSocket{
Name: "envoy.transport_sockets.tls",
ConfigType: &v3corepb.TransportSocket_TypedConfig{
TypedConfig: testutils.MarshalAny(&v3tlspb.UpstreamTlsContext{
TypedConfig: testutils.MarshalAny(t, &v3tlspb.UpstreamTlsContext{
CommonTlsContext: &v3tlspb.CommonTlsContext{
TlsCertificateProviderInstance: &v3tlspb.CertificateProviderPluginInstance{
InstanceName: missingIdentityProviderInstance,
Expand All @@ -250,7 +250,7 @@ func (s) TestUnmarshalCluster_WithUpdateValidatorFunc(t *testing.T) {
securityConfig: &v3corepb.TransportSocket{
Name: "envoy.transport_sockets.tls",
ConfigType: &v3corepb.TransportSocket_TypedConfig{
TypedConfig: testutils.MarshalAny(&v3tlspb.UpstreamTlsContext{
TypedConfig: testutils.MarshalAny(t, &v3tlspb.UpstreamTlsContext{
CommonTlsContext: &v3tlspb.CommonTlsContext{
TlsCertificateProviderInstance: &v3tlspb.CertificateProviderPluginInstance{
InstanceName: missingIdentityProviderInstance,
Expand All @@ -273,7 +273,7 @@ func (s) TestUnmarshalCluster_WithUpdateValidatorFunc(t *testing.T) {
securityConfig: &v3corepb.TransportSocket{
Name: "envoy.transport_sockets.tls",
ConfigType: &v3corepb.TransportSocket_TypedConfig{
TypedConfig: testutils.MarshalAny(&v3tlspb.UpstreamTlsContext{
TypedConfig: testutils.MarshalAny(t, &v3tlspb.UpstreamTlsContext{
CommonTlsContext: &v3tlspb.CommonTlsContext{
TlsCertificateProviderInstance: &v3tlspb.CertificateProviderPluginInstance{
InstanceName: e2e.ClientSideCertProviderInstance,
Expand All @@ -296,7 +296,7 @@ func (s) TestUnmarshalCluster_WithUpdateValidatorFunc(t *testing.T) {
securityConfig: &v3corepb.TransportSocket{
Name: "envoy.transport_sockets.tls",
ConfigType: &v3corepb.TransportSocket_TypedConfig{
TypedConfig: testutils.MarshalAny(&v3tlspb.UpstreamTlsContext{
TypedConfig: testutils.MarshalAny(t, &v3tlspb.UpstreamTlsContext{
CommonTlsContext: &v3tlspb.CommonTlsContext{
TlsCertificateProviderInstance: &v3tlspb.CertificateProviderPluginInstance{
InstanceName: e2e.ClientSideCertProviderInstance,
Expand Down
24 changes: 12 additions & 12 deletions test/xds/xds_server_rbac_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (s) TestServerSideXDS_RouteConfiguration(t *testing.T) {
{
Name: "filter-1",
ConfigType: &v3listenerpb.Filter_TypedConfig{
TypedConfig: testutils.MarshalAny(&v3httppb.HttpConnectionManager{
TypedConfig: testutils.MarshalAny(t, &v3httppb.HttpConnectionManager{
HttpFilters: []*v3httppb.HttpFilter{e2e.HTTPFilter("router", &v3routerpb.Router{})},
RouteSpecifier: &v3httppb.HttpConnectionManager_RouteConfig{
RouteConfig: &v3routepb.RouteConfiguration{
Expand Down Expand Up @@ -227,7 +227,7 @@ func (s) TestServerSideXDS_RouteConfiguration(t *testing.T) {
{
Name: "filter-1",
ConfigType: &v3listenerpb.Filter_TypedConfig{
TypedConfig: testutils.MarshalAny(&v3httppb.HttpConnectionManager{
TypedConfig: testutils.MarshalAny(t, &v3httppb.HttpConnectionManager{
HttpFilters: []*v3httppb.HttpFilter{e2e.HTTPFilter("router", &v3routerpb.Router{})},
RouteSpecifier: &v3httppb.HttpConnectionManager_RouteConfig{
RouteConfig: &v3routepb.RouteConfiguration{
Expand Down Expand Up @@ -299,7 +299,7 @@ func (s) TestServerSideXDS_RouteConfiguration(t *testing.T) {

// serverListenerWithRBACHTTPFilters returns an xds Listener resource with HTTP Filters defined in the HCM, and a route
// configuration that always matches to a route and a VH.
func serverListenerWithRBACHTTPFilters(host string, port uint32, rbacCfg *rpb.RBAC) *v3listenerpb.Listener {
func serverListenerWithRBACHTTPFilters(t *testing.T, host string, port uint32, rbacCfg *rpb.RBAC) *v3listenerpb.Listener {
// Rather than declare typed config inline, take a HCM proto and append the
// RBAC Filters to it.
hcm := &v3httppb.HttpConnectionManager{
Expand All @@ -317,7 +317,7 @@ func serverListenerWithRBACHTTPFilters(host string, port uint32, rbacCfg *rpb.RB
// This tests override parsing + building when RBAC Filter
// passed both normal and override config.
TypedPerFilterConfig: map[string]*anypb.Any{
"rbac": testutils.MarshalAny(&rpb.RBACPerRoute{Rbac: rbacCfg}),
"rbac": testutils.MarshalAny(t, &rpb.RBACPerRoute{Rbac: rbacCfg}),
},
}}},
},
Expand Down Expand Up @@ -364,7 +364,7 @@ func serverListenerWithRBACHTTPFilters(host string, port uint32, rbacCfg *rpb.RB
{
Name: "filter-1",
ConfigType: &v3listenerpb.Filter_TypedConfig{
TypedConfig: testutils.MarshalAny(hcm),
TypedConfig: testutils.MarshalAny(t, hcm),
},
},
},
Expand Down Expand Up @@ -394,7 +394,7 @@ func serverListenerWithRBACHTTPFilters(host string, port uint32, rbacCfg *rpb.RB
{
Name: "filter-1",
ConfigType: &v3listenerpb.Filter_TypedConfig{
TypedConfig: testutils.MarshalAny(hcm),
TypedConfig: testutils.MarshalAny(t, hcm),
},
},
},
Expand Down Expand Up @@ -656,7 +656,7 @@ func (s) TestRBACHTTPFilter(t *testing.T) {
Port: port,
SecLevel: e2e.SecurityLevelNone,
})
inboundLis := serverListenerWithRBACHTTPFilters(host, port, test.rbacCfg)
inboundLis := serverListenerWithRBACHTTPFilters(t, host, port, test.rbacCfg)
resources.Listeners = append(resources.Listeners, inboundLis)

ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
Expand Down Expand Up @@ -712,7 +712,7 @@ func (s) TestRBACHTTPFilter(t *testing.T) {
// serverListenerWithBadRouteConfiguration returns an xds Listener resource with
// a Route Configuration that will never successfully match in order to test
// RBAC Environment variable being toggled on and off.
func serverListenerWithBadRouteConfiguration(host string, port uint32) *v3listenerpb.Listener {
func serverListenerWithBadRouteConfiguration(t *testing.T, host string, port uint32) *v3listenerpb.Listener {
return &v3listenerpb.Listener{
Name: fmt.Sprintf(e2e.ServerListenerResourceNameTemplate, net.JoinHostPort(host, strconv.Itoa(int(port)))),
Address: &v3corepb.Address{
Expand Down Expand Up @@ -751,7 +751,7 @@ func serverListenerWithBadRouteConfiguration(host string, port uint32) *v3listen
{
Name: "filter-1",
ConfigType: &v3listenerpb.Filter_TypedConfig{
TypedConfig: testutils.MarshalAny(&v3httppb.HttpConnectionManager{
TypedConfig: testutils.MarshalAny(t, &v3httppb.HttpConnectionManager{
RouteSpecifier: &v3httppb.HttpConnectionManager_RouteConfig{
RouteConfig: &v3routepb.RouteConfiguration{
Name: "routeName",
Expand Down Expand Up @@ -799,7 +799,7 @@ func serverListenerWithBadRouteConfiguration(host string, port uint32) *v3listen
{
Name: "filter-1",
ConfigType: &v3listenerpb.Filter_TypedConfig{
TypedConfig: testutils.MarshalAny(&v3httppb.HttpConnectionManager{
TypedConfig: testutils.MarshalAny(t, &v3httppb.HttpConnectionManager{
RouteSpecifier: &v3httppb.HttpConnectionManager_RouteConfig{
RouteConfig: &v3routepb.RouteConfiguration{
Name: "routeName",
Expand Down Expand Up @@ -858,7 +858,7 @@ func (s) TestRBACToggledOn_WithBadRouteConfiguration(t *testing.T) {
// Since RBAC support is turned ON, all the RPC's should get denied with
// status code Unavailable due to not matching to a route of type Non
// Forwarding Action (Route Table not configured properly).
inboundLis := serverListenerWithBadRouteConfiguration(host, port)
inboundLis := serverListenerWithBadRouteConfiguration(t, host, port)
resources.Listeners = append(resources.Listeners, inboundLis)

ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
Expand Down Expand Up @@ -915,7 +915,7 @@ func (s) TestRBACToggledOff_WithBadRouteConfiguration(t *testing.T) {
// This bad route configuration shouldn't affect incoming RPC's from
// proceeding as normal, as the configuration shouldn't be parsed due to the
// RBAC Environment variable not being set to true.
inboundLis := serverListenerWithBadRouteConfiguration(host, port)
inboundLis := serverListenerWithBadRouteConfiguration(t, host, port)
resources.Listeners = append(resources.Listeners, inboundLis)

ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
Expand Down
Loading

0 comments on commit 130bc42

Please sign in to comment.