Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] [DO NOT MERGE] Test CI #1841

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .prow/e2e-features.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ presubmits:
memory: 7Gi

- name: pull-machine-controller-e2e-ubuntu-upgrade
# In-tree CCM is not supported for openstack starting from k8s 1.26. Please see https://github.com/kubermatic/machine-controller/issues/1626 for updates.
# run_if_changed: "(pkg/cloudprovider/provider/openstack/|pkg/userdata)"
run_if_changed: "(pkg/cloudprovider/provider/openstack/|pkg/userdata)"
decorate: true
clone_uri: "ssh://[email protected]/kubermatic/machine-controller.git"
labels:
Expand Down
43 changes: 4 additions & 39 deletions .prow/provider-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

presubmits:
- name: pull-machine-controller-e2e-aws
# In-tree CCM is not supported for AWS starting from k8s 1.27. Please see https://github.com/kubermatic/machine-controller/issues/1626 for updates.
# run_if_changed: "(pkg/cloudprovider/provider/aws/|pkg/userdata)"
run_if_changed: "(pkg/cloudprovider/provider/aws/|pkg/userdata)"
decorate: true
clone_uri: "ssh://[email protected]/kubermatic/machine-controller.git"
labels:
Expand Down Expand Up @@ -47,8 +46,7 @@ presubmits:
memory: 7Gi

- name: pull-machine-controller-e2e-aws-arm
# In-tree CCM is not supported for AWS starting from k8s 1.27. Please see https://github.com/kubermatic/machine-controller/issues/1626 for updates.
# run_if_changed: "(pkg/cloudprovider/provider/aws/|pkg/userdata)"
run_if_changed: "(pkg/cloudprovider/provider/aws/|pkg/userdata)"
decorate: true
clone_uri: "ssh://[email protected]/kubermatic/machine-controller.git"
labels:
Expand Down Expand Up @@ -79,8 +77,7 @@ presubmits:
memory: 7Gi

- name: pull-machine-controller-e2e-aws-ebs-encryption-enabled
# In-tree CCM is not supported for AWS starting from k8s 1.27. Please see https://github.com/kubermatic/machine-controller/issues/1626 for updates.
# run_if_changed: "(pkg/cloudprovider/provider/aws/|pkg/userdata)"
run_if_changed: "(pkg/cloudprovider/provider/aws/|pkg/userdata)"
decorate: true
clone_uri: "ssh://[email protected]/kubermatic/machine-controller.git"
labels:
Expand Down Expand Up @@ -111,8 +108,7 @@ presubmits:
memory: 7Gi

- name: pull-machine-controller-e2e-aws-spot-instance
# In-tree CCM is not supported for AWS starting from k8s 1.27. Please see https://github.com/kubermatic/machine-controller/issues/1626 for updates.
# run_if_changed: "(pkg/cloudprovider/provider/aws/|pkg/userdata)"
run_if_changed: "(pkg/cloudprovider/provider/aws/|pkg/userdata)"
decorate: true
clone_uri: "ssh://[email protected]/kubermatic/machine-controller.git"
labels:
Expand Down Expand Up @@ -174,37 +170,6 @@ presubmits:
limits:
memory: 7Gi

- name: pull-machine-controller-e2e-aws-centos8
always_run: false
decorate: true
clone_uri: "ssh://[email protected]/kubermatic/machine-controller.git"
labels:
preset-aws: "true"
preset-hetzner: "true"
preset-e2e-ssh: "true"
preset-goproxy: "true"
preset-kind-volume-mounts: "true"
preset-docker-mirror: "true"
preset-kubeconfig-ci: "true"
spec:
containers:
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.23-0
command:
- "./hack/ci/run-e2e-tests.sh"
args:
- "TestAWSCentOS8ProvisioningE2E"
env:
- name: CLOUD_PROVIDER
value: aws
securityContext:
privileged: true
resources:
requests:
memory: 7Gi
cpu: 2
limits:
memory: 7Gi

- name: pull-machine-controller-e2e-aws-assume-role
always_run: false
decorate: true
Expand Down
6 changes: 2 additions & 4 deletions .prow/provider-openstack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

presubmits:
- name: pull-machine-controller-e2e-openstack
# In-tree CCM is not supported for openstack starting from k8s 1.26. Please see https://github.com/kubermatic/machine-controller/issues/1626 for updates.
# run_if_changed: "(pkg/cloudprovider/provider/openstack/|pkg/userdata)"
run_if_changed: "(pkg/cloudprovider/provider/openstack/|pkg/userdata)"
decorate: true
clone_uri: "ssh://[email protected]/kubermatic/machine-controller.git"
labels:
Expand Down Expand Up @@ -47,8 +46,7 @@ presubmits:
memory: 7Gi

- name: pull-machine-controller-e2e-openstack-project-auth
# In-tree CCM is not supported for openstack starting from k8s 1.26. Please see https://github.com/kubermatic/machine-controller/issues/1626 for updates.
# run_if_changed: "(pkg/cloudprovider/provider/openstack/|pkg/userdata)"
run_if_changed: "(pkg/cloudprovider/provider/openstack/|pkg/userdata)"
decorate: true
clone_uri: "ssh://[email protected]/kubermatic/machine-controller.git"
labels:
Expand Down
76 changes: 28 additions & 48 deletions test/e2e/provisioning/all_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func TestKubevirtProvisioningE2E(t *testing.T) {
t.Fatal("Unable to run kubevirt tests, KUBEVIRT_E2E_TESTS_KUBECONFIG must be set")
}

selector := OsSelector("ubuntu", "centos", "flatcar", "rockylinux")
selector := OsSelector("ubuntu", "flatcar", "rockylinux")

params := []string{
fmt.Sprintf("<< KUBECONFIG_BASE64 >>=%s", safeBase64Encoding(kubevirtKubeconfig)),
Expand Down Expand Up @@ -347,8 +347,10 @@ func TestOpenstackProvisioningE2E(t *testing.T) {
fmt.Sprintf("<< NETWORK_NAME >>=%s", osNetwork),
}

// In-tree cloud provider is not supported from Kubernetes v1.26.
selector := And(Not(OsSelector("amzn2")), Not(VersionSelector("1.28.12", "1.29.8", "1.30.4", "1.31.0")))
// In-tree CCM for OpenStack is not available starting with Kubernetes 1.26.
// OSM doesn't support provisioning machines without any CCM prior to Kubernetes 1.29,
// so we ignore versions lower 1.29.
selector := And(Not(OsSelector("amzn2")), Not(VersionSelector("1.28.12")))
runScenarios(context.Background(), t, selector, params, OSManifest, fmt.Sprintf("os-%s", *testRunIdentifier))
}

Expand Down Expand Up @@ -402,7 +404,7 @@ func TestDigitalOceanProvisioningE2E(t *testing.T) {
t.Fatal("Unable to run the test suite, DO_E2E_TESTS_TOKEN environment variable cannot be empty")
}

selector := OsSelector("ubuntu", "centos", "rockylinux")
selector := OsSelector("ubuntu", "rockylinux")

// act
params := []string{fmt.Sprintf("<< DIGITALOCEAN_TOKEN >>=%s", doToken)}
Expand All @@ -423,8 +425,10 @@ 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")
}

// In-tree cloud provider is not supported from Kubernetes v1.27.
selector := Not(VersionSelector("1.28.12", "1.29.8", "1.30.4", "1.31.0"))
// In-tree CCM for AWS is not available starting with Kubernetes 1.27.
// OSM doesn't support provisioning machines without any CCM prior to Kubernetes 1.29,
// so we ignore versions lower 1.29.
selector := Not(VersionSelector("1.28.12"))

// act
params := []string{fmt.Sprintf("<< AWS_ACCESS_KEY_ID >>=%s", awsKeyID),
Expand Down Expand Up @@ -476,9 +480,12 @@ 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")
}

// Since we are only testing the spot instance functionality, testing it against a single OS is sufficient.
// In-tree cloud provider is not supported from Kubernetes v1.27.
selector := And(OsSelector("ubuntu"), Not(VersionSelector("1.28.12", "1.29.8", "1.30.4", "1.31.0")))
// In-tree CCM for AWS is not available starting with Kubernetes 1.27.
// OSM doesn't support provisioning machines without any CCM prior to Kubernetes 1.29,
// so we ignore versions lower 1.29.
selector := And(OsSelector("ubuntu"), Not(VersionSelector("1.28.12")))

// act
params := []string{fmt.Sprintf("<< AWS_ACCESS_KEY_ID >>=%s", awsKeyID),
Expand All @@ -499,8 +506,11 @@ func TestAWSARMProvisioningE2E(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")
}
// In-tree cloud provider is not supported from Kubernetes v1.27.
selector := And(OsSelector("ubuntu"), Not(VersionSelector("1.28.12", "1.29.8", "1.30.4", "1.31.0")))

// In-tree CCM for AWS is not available starting with Kubernetes 1.27.
// OSM doesn't support provisioning machines without any CCM prior to Kubernetes 1.29,
// so we ignore versions lower 1.29.
selector := And(OsSelector("ubuntu"), Not(VersionSelector("1.28.12")))

// act
params := []string{fmt.Sprintf("<< AWS_ACCESS_KEY_ID >>=%s", awsKeyID),
Expand Down Expand Up @@ -531,29 +541,6 @@ func TestAWSFlatcarCoreOSCloudInit8ProvisioningE2E(t *testing.T) {
runScenarios(context.Background(), t, selector, params, AWSManifest, fmt.Sprintf("aws-%s", *testRunIdentifier))
}

func TestAWSCentOS8ProvisioningE2E(t *testing.T) {
t.Parallel()

// test data
awsKeyID := os.Getenv("AWS_E2E_TESTS_KEY_ID")
awsSecret := os.Getenv("AWS_E2E_TESTS_SECRET")
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")
}

amiID := "ami-032025b3afcbb6b34" // official "CentOS 8.2.2004 x86_64"

params := []string{
fmt.Sprintf("<< AWS_ACCESS_KEY_ID >>=%s", awsKeyID),
fmt.Sprintf("<< AWS_SECRET_ACCESS_KEY >>=%s", awsSecret),
fmt.Sprintf("<< AMI >>=%s", amiID),
}

// We would like to test CentOS8 image only in this test as the other images are tested in TestAWSProvisioningE2E
selector := OsSelector("centos")
runScenarios(context.Background(), t, selector, params, AWSManifest, fmt.Sprintf("aws-%s", *testRunIdentifier))
}

// TestAWSEbsEncryptionEnabledProvisioningE2E - a test suite that exercises AWS provider with ebs encryption enabled
// by requesting nodes with different combination of container runtime type, container runtime version and the OS flavour.
func TestAWSEbsEncryptionEnabledProvisioningE2E(t *testing.T) {
Expand Down Expand Up @@ -595,8 +582,7 @@ 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")
}

// In-tree cloud provider is not supported from Kubernetes v1.30.
selector := And(Not(OsSelector("amzn2")), Not(VersionSelector("1.30.4", "1.31.0")))
selector := Not(OsSelector("amzn2"))

// act
params := []string{
Expand Down Expand Up @@ -624,8 +610,7 @@ func TestAzureCustomImageReferenceProvisioningE2E(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")
}

// In-tree cloud provider is not supported from Kubernetes v1.30.
selector := And(OsSelector("ubuntu"), Not(VersionSelector("1.30.4", "1.31.0")))
selector := OsSelector("ubuntu")
// act
params := []string{
fmt.Sprintf("<< AZURE_TENANT_ID >>=%s", azureTenantID),
Expand Down Expand Up @@ -686,7 +671,6 @@ func TestGCEProvisioningE2E(t *testing.T) {
t.Fatal("Unable to run the test suite, GOOGLE_SERVICE_ACCOUNT environment variable cannot be empty")
}

// Act. GCE does not support CentOS.
selector := OsSelector("ubuntu", "flatcar")
params := []string{
fmt.Sprintf("<< GOOGLE_SERVICE_ACCOUNT_BASE64 >>=%s", safeBase64Encoding(googleServiceAccount)),
Expand Down Expand Up @@ -729,7 +713,7 @@ func TestEquinixMetalProvisioningE2E(t *testing.T) {
t.Fatal("Unable to run the test suite, METAL_PROJECT_ID environment variable cannot be empty")
}

selector := And(OsSelector("ubuntu", "centos", "rockylinux", "flatcar"), Not(NameSelector("migrateUID")))
selector := And(OsSelector("ubuntu", "rockylinux", "flatcar"), Not(NameSelector("migrateUID")))

// act
params := []string{
Expand Down Expand Up @@ -776,7 +760,6 @@ func TestLinodeProvisioningE2E(t *testing.T) {
t.Fatal("Unable to run the test suite, LINODE_E2E_TESTS_TOKEN environment variable cannot be empty")
}

// we're shimming userdata through Linode stackscripts and the stackscript hasn't been verified for use with centos
selector := OsSelector("ubuntu")

// act
Expand Down Expand Up @@ -840,8 +823,7 @@ func getVSphereTestParams(t *testing.T) []string {
func TestVsphereProvisioningE2E(t *testing.T) {
t.Parallel()

// In-tree cloud provider is not supported from Kubernetes v1.30.
selector := And(Not(OsSelector("amzn2", "centos")), Not(VersionSelector("1.30.4", "1.31.0")))
selector := Not(OsSelector("amzn2"))
params := getVSphereTestParams(t)

runScenarios(context.Background(), t, selector, params, VSPhereManifest, fmt.Sprintf("vs-%s", *testRunIdentifier))
Expand All @@ -852,8 +834,7 @@ func TestVsphereProvisioningE2E(t *testing.T) {
func TestVsphereMultipleNICProvisioningE2E(t *testing.T) {
t.Parallel()

// In-tree cloud provider is not supported from Kubernetes v1.30.
selector := And(OsSelector("ubuntu"), Not(VersionSelector("1.30.4", "1.31.0")))
selector := OsSelector("ubuntu")
params := getVSphereTestParams(t)

runScenarios(context.Background(), t, selector, params, VSPhereMultipleNICManifest, fmt.Sprintf("vs-%s", *testRunIdentifier))
Expand Down Expand Up @@ -881,8 +862,7 @@ func TestVsphereAntiAffinityProvisioningE2E(t *testing.T) {
func TestVsphereDatastoreClusterProvisioningE2E(t *testing.T) {
t.Parallel()

// In-tree cloud provider is not supported from Kubernetes v1.30.
selector := And(OsSelector("ubuntu", "centos", "rhel", "flatcar"), Not(VersionSelector("1.30.4", "1.31.0")))
selector := OsSelector("ubuntu", "rhel", "flatcar")

params := getVSphereTestParams(t)
runScenarios(context.Background(), t, selector, params, VSPhereDSCManifest, fmt.Sprintf("vs-dsc-%s", *testRunIdentifier))
Expand Down Expand Up @@ -975,7 +955,7 @@ func TestNutanixProvisioningE2E(t *testing.T) {

// exclude migrateUID test case because it's a no-op for Nutanix and runs from a different
// location, thus possibly blocking access a HTTP proxy if it is configured.
selector := And(OsSelector("ubuntu", "centos"), Not(NameSelector("migrateUID")))
selector := And(OsSelector("ubuntu"), Not(NameSelector("migrateUID")))
params := getNutanixTestParams(t)
runScenarios(context.Background(), t, selector, params, nutanixManifest, fmt.Sprintf("nx-%s", *testRunIdentifier))
}
Expand Down Expand Up @@ -1113,7 +1093,7 @@ func TestVultrProvisioningE2E(t *testing.T) {
t.Fatal("Unable to run the test suite, VULTR_API_KEY environment variable cannot be empty")
}

selector := OsSelector("ubuntu", "centos", "rockylinux")
selector := OsSelector("ubuntu", "rockylinux")

// act
params := []string{fmt.Sprintf("<< VULTR_API_KEY >>=%s", apiKey)}
Expand Down
7 changes: 0 additions & 7 deletions test/e2e/provisioning/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ var (

operatingSystems = []providerconfigtypes.OperatingSystem{
providerconfigtypes.OperatingSystemUbuntu,
providerconfigtypes.OperatingSystemCentOS,
providerconfigtypes.OperatingSystemAmazonLinux2,
providerconfigtypes.OperatingSystemRHEL,
providerconfigtypes.OperatingSystemFlatcar,
Expand All @@ -51,7 +50,6 @@ var (

openStackImages = map[string]string{
string(providerconfigtypes.OperatingSystemUbuntu): "kubermatic-ubuntu",
string(providerconfigtypes.OperatingSystemCentOS): "machine-controller-e2e-centos",
string(providerconfigtypes.OperatingSystemRHEL): "machine-controller-e2e-rhel-8-5",
string(providerconfigtypes.OperatingSystemFlatcar): "kubermatic-e2e-flatcar",
string(providerconfigtypes.OperatingSystemRockyLinux): "machine-controller-e2e-rockylinux",
Expand All @@ -63,15 +61,13 @@ var (
}

vSphereOSImageTemplates = map[string]string{
string(providerconfigtypes.OperatingSystemCentOS): "kkp-centos-7",
string(providerconfigtypes.OperatingSystemFlatcar): "kkp-flatcar-3139.2.0",
string(providerconfigtypes.OperatingSystemRHEL): "kkp-rhel-8.6",
string(providerconfigtypes.OperatingSystemRockyLinux): "kkp-rockylinux-8",
string(providerconfigtypes.OperatingSystemUbuntu): "kkp-ubuntu-22.04",
}

kubevirtImages = map[string]string{
string(providerconfigtypes.OperatingSystemCentOS): "centos",
string(providerconfigtypes.OperatingSystemFlatcar): "flatcar",
string(providerconfigtypes.OperatingSystemRHEL): "rhel",
string(providerconfigtypes.OperatingSystemRockyLinux): "rockylinux",
Expand Down Expand Up @@ -245,9 +241,6 @@ func testScenario(ctx context.Context, t *testing.T, testCase scenario, cloudPro

if strings.Contains(cloudProvider, string(providerconfigtypes.CloudProviderEquinixMetal)) {
switch testCase.osName {
case string(providerconfigtypes.OperatingSystemCentOS):
scenarioParams = append(scenarioParams, fmt.Sprintf("<< INSTANCE_TYPE >>=%s", "m3.small.x86"))
scenarioParams = append(scenarioParams, fmt.Sprintf("<< METRO_CODE >>=%s", "AM"))
case string(providerconfigtypes.OperatingSystemFlatcar):
scenarioParams = append(scenarioParams, fmt.Sprintf("<< INSTANCE_TYPE >>=%s", "c3.small.x86"))
scenarioParams = append(scenarioParams, fmt.Sprintf("<< METRO_CODE >>=%s", "NY"))
Expand Down