Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
adding comments
Browse files Browse the repository at this point in the history
Signed-off-by: Sneha Chhabria <snchh@microsoft.com>
  • Loading branch information
snehachhabria committed Jan 22, 2021
1 parent cf18b46 commit 30b2672
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/envoy/lds/response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func TestListenerConfiguration(t *testing.T) {
actual, err := NewResponse(meshCatalog, proxy, nil, mockConfigurator, nil)
assert.Empty(err)
assert.NotNil(actual)
// There are 3 listeners configured based on the configuration:
// 1. Outbound listener (outbound-listener)
// 2. inbound listener (inbound-listener)
// 3. Prometheus listener (inbound-prometheus-listener)
assert.Len(actual.Resources, 3)

listener := xds_listener.Listener{}
Expand All @@ -73,6 +77,10 @@ func TestListenerConfiguration(t *testing.T) {
assert.Len(listener.ListenerFilters, 1)
assert.Equal(listener.ListenerFilters[0].Name, wellknown.OriginalDestination)
assert.NotNil(listener.FilterChains)
// There are 3 filter chains configured on the outbound-listner based on the configuration:
// 1. Filter chanin for bookstore-v1
// 2. Filter chanin for bookstore-v2
// 3. Egress filter chain
assert.Len(listener.FilterChains, 3)
assert.NotNil(listener.DefaultFilterChain)
assert.Equal(listener.DefaultFilterChain.Name, outboundEgressFilterChainName)
Expand All @@ -87,6 +95,8 @@ func TestListenerConfiguration(t *testing.T) {
assert.Equal(listener.ListenerFilters[0].Name, wellknown.TlsInspector)
assert.Equal(listener.ListenerFilters[1].Name, wellknown.OriginalDestination)
assert.NotNil(listener.FilterChains)
// There is 1 filter chains configured on the inbound-listner based on the configuration:
// 1. Filter chanin for bookbuyer
assert.Len(listener.FilterChains, 1)

// validating prometheus listener
Expand Down

0 comments on commit 30b2672

Please sign in to comment.