From 0b7169805a74ef164df5d567b442a1c4b188ac02 Mon Sep 17 00:00:00 2001 From: Gong Zhang Date: Fri, 24 May 2024 15:01:05 +0800 Subject: [PATCH] Fill up supervisor e2e test - Enable test "When testing clusterctl upgrades using ClusterClass" Signed-off-by: Gong Zhang --- test/e2e/clusterctl_upgrade_test.go | 8 ++++---- test/e2e/e2e_setup_test.go | 15 +++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/test/e2e/clusterctl_upgrade_test.go b/test/e2e/clusterctl_upgrade_test.go index 3eb463eea5..f31efd732e 100644 --- a/test/e2e/clusterctl_upgrade_test.go +++ b/test/e2e/clusterctl_upgrade_test.go @@ -37,7 +37,7 @@ var ( capvReleaseMarkerPrefix = "go://sigs.k8s.io/cluster-api-provider-vsphere@v%s" ) -var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10=>current, CAPI 1.7=>1.7) [ClusterClass]", func() { +var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10=>current, CAPI 1.7=>1.7) [supervisor] [ClusterClass]", func() { const specName = "clusterctl-upgrade-1.10-current" // prefix (clusterctl-upgrade) copied from CAPI Setup(specName, func(testSpecificSettingsGetter func() testSettings) { capi_e2e.ClusterctlUpgradeSpec(ctx, func() capi_e2e.ClusterctlUpgradeSpecInput { @@ -61,7 +61,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10 InitWithBootstrapProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)}, InitWithControlPlaneProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)}, InitWithInfrastructureProviders: []string{fmt.Sprintf(providerVSpherePrefix, capvStableRelease)}, - InitWithRuntimeExtensionProviders: []string{}, + InitWithRuntimeExtensionProviders: testSpecificSettingsGetter().RuntimeExtensionProviders, InitWithIPAMProviders: []string{}, // InitWithKubernetesVersion should be the highest kubernetes version supported by the init Cluster API version. // This is to guarantee that both, the old and new CAPI version, support the defined version. @@ -75,7 +75,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.10 }, WithIP("WORKLOAD_CONTROL_PLANE_ENDPOINT_IP")) }) -var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.9=>current, CAPI 1.6=>1.7) [ClusterClass]", func() { +var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.9=>current, CAPI 1.6=>1.7) [supervisor] [ClusterClass]", func() { const specName = "clusterctl-upgrade-1.9-current" // prefix (clusterctl-upgrade) copied from CAPI Setup(specName, func(testSpecificSettingsGetter func() testSettings) { capi_e2e.ClusterctlUpgradeSpec(ctx, func() capi_e2e.ClusterctlUpgradeSpecInput { @@ -99,7 +99,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (CAPV 1.9= InitWithBootstrapProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)}, InitWithControlPlaneProviders: []string{fmt.Sprintf(providerKubeadmPrefix, capiStableRelease)}, InitWithInfrastructureProviders: []string{fmt.Sprintf(providerVSpherePrefix, capvStableRelease)}, - InitWithRuntimeExtensionProviders: []string{}, + InitWithRuntimeExtensionProviders: testSpecificSettingsGetter().RuntimeExtensionProviders, InitWithIPAMProviders: []string{}, // InitWithKubernetesVersion should be the highest kubernetes version supported by the init Cluster API version. // This is to guarantee that both, the old and new CAPI version, support the defined version. diff --git a/test/e2e/e2e_setup_test.go b/test/e2e/e2e_setup_test.go index 4276181c32..c4b58cefa9 100644 --- a/test/e2e/e2e_setup_test.go +++ b/test/e2e/e2e_setup_test.go @@ -74,10 +74,11 @@ func WithPrefix(variableName string) SetupOption { } type testSettings struct { - ClusterctlConfigPath string - Variables map[string]string - PostNamespaceCreatedFunc func(managementClusterProxy framework.ClusterProxy, workloadClusterNamespace string) - FlavorForMode func(flavor string) string + ClusterctlConfigPath string + Variables map[string]string + PostNamespaceCreatedFunc func(managementClusterProxy framework.ClusterProxy, workloadClusterNamespace string) + FlavorForMode func(flavor string) string + RuntimeExtensionProviders []string } // Setup for the specific test. @@ -92,6 +93,7 @@ func Setup(specName string, f func(testSpecificSettings func() testSettings), op testSpecificIPAddressClaims vsphereip.AddressClaims testSpecificVariables map[string]string postNamespaceCreatedFunc func(managementClusterProxy framework.ClusterProxy, workloadClusterNamespace string) + runtimeExtensionProviders []string ) BeforeEach(func() { Byf("Setting up test env for %s", specName) @@ -182,6 +184,10 @@ func Setup(specName string, f func(testSpecificSettings func() testSettings), op OutputPath: testSpecificClusterctlConfigPath, Variables: testSpecificVariables, }) + + if testMode == SupervisorTestMode { + runtimeExtensionProviders = []string{"vm-operator"} + } }) defer AfterEach(func() { Byf("Cleaning up test env for %s", specName) @@ -214,6 +220,7 @@ func Setup(specName string, f func(testSpecificSettings func() testSettings), op } return flavor }, + RuntimeExtensionProviders: runtimeExtensionProviders, } }) }