diff --git a/test/e2e/SKIPPED_TESTS.yaml b/test/e2e/SKIPPED_TESTS.yaml index cf183bd73ba5..75d398e9b0d5 100644 --- a/test/e2e/SKIPPED_TESTS.yaml +++ b/test/e2e/SKIPPED_TESTS.yaml @@ -81,6 +81,11 @@ skipped_tests: - TestTinkerbellKubernetes125UbuntuWorkerNodeScaleUpWithAPI - TestTinkerbellKubernetes125UbuntuAddWorkerNodeGroupWithAPI - TestTinkerbellSingleNode125ManagementScaleupWorkloadWithAPI +#Skip single K8s version upgrade tests as the same is covered by multiple K8s version upgrade from 1.25 to 1.29 to save on hardware resources and running time +- TestTinkerbellKubernetes125UbuntuTo126Upgrade +- TestTinkerbellKubernetes126UbuntuTo127Upgrade +- TestTinkerbellKubernetes127UbuntuTo128Upgrade +- TestTinkerbellKubernetes128UbuntuTo129Upgrade # Tinkerbell Packages # Skip test cases for packages other than hello-eks-anywhere and not for K 1.28. - TestTinkerbellKubernetes126UbuntuSingleNodeCuratedPackagesEmissaryFlow diff --git a/test/e2e/TINKERBELL_HARDWARE_COUNT.yaml b/test/e2e/TINKERBELL_HARDWARE_COUNT.yaml index 4cae24499de4..ec5a7b189bdf 100644 --- a/test/e2e/TINKERBELL_HARDWARE_COUNT.yaml +++ b/test/e2e/TINKERBELL_HARDWARE_COUNT.yaml @@ -126,4 +126,5 @@ TestTinkerbellKubernetes125UbuntuTo126SingleNodeInPlaceUpgrade: 1 TestTinkerbellKubernetes126UbuntuTo127SingleNodeInPlaceUpgrade: 1 TestTinkerbellKubernetes127UbuntuTo128SingleNodeInPlaceUpgrade: 1 TestTinkerbellKubernetes128UbuntuTo129SingleNodeInPlaceUpgrade: 1 -TestTinkerbellKubernetes128UpgradeManagementComponents: 2 \ No newline at end of file +TestTinkerbellKubernetes128UpgradeManagementComponents: 2 +TestTinkerbellKubernetes125UbuntuTo129MultipleUpgrade: 4 \ No newline at end of file diff --git a/test/e2e/tinkerbell_test.go b/test/e2e/tinkerbell_test.go index ba209136228e..99cc9281942f 100644 --- a/test/e2e/tinkerbell_test.go +++ b/test/e2e/tinkerbell_test.go @@ -1649,3 +1649,61 @@ func TestTinkerbellKubernetes128UpgradeManagementComponents(t *testing.T) { test.RunEKSA([]string{"upgrade", "management-components", "-f", test.ClusterConfigLocation, "-v", "99"}) test.DeleteCluster() } + +// TestTinkerbellKubernetes125UbuntuTo129MultipleUpgrade creates a single 1.25 cluster and upgrades it +// all the way until 1.29. This tests each K8s version upgrade in a single test and saves up +// hardware which would otherwise be needed for each test as part of both create and upgrade. +func TestTinkerbellKubernetes125UbuntuTo129MultipleUpgrade(t *testing.T) { + var kube126clusterOpts []framework.ClusterE2ETestOpt + var kube127clusterOpts []framework.ClusterE2ETestOpt + var kube128clusterOpts []framework.ClusterE2ETestOpt + var kube129clusterOpts []framework.ClusterE2ETestOpt + provider := framework.NewTinkerbell(t, framework.WithUbuntu125Tinkerbell()) + test := framework.NewClusterE2ETest( + t, + provider, + framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube125)), + framework.WithClusterFiller(api.WithControlPlaneCount(1)), + framework.WithClusterFiller(api.WithWorkerNodeCount(1)), + framework.WithControlPlaneHardware(2), + framework.WithWorkerHardware(2), + ).WithClusterConfig( + provider.WithKubeVersionAndOS(v1alpha1.Kube125, framework.Ubuntu2004, nil), + ) + + kube126clusterOpts = append( + kube126clusterOpts, + framework.WithClusterUpgrade( + api.WithKubernetesVersion(v1alpha1.Kube126), + ), + provider.WithProviderUpgrade(framework.Ubuntu126Image()), + ) + kube127clusterOpts = append( + kube127clusterOpts, + framework.WithClusterUpgrade( + api.WithKubernetesVersion(v1alpha1.Kube127), + ), + provider.WithProviderUpgrade(framework.Ubuntu127Image()), + ) + kube128clusterOpts = append( + kube128clusterOpts, + framework.WithClusterUpgrade( + api.WithKubernetesVersion(v1alpha1.Kube128), + ), + provider.WithProviderUpgrade(framework.Ubuntu128Image()), + ) + kube129clusterOpts = append( + kube129clusterOpts, + framework.WithClusterUpgrade( + api.WithKubernetesVersion(v1alpha1.Kube129), + ), + provider.WithProviderUpgrade(framework.Ubuntu129Image()), + ) + runMultipleUpgradesFlowForBareMetal( + test, + kube126clusterOpts, + kube127clusterOpts, + kube128clusterOpts, + kube129clusterOpts, + ) +} diff --git a/test/e2e/upgrade.go b/test/e2e/upgrade.go index 4b02142a1ac4..30288d2e6b91 100644 --- a/test/e2e/upgrade.go +++ b/test/e2e/upgrade.go @@ -93,6 +93,19 @@ func runInPlaceUpgradeFlowForBareMetal(test *framework.ClusterE2ETest, clusterOp test.ValidateHardwareDecommissioned() } +func runMultipleUpgradesFlowForBareMetal(test *framework.ClusterE2ETest, clusterOpts ...[]framework.ClusterE2ETestOpt) { + test.GenerateHardwareConfig() + test.CreateCluster(framework.WithControlPlaneWaitTimeout("20m")) + for _, opts := range clusterOpts { + test.UpgradeClusterWithNewConfig(opts) + test.GenerateSupportBundleOnCleanupIfTestFailed() + test.ValidateClusterState() + test.StopIfFailed() + } + test.DeleteCluster() + test.ValidateHardwareDecommissioned() +} + // runSimpleUpgradeFlowForBaremetalWithoutClusterConfigGeneration runs the Create, Upgrade and Delete cluster flows // for Baremetal that use the cluster config generated by the WithClusterConfig method when the test object is created, // and avoids regenerating a cluster config with defaults.