Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
Signed-off-by: Waleed Malik <[email protected]>
  • Loading branch information
ahmedwaleedmalik committed Jan 6, 2023
1 parent 106df22 commit cfe4226
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
37 changes: 23 additions & 14 deletions test/e2e/provisioning/all_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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),

Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -449,15 +454,15 @@ func TestAWSAssumeRoleProvisioningE2E(t *testing.T) {
scenario := scenario{
name: "AWS with AssumeRole",
osName: "ubuntu",
containerRuntime: "docker",
containerRuntime: defaultContainerRuntime,
kubernetesVersion: defaultKubernetesVersion,
executor: verifyCreateAndDelete,
}
testScenario(t, scenario, *testRunIdentifier, params, AWSManifest, false)
}

// 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()

Expand All @@ -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),
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand All @@ -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),
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -1010,7 +1019,7 @@ func TestUbuntuProvisioningWithUpgradeE2E(t *testing.T) {
scenario := scenario{
name: "Ubuntu upgrade",
osName: "ubuntu",
containerRuntime: "docker",
containerRuntime: defaultContainerRuntime,
kubernetesVersion: defaultKubernetesVersion,
executor: verifyCreateAndDelete,
}
Expand All @@ -1035,7 +1044,7 @@ func TestDeploymentControllerUpgradesMachineE2E(t *testing.T) {
scenario := scenario{
name: "MachineDeployment upgrade",
osName: "ubuntu",
containerRuntime: "docker",
containerRuntime: defaultContainerRuntime,
kubernetesVersion: defaultKubernetesVersion,
executor: verifyCreateUpdateAndDelete,
}
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/provisioning/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit cfe4226

Please sign in to comment.