From cfe4226fa93c7b4694a042dd6ff3c6a54f005541 Mon Sep 17 00:00:00 2001 From: Waleed Malik Date: Fri, 6 Jan 2023 12:20:34 +0500 Subject: [PATCH] Test Signed-off-by: Waleed Malik --- test/e2e/provisioning/all_e2e_test.go | 37 +++++++++++++++++---------- test/e2e/provisioning/helper.go | 6 ++--- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/test/e2e/provisioning/all_e2e_test.go b/test/e2e/provisioning/all_e2e_test.go index 7fb04ac39..2759dfe2a 100644 --- a/test/e2e/provisioning/all_e2e_test.go +++ b/test/e2e/provisioning/all_e2e_test.go @@ -80,7 +80,10 @@ const ( nutanixManifest = "./testdata/machinedeployment-nutanix.yaml" ) -const defaultKubernetesVersion = "1.24.9" +const ( + defaultKubernetesVersion = "1.24.9" + defaultContainerRuntime = "containerd" +) var testRunIdentifier = flag.String("identifier", "local", "The unique identifier for this test run") @@ -135,7 +138,7 @@ func TestCustomCAsAreApplied(t *testing.T) { t, scenario{ name: "ca-test", - containerRuntime: "docker", + containerRuntime: defaultContainerRuntime, kubernetesVersion: versions[0].String(), osName: string(providerconfigtypes.OperatingSystemUbuntu), @@ -370,7 +373,7 @@ func TestOpenstackProjectAuthProvisioningE2E(t *testing.T) { scenario := scenario{ name: "MachineDeploy with project auth vars", osName: "ubuntu", - containerRuntime: "containerd", + containerRuntime: defaultContainerRuntime, kubernetesVersion: defaultKubernetesVersion, executor: verifyCreateAndDelete, } @@ -415,7 +418,9 @@ func TestAWSProvisioningE2E(t *testing.T) { t.Fatal("unable to run the test suite, AWS_E2E_TESTS_KEY_ID or AWS_E2E_TESTS_SECRET environment variables cannot be empty") } - selector := Not(OsSelector("sles")) + // TODO(Waleed): fix this + // selector := Not(OsSelector("sles")) + selector := OsSelector("amzn2") // act params := []string{fmt.Sprintf("<< AWS_ACCESS_KEY_ID >>=%s", awsKeyID), @@ -449,7 +454,7 @@ func TestAWSAssumeRoleProvisioningE2E(t *testing.T) { scenario := scenario{ name: "AWS with AssumeRole", osName: "ubuntu", - containerRuntime: "docker", + containerRuntime: defaultContainerRuntime, kubernetesVersion: defaultKubernetesVersion, executor: verifyCreateAndDelete, } @@ -457,7 +462,7 @@ func TestAWSAssumeRoleProvisioningE2E(t *testing.T) { } // TestAWSSpotInstanceProvisioning - a test suite that exercises AWS provider -// by requesting spot nodes with different combination of container runtime type, container runtime version and the OS flavour. +// by requesting spot nodes with different combination of container runtime type, container runtime version. func TestAWSSpotInstanceProvisioningE2E(t *testing.T) { t.Parallel() @@ -467,7 +472,8 @@ func TestAWSSpotInstanceProvisioningE2E(t *testing.T) { if len(awsKeyID) == 0 || len(awsSecret) == 0 { t.Fatal("unable to run the test suite, AWS_E2E_TESTS_KEY_ID or AWS_E2E_TESTS_SECRET environment variables cannot be empty") } - selector := Not(OsSelector("sles")) + // Since we are only testing the spot instance functionality, testing it against a single OS is sufficient. + selector := OsSelector("ubuntu") // act params := []string{fmt.Sprintf("<< AWS_ACCESS_KEY_ID >>=%s", awsKeyID), fmt.Sprintf("<< AWS_SECRET_ACCESS_KEY >>=%s", awsSecret), @@ -558,7 +564,7 @@ func TestAWSFlatcarContainerdProvisioningE2E(t *testing.T) { scenario := scenario{ name: "flatcar with containerd in AWS", osName: "flatcar", - containerRuntime: "containerd", + containerRuntime: defaultContainerRuntime, kubernetesVersion: defaultKubernetesVersion, executor: verifyCreateAndDelete, } @@ -608,7 +614,7 @@ func TestAWSEbsEncryptionEnabledProvisioningE2E(t *testing.T) { scenario := scenario{ name: "AWS with ebs encryption enabled", osName: "ubuntu", - containerRuntime: "containerd", + containerRuntime: defaultContainerRuntime, kubernetesVersion: defaultKubernetesVersion, executor: verifyCreateAndDelete, } @@ -629,7 +635,10 @@ func TestAzureProvisioningE2E(t *testing.T) { t.Fatal("unable to run the test suite, AZURE_TENANT_ID, AZURE_SUBSCRIPTION_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET environment variables cannot be empty") } - selector := Not(OsSelector("sles", "amzn2")) + // TODO(Waleed): fix this + // selector := Not(OsSelector("sles", "amzn2")) + selector := OsSelector("flatcar") + // act params := []string{ fmt.Sprintf("<< AZURE_TENANT_ID >>=%s", azureTenantID), @@ -697,7 +706,7 @@ func TestAzureRedhatSatelliteProvisioningE2E(t *testing.T) { scenario := scenario{ name: "Azure redhat satellite server subscription", osName: "rhel", - containerRuntime: "docker", + containerRuntime: defaultContainerRuntime, kubernetesVersion: defaultKubernetesVersion, executor: verifyCreateAndDelete, } @@ -898,7 +907,7 @@ func TestVsphereResourcePoolProvisioningE2E(t *testing.T) { scenario := scenario{ name: "vSphere resource pool provisioning", osName: "flatcar", - containerRuntime: "docker", + containerRuntime: defaultContainerRuntime, kubernetesVersion: defaultKubernetesVersion, executor: verifyCreateAndDelete, } @@ -1010,7 +1019,7 @@ func TestUbuntuProvisioningWithUpgradeE2E(t *testing.T) { scenario := scenario{ name: "Ubuntu upgrade", osName: "ubuntu", - containerRuntime: "docker", + containerRuntime: defaultContainerRuntime, kubernetesVersion: defaultKubernetesVersion, executor: verifyCreateAndDelete, } @@ -1035,7 +1044,7 @@ func TestDeploymentControllerUpgradesMachineE2E(t *testing.T) { scenario := scenario{ name: "MachineDeployment upgrade", osName: "ubuntu", - containerRuntime: "docker", + containerRuntime: defaultContainerRuntime, kubernetesVersion: defaultKubernetesVersion, executor: verifyCreateUpdateAndDelete, } diff --git a/test/e2e/provisioning/helper.go b/test/e2e/provisioning/helper.go index 91c441000..180e6f90b 100644 --- a/test/e2e/provisioning/helper.go +++ b/test/e2e/provisioning/helper.go @@ -33,8 +33,8 @@ var ( scenarios = buildScenarios() versions = []*semver.Version{ - semver.MustParse("v1.24.9"), - semver.MustParse("v1.25.5"), + // semver.MustParse("v1.24.9"), + // semver.MustParse("v1.25.5"), semver.MustParse("v1.26.0"), } @@ -279,7 +279,7 @@ func buildScenarios() []scenario { for _, operatingSystem := range operatingSystems { s := scenario{ name: fmt.Sprintf("%s-%s", operatingSystem, version), - containerRuntime: "docker", + containerRuntime: "containerd", kubernetesVersion: version.String(), osName: string(operatingSystem), executor: verifyCreateAndDelete,