Skip to content

Commit

Permalink
Support new kubeversion for curated package e2e tests (#5872)
Browse files Browse the repository at this point in the history
* refactor emissary test

* refactor emissary test

* refactor simple flow test

* refactor harbor test

* refactor cert manager test

* refactor metallb test

* refactor adot test

* refactor auto scaler test

* refactor prometheus test

* refactor package disable test

* increase timeout

* update default case
  • Loading branch information
vincentni authored May 17, 2023
1 parent 790d366 commit b6bd71e
Show file tree
Hide file tree
Showing 7 changed files with 619 additions and 774 deletions.
13 changes: 13 additions & 0 deletions test/e2e/cloudstack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,19 @@ func TestCloudStackKubernetes123RedhatCuratedPackagesEmissarySimpleFlow(t *testi
runCuratedPackageEmissaryInstallSimpleFlow(test)
}

func TestCloudStackKubernetes123RedhatCuratedPackagesHarborSimpleFlow(t *testing.T) {
framework.CheckCuratedPackagesCredentials(t)
test := framework.NewClusterE2ETest(
t,
framework.NewCloudStack(t, framework.WithCloudStackRedhat123()),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube123)),
framework.WithPackageConfig(t, packageBundleURI(v1alpha1.Kube123),
"my-packages-test", EksaPackageControllerHelmURI,
EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues, nil),
)
runCuratedPackageHarborInstallSimpleFlowLocalStorageProvisioner(test)
}

func TestCloudStackKubernetes123RedhatWorkloadClusterCuratedPackagesSimpleFlow(t *testing.T) {
framework.CheckCuratedPackagesCredentials(t)
provider := framework.NewCloudStack(t, framework.WithCloudStackRedhat123())
Expand Down
172 changes: 82 additions & 90 deletions test/e2e/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
package e2e

import (
corev1 "k8s.io/api/core/v1"
"testing"

corev1 "k8s.io/api/core/v1"

"github.com/aws/eks-anywhere/internal/pkg/api"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/constants"
Expand Down Expand Up @@ -116,97 +117,88 @@ func TestDockerInstallGithubFluxDuringUpgrade(t *testing.T) {
}

// Curated packages
func TestDockerKubernetes124CuratedPackagesPrometheusSimpleFlow(t *testing.T) {
framework.CheckCuratedPackagesCredentials(t)
test := framework.NewClusterE2ETest(t, framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube124)),
framework.WithPackageConfig(t, packageBundleURI(v1alpha1.Kube124),
EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI,
EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues, nil),
)
runCuratedPackagesPrometheusInstallSimpleFlow(test)
}

func TestDockerKubernetesCuratedPackagesHarborSimpleFlow(t *testing.T) {
framework.CheckCuratedPackagesCredentials(t)
test := framework.NewClusterE2ETest(t, framework.NewDocker(t),
framework.WithPackageConfig(t, EksaPackageBundleURI,
EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI,
EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues, nil),
)
runCuratedPackageHarborInstallSimpleFlowLocalStorageProvisioner(test)
}

func TestDockerKubernetes125CuratedPackagesEmissarySimpleFlow(t *testing.T) {
framework.CheckCuratedPackagesCredentials(t)
test := framework.NewClusterE2ETest(t,
framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube125)),
framework.WithPackageConfig(t, packageBundleURI(v1alpha1.Kube125),
EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI,
EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues, nil),
)
runCuratedPackageEmissaryInstallSimpleFlow(test)
}

func TestDockerKubernetes125CuratedPackagesSimpleFlow(t *testing.T) {
framework.CheckCuratedPackagesCredentials(t)
test := framework.NewClusterE2ETest(t,
framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube125)),
framework.WithPackageConfig(t, packageBundleURI(v1alpha1.Kube125),
EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI,
EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues, nil),
)
runCuratedPackageInstallSimpleFlow(test)
func TestDockerCuratedPackagesSimpleFlow(t *testing.T) {
for _, version := range KubeVersions {
framework.CheckCuratedPackagesCredentials(t)
test := framework.NewClusterE2ETest(t,
framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(version)),
framework.WithPackageConfig(t, packageBundleURI(version),
EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI,
EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues, nil),
)
runCuratedPackageInstallSimpleFlow(test)
}
}

func TestDockerCuratedPackagesEmissarySimpleFlow(t *testing.T) {
for _, version := range KubeVersions {
framework.CheckCuratedPackagesCredentials(t)
test := framework.NewClusterE2ETest(t,
framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(version)),
framework.WithPackageConfig(t, packageBundleURI(version),
EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI,
EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues, nil),
)
runCuratedPackageEmissaryInstallSimpleFlow(test)
}
}

func TestDockerCuratedPackagesHarborSimpleFlow(t *testing.T) {
for _, version := range KubeVersions {
framework.CheckCuratedPackagesCredentials(t)
test := framework.NewClusterE2ETest(t,
framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(version)),
framework.WithPackageConfig(t, packageBundleURI(version),
EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI,
EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues, nil),
)
runCuratedPackageHarborInstallSimpleFlowLocalStorageProvisioner(test)
}
}

func TestDockerCuratedPackagesAdotSimpleFlow(t *testing.T) {
for _, version := range KubeVersions {
framework.CheckCuratedPackagesCredentials(t)
test := framework.NewClusterE2ETest(t, framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(version)),
framework.WithPackageConfig(t, packageBundleURI(version),
EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI,
EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues, nil),
)
runCuratedPackagesAdotInstallSimpleFlow(test) // other args as necessary
}
}

func TestDockerCuratedPackagesPrometheusSimpleFlow(t *testing.T) {
for _, version := range KubeVersions {
framework.CheckCuratedPackagesCredentials(t)
test := framework.NewClusterE2ETest(t, framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(version)),
framework.WithPackageConfig(t, packageBundleURI(version),
EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI,
EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues, nil),
)
runCuratedPackagesPrometheusInstallSimpleFlow(test)
}
}

func TestDockerCuratedPackagesDisabled(t *testing.T) {
for _, version := range KubeVersions {
framework.CheckCuratedPackagesCredentials(t)
test := framework.NewClusterE2ETest(t, framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(version)),
framework.WithPackageConfig(t, packageBundleURI(version),
EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI,
EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues,
&v1alpha1.PackageConfiguration{Disable: true}),
)
runDisabledCuratedPackageInstallSimpleFlow(test) // other args as necessary
}
}

func TestDockerKubernetes126CuratedPackagesSimpleFlow(t *testing.T) {
framework.CheckCuratedPackagesCredentials(t)
test := framework.NewClusterE2ETest(t,
framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube126)),
framework.WithPackageConfig(t, packageBundleURI(v1alpha1.Kube126),
EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI,
EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues, nil),
)
runCuratedPackageInstallSimpleFlow(test)
}

func TestDockerKubernetes127CuratedPackagesSimpleFlow(t *testing.T) {
framework.CheckCuratedPackagesCredentials(t)
test := framework.NewClusterE2ETest(t,
framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube127)),
framework.WithPackageConfig(t, packageBundleURI(v1alpha1.Kube127),
EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI,
EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues, nil),
)
runCuratedPackageInstallSimpleFlow(test)
}

func TestDockerKubernetes124CuratedPackagesAdotSimpleFlow(t *testing.T) {
framework.CheckCuratedPackagesCredentials(t)
test := framework.NewClusterE2ETest(t, framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube124)),
framework.WithPackageConfig(t, packageBundleURI(v1alpha1.Kube124),
EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI,
EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues, nil),
)
runCuratedPackagesAdotInstallSimpleFlow(test) // other args as necessary
}

func TestDockerKubernetesCuratedPackagesDisabled(t *testing.T) {
framework.CheckCuratedPackagesCredentials(t)
test := framework.NewClusterE2ETest(t, framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube125)),
framework.WithPackageConfig(t, packageBundleURI(v1alpha1.Kube125),
EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI,
EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues,
&v1alpha1.PackageConfiguration{Disable: true}),
)
runDisabledCuratedPackageInstallSimpleFlow(test) // other args as necessary
}
func TestDockerCuratedPackagesMetalLB(t *testing.T) {
RunMetalLBDockerTests(t)
}
Expand Down
17 changes: 1 addition & 16 deletions test/e2e/metallb.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (

"github.com/stretchr/testify/suite"

"github.com/aws/eks-anywhere/internal/pkg/api"
"github.com/aws/eks-anywhere/pkg/api/v1alpha1"
"github.com/aws/eks-anywhere/pkg/clients/kubernetes"
"github.com/aws/eks-anywhere/pkg/kubeconfig"
Expand All @@ -28,10 +27,8 @@ type MetalLBSuite struct {
provider framework.Provider
}

var versionsToTest = []v1alpha1.KubernetesVersion{v1alpha1.Kube124, v1alpha1.Kube125}

func RunMetalLBDockerTests(t *testing.T) {
for _, v := range versionsToTest {
for _, v := range KubeVersions {
s := new(MetalLBSuite)
s.provider = framework.NewDocker(t)
s.kubernetesVersion = v
Expand All @@ -45,18 +42,6 @@ func kubeVersionNameDiscriminator(version v1alpha1.KubernetesVersion) framework.
}
}

func (suite *MetalLBSuite) SetupSuite() {
t := suite.T()
suite.cluster = framework.NewClusterE2ETest(t,
suite.provider,
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube123)),
framework.WithPackageConfig(t, packageBundleURI(v1alpha1.Kube123),
EksaPackageControllerHelmChartName, EksaPackageControllerHelmURI,
EksaPackageControllerHelmVersion, EksaPackageControllerHelmValues, nil),
kubeVersionNameDiscriminator(suite.kubernetesVersion),
)
}

func getIPAddressPoolSpec(addresses []string, autoAssign bool) string {
aList, _ := json.Marshal(addresses)
return fmt.Sprintf(`{"addresses":%s,"autoAssign":%s,"avoidBuggyIPs":false}`, aList, strconv.FormatBool(autoAssign))
Expand Down
Loading

0 comments on commit b6bd71e

Please sign in to comment.