Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
easwars committed Oct 12, 2023
1 parent 4f052c8 commit 9f50b09
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions xds/internal/server/listener_wrapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"time"

"github.com/envoyproxy/go-control-plane/pkg/wellknown"
"google.golang.org/grpc/internal/envconfig"
"google.golang.org/grpc/internal/grpctest"
"google.golang.org/grpc/internal/testutils"
"google.golang.org/grpc/internal/testutils/xds/e2e"
Expand Down Expand Up @@ -127,8 +126,10 @@ func createListenerWrapper(t *testing.T, xdsC XDSClient) (<-chan struct{}, strin
// - the management server returns a Listener resource that does not match the
// address to which our net.Listener is bound to. Test verifies that the
// listenerWrapper does not become ready.
// - the management server returns a Listener resource that contains an inline
// Route Configuration. Test verifies that the listenerWrapper becomes ready.
// - the management server returns a Listener resource that that matches the
// address to which our net.Listener is bound to. Also, it contains an
// inline Route Configuration. Test verifies that the listenerWrapper
// becomes ready.
func (s) TestListenerWrapper_InlineRouteConfig(t *testing.T) {
mgmtServer, nodeID, ldsResourceNamesCh, _, xdsC := xdsSetupFoTests(t)
readyCh, host, port, lisResourceName := createListenerWrapper(t, xdsC)
Expand Down Expand Up @@ -171,8 +172,10 @@ func (s) TestListenerWrapper_InlineRouteConfig(t *testing.T) {
case <-sCtx.Done():
}

// Configure the management server with a good update that does not contain
// any rds names that need reolution.
// Configure the management server with a Listener resource that contains
// the expected host and port. Also, it does not contain any rds names that
// need reolution. Therefore the listenerWrapper is expected to become
// ready.
resources.Listeners = []*v3listenerpb.Listener{e2e.DefaultServerListener(host, port, e2e.SecurityLevelNone, route1)}
if err := mgmtServer.Update(ctx, resources); err != nil {
t.Fatal(err)
Expand All @@ -192,12 +195,6 @@ func (s) TestListenerWrapper_InlineRouteConfig(t *testing.T) {
// when waiting for the Route Configuration resource and becomes ready once it
// receives the Route Configuration resource.
func (s) TestListenerWrapper_RouteNames(t *testing.T) {
oldRBAC := envconfig.XDSRBAC
envconfig.XDSRBAC = true
defer func() {
envconfig.XDSRBAC = oldRBAC
}()

mgmtServer, nodeID, ldsResourceNamesCh, rdsResourceNamesCh, xdsC := xdsSetupFoTests(t)
readyCh, host, port, lisResourceName := createListenerWrapper(t, xdsC)

Expand Down

0 comments on commit 9f50b09

Please sign in to comment.