Skip to content

Commit 1ab369f

Browse files
committed
Update access_log_test.go
1 parent b3a0b8c commit 1ab369f

File tree

1 file changed

+0
-103
lines changed

1 file changed

+0
-103
lines changed

test/e2e/access_log_test.go

Lines changed: 0 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@ package e2e_test
22

33
import (
44
"context"
5-
"fmt"
65
"net/http"
76
"time"
87

9-
"github.com/solo-io/gloo/test/helpers"
108
"github.com/solo-io/gloo/test/testutils"
119

1210
"github.com/solo-io/gloo/test/gomega/matchers"
1311

1412
envoy_data_accesslog_v3 "github.com/envoyproxy/go-control-plane/envoy/data/accesslog/v3"
1513
v1 "github.com/solo-io/gloo/projects/gateway/pkg/api/v1"
16-
1714
"github.com/solo-io/gloo/test/e2e"
1815

1916
envoyals "github.com/envoyproxy/go-control-plane/envoy/service/accesslog/v3"
@@ -28,7 +25,6 @@ import (
2825

2926
gloov1 "github.com/solo-io/gloo/projects/gloo/pkg/api/v1"
3027
"github.com/solo-io/gloo/projects/gloo/pkg/api/v1/options/als"
31-
"github.com/solo-io/gloo/projects/gloo/pkg/api/v1/options/dynamic_forward_proxy"
3228
alsplugin "github.com/solo-io/gloo/projects/gloo/pkg/plugins/als"
3329
"github.com/solo-io/gloo/projects/gloo/pkg/translator"
3430
)
@@ -116,105 +112,6 @@ var _ = Describe("Access Log", func() {
116112

117113
})
118114

119-
FContext("Grpc with filter state objects", func() {
120-
121-
var (
122-
msgChan <-chan *envoy_data_accesslog_v3.HTTPAccessLogEntry
123-
)
124-
125-
BeforeEach(func() {
126-
msgChan = runAccessLog(testContext.Ctx(), testContext.EnvoyInstance().AccessLogPort)
127-
128-
gw := gwdefaults.DefaultGateway(writeNamespace)
129-
gw.Options = &gloov1.ListenerOptions{
130-
AccessLoggingService: &als.AccessLoggingService{
131-
AccessLog: []*als.AccessLog{
132-
{
133-
OutputDestination: &als.AccessLog_GrpcService{
134-
GrpcService: &als.GrpcService{
135-
LogName: "test-log",
136-
ServiceRef: &als.GrpcService_StaticClusterName{
137-
StaticClusterName: alsplugin.ClusterName,
138-
},
139-
FilterStateObjectsToLog: []string{
140-
"envoy.network.upstream_server_name",
141-
"envoy.network.application_protocols",
142-
"envoy.network.upstream_subject_alt_names",
143-
"envoy.tcp_proxy.cluster",
144-
"envoy.udp_proxy.cluster",
145-
"envoy.network.transport_socket.original_dst_address",
146-
"envoy.filters.listener.original_dst.local_ip",
147-
"envoy.filters.listener.original_dst.remote_ip",
148-
"envoy.upstream.dynamic_host",
149-
"envoy.upstream.dynamic_port",
150-
"envoy.tcp_proxy.disable_tunneling",
151-
"envoy.filters.network.http_connection_manager.local_reply_owner",
152-
"envoy.string",
153-
"envoy.tcp_proxy.per_connection_idle_timeout_ms",
154-
"envoy.ratelimit.hits_addend",
155-
},
156-
},
157-
},
158-
},
159-
},
160-
},
161-
}
162-
163-
// enable dynamic forward proxy to save upstream address in filter state
164-
gw.GetHttpGateway().Options = &gloov1.HttpListenerOptions{
165-
DynamicForwardProxy: &dynamic_forward_proxy.FilterConfig{
166-
SaveUpstreamAddress: true,
167-
}, // pick up system defaults to resolve DNS
168-
}
169-
170-
testContext.ResourcesToCreate().Gateways = v1.GatewayList{
171-
gw,
172-
}
173-
174-
vs := helpers.NewVirtualServiceBuilder().
175-
WithName(e2e.DefaultVirtualServiceName).
176-
WithNamespace(writeNamespace).
177-
WithDomain(e2e.DefaultHost).
178-
WithRoutePrefixMatcher(e2e.DefaultRouteName, "/").
179-
WithRouteAction(e2e.DefaultRouteName, &gloov1.RouteAction{
180-
Destination: &gloov1.RouteAction_DynamicForwardProxy{
181-
DynamicForwardProxy: &dynamic_forward_proxy.PerRouteConfig{
182-
HostRewriteSpecifier: &dynamic_forward_proxy.PerRouteConfig_AutoHostRewriteHeader{
183-
AutoHostRewriteHeader: "x-rewrite-me",
184-
},
185-
},
186-
},
187-
}).
188-
Build()
189-
190-
testContext.ResourcesToCreate().VirtualServices = v1.VirtualServiceList{
191-
vs,
192-
}
193-
})
194-
195-
It("can stream access logs with filter state objects", func() {
196-
requestBuilder := testContext.GetHttpRequestBuilder().
197-
WithPath("get").
198-
WithHeader("x-rewrite-me", "postman-echo.com")
199-
200-
Eventually(func(g Gomega) {
201-
g.Expect(testutils.DefaultHttpClient.Do(requestBuilder.Build())).Should(matchers.HaveHttpResponse(&matchers.HttpResponse{
202-
StatusCode: http.StatusOK,
203-
Body: ContainSubstring(`"host": "postman-echo.com"`),
204-
}))
205-
206-
var entry *envoy_data_accesslog_v3.HTTPAccessLogEntry
207-
g.Eventually(msgChan, 2*time.Second).Should(Receive(&entry))
208-
209-
fmt.Printf("entry.CommonProperties.UpstreamCluster: %s\n", entry.CommonProperties.UpstreamCluster)
210-
fmt.Printf("entry.CommonProperties.FilterStateObjects: %+v\n", entry.CommonProperties.FilterStateObjects)
211-
g.Expect(entry.CommonProperties.UpstreamCluster).To(Equal("solo_io_generated_dfp:13273938298451159843"))
212-
g.Expect(entry.CommonProperties.FilterStateObjects).To(ContainSubstring(`"upstream_remote_address":"10.244.0.1:80"`))
213-
}, time.Second*21, time.Second*2).Should(Succeed())
214-
})
215-
216-
})
217-
218115
Context("File", func() {
219116
var gw *v1.Gateway
220117
Context("String Format", func() {

0 commit comments

Comments
 (0)