diff --git a/pkg/tests/ossm-federation/__debug_bin3043052675 b/pkg/tests/ossm-federation/__debug_bin3043052675 new file mode 100755 index 00000000..b6fa645a Binary files /dev/null and b/pkg/tests/ossm-federation/__debug_bin3043052675 differ diff --git a/pkg/tests/ossm-federation/federation_common.go b/pkg/tests/ossm-federation/federation_common.go index 3a759433..96acb68c 100644 --- a/pkg/tests/ossm-federation/federation_common.go +++ b/pkg/tests/ossm-federation/federation_common.go @@ -40,7 +40,7 @@ type federationTest struct { west config east config - controlPlaneInstaller func(t TestHelper, ft federationTest) + controlPlaneInstaller func(t TestHelper, ft federationTest, ingressServiceType string) bookinfoInstaller func(t TestHelper, ft federationTest) checker func(t TestHelper, ft federationTest) } @@ -65,7 +65,12 @@ func (ft federationTest) run(t TestHelper) { ocEast.CreateNamespace(t, ft.east.smcpNamespace, ft.east.bookinfoNamespace) t.LogStep("Install control planes for west-mesh and east-mesh") - ft.controlPlaneInstaller(t, ft) + + ingressServiceType := "LoadBalancer" + if singleCluster { + ingressServiceType = "ClusterIP" + } + ft.controlPlaneInstaller(t, ft, ingressServiceType) t.LogStep("Wait for west-mesh and east-mesh installation to complete") ocWest.WaitSMCPReady(t, ft.west.smcpNamespace, ft.west.smcpName) @@ -155,10 +160,11 @@ func getRootCertificate(t TestHelper, c config) string { return data[key] } -func installSMCPandSMMR(t TestHelper, c config, smcpFile, smmrFile string) { +func installSMCPandSMMR(t TestHelper, c config, smcpFile, smmrFile string, ingressServiceType string) { t.Logf("Install ServiceMeshControlPlane %s in namespace %s", c.smcpName, c.smcpNamespace) c.oc.ApplyTemplateFile(t, c.smcpNamespace, smcpFile, map[string]string{ - "Version": env.GetSMCPVersion().String(), + "Version": env.GetSMCPVersion().String(), + "IngressServiceType": ingressServiceType, }) t.Log("Create ServiceMeshMemberRoll") diff --git a/pkg/tests/ossm-federation/federation_failover_test.go b/pkg/tests/ossm-federation/federation_failover_test.go index d0479988..3e35db17 100644 --- a/pkg/tests/ossm-federation/federation_failover_test.go +++ b/pkg/tests/ossm-federation/federation_failover_test.go @@ -68,9 +68,9 @@ func TestMultiClusterFederationFailover(t *testing.T) { region: eastRegion, zone: eastZone, }, - controlPlaneInstaller: func(t TestHelper, ft federationTest) { - installSMCPandSMMR(t, ft.west, ft.testdataPath+"/west-mesh/smcp.yaml", ft.testdataPath+"/west-mesh/smmr.yaml") - installSMCPandSMMR(t, ft.east, ft.testdataPath+"/east-mesh/smcp.yaml", ft.testdataPath+"/east-mesh/smmr.yaml") + controlPlaneInstaller: func(t TestHelper, ft federationTest, ingressServiceType string) { + installSMCPandSMMR(t, ft.west, ft.testdataPath+"/west-mesh/smcp.yaml", ft.testdataPath+"/west-mesh/smmr.yaml", ingressServiceType) + installSMCPandSMMR(t, ft.east, ft.testdataPath+"/east-mesh/smcp.yaml", ft.testdataPath+"/east-mesh/smmr.yaml", ingressServiceType) }, bookinfoInstaller: func(t TestHelper, ft federationTest) { t.LogStep("Install bookinfo in west-mesh") diff --git a/pkg/tests/ossm-federation/federation_traffic_splitting_test.go b/pkg/tests/ossm-federation/federation_traffic_splitting_test.go index a4b24a1f..20f90153 100644 --- a/pkg/tests/ossm-federation/federation_traffic_splitting_test.go +++ b/pkg/tests/ossm-federation/federation_traffic_splitting_test.go @@ -52,9 +52,9 @@ func TestFederation(t *testing.T) { smcpNamespace: "east-mesh-system", bookinfoNamespace: "east-mesh-bookinfo", }, - controlPlaneInstaller: func(t TestHelper, ft federationTest) { - installSMCPandSMMR(t, ft.west, ft.testdataPath+"/west-mesh/smcp.yaml", ft.testdataPath+"/west-mesh/smmr.yaml") - installSMCPandSMMR(t, ft.east, ft.testdataPath+"/east-mesh/smcp.yaml", ft.testdataPath+"/east-mesh/smmr.yaml") + controlPlaneInstaller: func(t TestHelper, ft federationTest, ingressServiceType string) { + installSMCPandSMMR(t, ft.west, ft.testdataPath+"/west-mesh/smcp.yaml", ft.testdataPath+"/west-mesh/smmr.yaml", ingressServiceType) + installSMCPandSMMR(t, ft.east, ft.testdataPath+"/east-mesh/smcp.yaml", ft.testdataPath+"/east-mesh/smmr.yaml", ingressServiceType) }, bookinfoInstaller: defaultBookinfoInstaller, checker: defaultChecker, @@ -80,7 +80,7 @@ func TestFederationDifferentCerts(t *testing.T) { smcpNamespace: "east-mesh-system", bookinfoNamespace: "east-mesh-bookinfo", }, - controlPlaneInstaller: func(t TestHelper, ft federationTest) { + controlPlaneInstaller: func(t TestHelper, ft federationTest, ingressServiceType string) { t.Log("Create Secret 'cacerts' for custom CA certs in west-mesh") ft.west.oc.CreateGenericSecretFromFiles(t, ft.west.smcpNamespace, "cacerts", "testdata/cacerts/ca-cert.pem", @@ -88,8 +88,8 @@ func TestFederationDifferentCerts(t *testing.T) { "testdata/cacerts/root-cert.pem", "testdata/cacerts/cert-chain.pem") - installSMCPandSMMR(t, ft.west, ft.testdataPath+"/west-mesh/smcp_custom_cert.yaml", ft.testdataPath+"/west-mesh/smmr.yaml") - installSMCPandSMMR(t, ft.east, ft.testdataPath+"/east-mesh/smcp.yaml", ft.testdataPath+"/east-mesh/smmr.yaml") + installSMCPandSMMR(t, ft.west, ft.testdataPath+"/west-mesh/smcp_custom_cert.yaml", ft.testdataPath+"/west-mesh/smmr.yaml", ingressServiceType) + installSMCPandSMMR(t, ft.east, ft.testdataPath+"/east-mesh/smcp.yaml", ft.testdataPath+"/east-mesh/smmr.yaml", ingressServiceType) }, bookinfoInstaller: defaultBookinfoInstaller, checker: defaultChecker, diff --git a/pkg/tests/ossm-federation/testdata/failover/east-mesh/smcp.yaml b/pkg/tests/ossm-federation/testdata/failover/east-mesh/smcp.yaml index 196ad6c6..f5c49718 100644 --- a/pkg/tests/ossm-federation/testdata/failover/east-mesh/smcp.yaml +++ b/pkg/tests/ossm-federation/testdata/failover/east-mesh/smcp.yaml @@ -61,7 +61,7 @@ spec: enabled: true routerMode: sni-dnat service: - type: LoadBalancer + type: {{ .IngressServiceType }} metadata: labels: # to prevent west-mesh-ingress's service from including default ingress pods diff --git a/pkg/tests/ossm-federation/testdata/failover/west-mesh/smcp.yaml b/pkg/tests/ossm-federation/testdata/failover/west-mesh/smcp.yaml index 898e0923..8b61530d 100644 --- a/pkg/tests/ossm-federation/testdata/failover/west-mesh/smcp.yaml +++ b/pkg/tests/ossm-federation/testdata/failover/west-mesh/smcp.yaml @@ -61,7 +61,7 @@ spec: enabled: true routerMode: sni-dnat service: - type: LoadBalancer + type: {{ .IngressServiceType }} metadata: labels: # to prevent east-mesh-ingress's service from including default ingress pods diff --git a/pkg/tests/ossm-federation/testdata/traffic-splitting/east-mesh/smcp.yaml b/pkg/tests/ossm-federation/testdata/traffic-splitting/east-mesh/smcp.yaml index 2545cf06..10b1b7b1 100644 --- a/pkg/tests/ossm-federation/testdata/traffic-splitting/east-mesh/smcp.yaml +++ b/pkg/tests/ossm-federation/testdata/traffic-splitting/east-mesh/smcp.yaml @@ -61,7 +61,7 @@ spec: enabled: true routerMode: sni-dnat service: - type: LoadBalancer + type: {{ .IngressServiceType }} metadata: labels: # to prevent west-mesh-ingress's service from including default ingress pods diff --git a/pkg/tests/ossm-federation/testdata/traffic-splitting/west-mesh/smcp.yaml b/pkg/tests/ossm-federation/testdata/traffic-splitting/west-mesh/smcp.yaml index 569625b5..fae3d790 100644 --- a/pkg/tests/ossm-federation/testdata/traffic-splitting/west-mesh/smcp.yaml +++ b/pkg/tests/ossm-federation/testdata/traffic-splitting/west-mesh/smcp.yaml @@ -65,7 +65,7 @@ spec: enabled: true routerMode: sni-dnat service: - type: LoadBalancer + type: {{ .IngressServiceType }} metadata: labels: # to prevent east-mesh-ingress's service from including default ingress pods diff --git a/pkg/tests/ossm-federation/testdata/traffic-splitting/west-mesh/smcp_custom_cert.yaml b/pkg/tests/ossm-federation/testdata/traffic-splitting/west-mesh/smcp_custom_cert.yaml index 9a3ef52d..d6b5dabe 100644 --- a/pkg/tests/ossm-federation/testdata/traffic-splitting/west-mesh/smcp_custom_cert.yaml +++ b/pkg/tests/ossm-federation/testdata/traffic-splitting/west-mesh/smcp_custom_cert.yaml @@ -61,7 +61,7 @@ spec: enabled: true routerMode: sni-dnat service: - type: LoadBalancer + type: {{ .IngressServiceType }} metadata: labels: # to prevent east-mesh-ingress's service from including default ingress pods