diff --git a/test/e2e/upgrade.go b/test/e2e/upgrade.go index 52ac59d9ef394..cc184b3e1e0c4 100644 --- a/test/e2e/upgrade.go +++ b/test/e2e/upgrade.go @@ -60,6 +60,18 @@ func runSimpleUpgradeFlowWorkerNodeVersionForBareMetal(test *framework.ClusterE2 test.ValidateHardwareDecommissioned() } +func runInPlaceMultipleUpgradesFlow(test *framework.ClusterE2ETest, clusterOpts, clusterOpts2, clusterOpts3 []framework.ClusterE2ETestOpt) { + test.CreateCluster() + test.UpgradeClusterWithNewConfig(clusterOpts) + test.ValidateClusterState() + test.UpgradeClusterWithNewConfig(clusterOpts2) + test.ValidateClusterState() + test.UpgradeClusterWithNewConfig(clusterOpts3) + test.ValidateClusterState() + test.StopIfFailed() + test.DeleteCluster() +} + // runInPlaceUpgradeFlow makes use of the new ValidateClusterState method instead of ValidateCluster, but we should incorporate this // in runSimpleUpgradeFlow itself. func runInPlaceUpgradeFlow(test *framework.ClusterE2ETest, clusterOpts ...framework.ClusterE2ETestOpt) { diff --git a/test/e2e/vsphere_test.go b/test/e2e/vsphere_test.go index 162672ebbbea5..dfcf5b5451dd9 100644 --- a/test/e2e/vsphere_test.go +++ b/test/e2e/vsphere_test.go @@ -3599,6 +3599,58 @@ func TestVSphereKubernetes128UbuntuTo129InPlaceUpgrade_3CP_3Worker(t *testing.T) ) } +func TestVSphereKubernetes125UbuntuTo128InPlaceUpgrade(t *testing.T) { + var kube126clusterOpts []framework.ClusterE2ETestOpt + var kube127clusterOpts []framework.ClusterE2ETestOpt + var kube128clusterOpts []framework.ClusterE2ETestOpt + provider := framework.NewVSphere(t, framework.WithUbuntu125()) + test := framework.NewClusterE2ETest( + t, + provider, + framework.WithEnvVar(features.VSphereInPlaceEnvVar, "true"), + ).WithClusterConfig( + api.ClusterToConfigFiller( + api.WithKubernetesVersion(v1alpha1.Kube125), + api.WithStackedEtcdTopology(), + api.WithInPlaceUpgradeStrategy(), + ), + api.VSphereToConfigFiller( + api.RemoveEtcdVsphereMachineConfig(), + ), + provider.WithKubeVersionAndOS(v1alpha1.Kube125, framework.Ubuntu2004, nil), + ) + kube126clusterOpts = append( + kube126clusterOpts, + framework.WithClusterUpgrade( + api.WithKubernetesVersion(v1alpha1.Kube126), + api.WithInPlaceUpgradeStrategy(), + ), + provider.WithProviderUpgrade(provider.Ubuntu126Template()), + ) + kube127clusterOpts = append( + kube127clusterOpts, + framework.WithClusterUpgrade( + api.WithKubernetesVersion(v1alpha1.Kube127), + api.WithInPlaceUpgradeStrategy(), + ), + provider.WithProviderUpgrade(provider.Ubuntu127Template()), + ) + kube128clusterOpts = append( + kube128clusterOpts, + framework.WithClusterUpgrade( + api.WithKubernetesVersion(v1alpha1.Kube128), + api.WithInPlaceUpgradeStrategy(), + ), + provider.WithProviderUpgrade(provider.Ubuntu128Template()), + ) + runInPlaceMultipleUpgradesFlow( + test, + kube126clusterOpts, + kube127clusterOpts, + kube128clusterOpts, + ) +} + func TestVSphereKubernetes128UbuntuInPlaceCPScaleUp1To3(t *testing.T) { provider := framework.NewVSphere(t, framework.WithUbuntu128()) test := framework.NewClusterE2ETest(