From 4c3eda285319cf23274fad3f375e665fc34f92d0 Mon Sep 17 00:00:00 2001 From: "Huabing (Robin) Zhao" Date: Tue, 27 May 2025 03:08:16 +0000 Subject: [PATCH 1/2] dump config for flaky dynamic resover test Signed-off-by: Huabing (Robin) Zhao --- ...httproute_with_dynamic_resolver_backend.go | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/test/e2e/tests/httproute_with_dynamic_resolver_backend.go b/test/e2e/tests/httproute_with_dynamic_resolver_backend.go index ec4fca430d..b609877331 100644 --- a/test/e2e/tests/httproute_with_dynamic_resolver_backend.go +++ b/test/e2e/tests/httproute_with_dynamic_resolver_backend.go @@ -17,7 +17,7 @@ import ( ) func init() { - ConformanceTests = append(ConformanceTests, DynamicResolverBackendTest) + ConformanceTests = append(ConformanceTests, DynamicResolverBackendTest, DynamicResolverBackendWithTLSTest) } var DynamicResolverBackendTest = suite.ConformanceTest{ @@ -25,8 +25,6 @@ var DynamicResolverBackendTest = suite.ConformanceTest{ Description: "Routes with a backend ref to a dynamic resolver backend", Manifests: []string{ "testdata/httproute-with-dynamic-resolver-backend.yaml", - "testdata/httproute-with-dynamic-resolver-backend-with-tls.yaml", - "testdata/httproute-with-dynamic-resolver-backend-with-tls-system-ca.yaml", }, Test: func(t *testing.T, suite *suite.ConformanceTestSuite) { ns := "gateway-conformance-infra" @@ -63,6 +61,7 @@ var DynamicResolverBackendTest = suite.ConformanceTest{ http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, expectedResponse) }) + t.Run("route to external service with app protocol", func(t *testing.T) { routeNN := types.NamespacedName{Name: "httproute-with-dynamic-resolver-backend-with-app-protocol", Namespace: ns} gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN) @@ -85,6 +84,25 @@ var DynamicResolverBackendTest = suite.ConformanceTest{ http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, expectedResponse) }) + t.Cleanup(func() { + if t.Failed() { + CollectAndDump(t, suite.RestConfig) + } + }) + }, +} + +var DynamicResolverBackendWithTLSTest = suite.ConformanceTest{ + ShortName: "DynamicResolverBackendWithTLS", + Description: "Routes with a backend ref to a dynamic resolver backend", + Manifests: []string{ + "testdata/httproute-with-dynamic-resolver-backend-with-tls.yaml", + "testdata/httproute-with-dynamic-resolver-backend-with-tls-system-ca.yaml", + }, + Test: func(t *testing.T, suite *suite.ConformanceTestSuite) { + ns := "gateway-conformance-infra" + gwNN := types.NamespacedName{Name: "same-namespace", Namespace: ns} + t.Run("route to service with TLS", func(t *testing.T) { routeNN := types.NamespacedName{Name: "httproute-with-dynamic-resolver-backend-tls", Namespace: ns} gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName, kubernetes.NewGatewayRef(gwNN), routeNN) @@ -124,5 +142,10 @@ var DynamicResolverBackendTest = suite.ConformanceTest{ } http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, expectedResponse) }) + t.Cleanup(func() { + if t.Failed() { + CollectAndDump(t, suite.RestConfig) + } + }) }, } From a5b6b2b413215fa0676c849550293cc8b6b335aa Mon Sep 17 00:00:00 2001 From: "Huabing (Robin) Zhao" Date: Tue, 27 May 2025 06:29:23 +0000 Subject: [PATCH 2/2] skip for ipv6 Signed-off-by: Huabing (Robin) Zhao --- test/e2e/e2e_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index de792ddddb..230c683748 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -55,6 +55,7 @@ func TestE2E(t *testing.T) { if tests.IPFamily == "ipv6" { skipTests = append(skipTests, tests.DynamicResolverBackendTest.ShortName, + tests.DynamicResolverBackendWithTLSTest.ShortName, tests.RateLimitCIDRMatchTest.ShortName, tests.RateLimitMultipleListenersTest.ShortName, tests.RateLimitGlobalSharedCidrMatchTest.ShortName,