@@ -35,24 +35,25 @@ func init() {
3535var FileAccessLogTest = suite.ConformanceTest {
3636 ShortName : "FileAccessLog" ,
3737 Description : "Make sure file access log is working" ,
38- Manifests : []string {"testdata/accesslog.yaml" },
38+ Manifests : []string {"testdata/accesslog-file .yaml" },
3939 Test : func (t * testing.T , suite * suite.ConformanceTestSuite ) {
4040 t .Run ("Stdout" , func (t * testing.T ) {
4141 ns := "gateway-conformance-infra"
42- routeNN := types.NamespacedName {Name : "http-infra-backend-v1 " , Namespace : ns }
42+ routeNN := types.NamespacedName {Name : "accesslog-file " , Namespace : ns }
4343 gwNN := types.NamespacedName {Name : "same-namespace" , Namespace : ns }
4444 gwAddr := kubernetes .GatewayAndHTTPRoutesMustBeAccepted (t , suite .Client , suite .TimeoutConfig , suite .ControllerName , kubernetes .NewGatewayRef (gwNN ), routeNN )
4545
46- // make sure listener is ready
47- httputils .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr , httputils.ExpectedResponse {
46+ expectedResponse := httputils.ExpectedResponse {
4847 Request : httputils.Request {
49- Path : "/" ,
48+ Path : "/file " ,
5049 },
5150 Response : httputils.Response {
5251 StatusCode : 200 ,
5352 },
5453 Namespace : ns ,
55- })
54+ }
55+ // make sure listener is ready
56+ httputils .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr , expectedResponse )
5657
5758 labels := map [string ]string {
5859 "job" : "fluentbit" ,
@@ -90,15 +91,7 @@ var FileAccessLogTest = suite.ConformanceTest{
9091 return false , nil
9192 }
9293
93- httputils .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr , httputils.ExpectedResponse {
94- Request : httputils.Request {
95- Path : "/" ,
96- },
97- Response : httputils.Response {
98- StatusCode : 200 ,
99- },
100- Namespace : ns ,
101- })
94+ httputils .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr , expectedResponse )
10295
10396 // it will take some time for fluent-bit to collect the log and send to loki
10497 // let's wait for a while
@@ -133,24 +126,25 @@ var FileAccessLogTest = suite.ConformanceTest{
133126var OpenTelemetryTest = suite.ConformanceTest {
134127 ShortName : "OpenTelemetryAccessLog" ,
135128 Description : "Make sure OpenTelemetry access log is working" ,
136- Manifests : []string {"testdata/accesslog.yaml" },
129+ Manifests : []string {"testdata/accesslog-otel .yaml" },
137130 Test : func (t * testing.T , suite * suite.ConformanceTestSuite ) {
138131 t .Run ("OTel" , func (t * testing.T ) {
139132 ns := "gateway-conformance-infra"
140- routeNN := types.NamespacedName {Name : "http-infra-backend-v1 " , Namespace : ns }
133+ routeNN := types.NamespacedName {Name : "accesslog-otel " , Namespace : ns }
141134 gwNN := types.NamespacedName {Name : "same-namespace" , Namespace : ns }
142135 gwAddr := kubernetes .GatewayAndHTTPRoutesMustBeAccepted (t , suite .Client , suite .TimeoutConfig , suite .ControllerName , kubernetes .NewGatewayRef (gwNN ), routeNN )
143136
144- // make sure listener is ready
145- httputils .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr , httputils.ExpectedResponse {
137+ expectedResponse := httputils.ExpectedResponse {
146138 Request : httputils.Request {
147- Path : "/" ,
139+ Path : "/otel " ,
148140 },
149141 Response : httputils.Response {
150142 StatusCode : 200 ,
151143 },
152144 Namespace : ns ,
153- })
145+ }
146+ // make sure listener is ready
147+ httputils .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr , expectedResponse )
154148
155149 labels := map [string ]string {
156150 "k8s_namespace_name" : "envoy-gateway-system" ,
@@ -167,15 +161,7 @@ var OpenTelemetryTest = suite.ConformanceTest{
167161 return false , nil
168162 }
169163
170- httputils .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr , httputils.ExpectedResponse {
171- Request : httputils.Request {
172- Path : "/" ,
173- },
174- Response : httputils.Response {
175- StatusCode : 200 ,
176- },
177- Namespace : ns ,
178- })
164+ httputils .MakeRequestAndExpectEventuallyConsistentResponse (t , suite .RoundTripper , suite .TimeoutConfig , gwAddr , expectedResponse )
179165
180166 if err := wait .PollUntilContextTimeout (ctx , 500 * time .Millisecond , 10 * time .Second , true , func (_ context.Context ) (bool , error ) {
181167 count , err := QueryLogCountFromLoki (t , suite .Client , types.NamespacedName {
0 commit comments