Skip to content

Commit

Permalink
fix conformance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavmpandey08 committed Apr 11, 2024
1 parent 618bd05 commit de7fbef
Show file tree
Hide file tree
Showing 4 changed files with 224 additions and 34 deletions.
44 changes: 28 additions & 16 deletions cmd/integration_test/build/buildspecs/conformance-eks-a-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ env:
variables:
INTEGRATION_TEST_MAX_EC2_COUNT: 25
INTEGRATION_TEST_MAX_CONCURRENT_TEST_COUNT: 25
T_TINKERBELL_MAX_HARDWARE_PER_TEST: 5
T_TINKERBELL_MAX_HARDWARE_PER_TEST: 2
T_CLOUDSTACK_CIDR: "10.80.191.0/24"
CLOUDSTACK_PROVIDER: true
T_TINKERBELL_INVENTORY_CSV: "hardware-manifests/inventory.csv"
Expand All @@ -13,27 +13,26 @@ env:
TEST_RUNNER_GOVC_TEMPLATE: "eks-a-admin-ci"
INTEGRATION_TEST_INFRA_CONFIG: "/tmp/test-infra.yml"
T_VSPHERE_TEMPLATE_FOLDER: "/SDDC-Datacenter/vm/Templates"
T_VSPHERE_TEMPLATE_UBUNTU_1_22: "/SDDC-Datacenter/vm/Templates/ubuntu-kube-v1-22"
T_VSPHERE_TEMPLATE_UBUNTU_1_23: "/SDDC-Datacenter/vm/Templates/ubuntu-kube-v1-23"
T_VSPHERE_TEMPLATE_UBUNTU_1_24: "/SDDC-Datacenter/vm/Templates/ubuntu-kube-v1-24"
T_VSPHERE_TEMPLATE_UBUNTU_1_25: "/SDDC-Datacenter/vm/Templates/ubuntu-kube-v1-25"
T_VSPHERE_TEMPLATE_UBUNTU_1_26: "/SDDC-Datacenter/vm/Templates/ubuntu-kube-v1-26"
T_VSPHERE_TEMPLATE_UBUNTU_1_27: "/SDDC-Datacenter/vm/Templates/ubuntu-kube-v1-27"
T_VSPHERE_TEMPLATE_UBUNTU_1_28: "/SDDC-Datacenter/vm/Templates/ubuntu-kube-v1-28"
T_VSPHERE_TEMPLATE_BR_1_22: "/SDDC-Datacenter/vm/Templates/bottlerocket-kube-v1-22"
T_VSPHERE_TEMPLATE_BR_1_23: "/SDDC-Datacenter/vm/Templates/bottlerocket-kube-v1-23"
T_VSPHERE_TEMPLATE_BR_1_24: "/SDDC-Datacenter/vm/Templates/bottlerocket-kube-v1-24"
T_VSPHERE_TEMPLATE_UBUNTU_1_29: "/SDDC-Datacenter/vm/Templates/ubuntu-kube-v1-29"
T_VSPHERE_TEMPLATE_UBUNTU_2204_1_25: "/SDDC-Datacenter/vm/Templates/ubuntu-2204-kube-v1-25"
T_VSPHERE_TEMPLATE_UBUNTU_2204_1_26: "/SDDC-Datacenter/vm/Templates/ubuntu-2204-kube-v1-26"
T_VSPHERE_TEMPLATE_UBUNTU_2204_1_27: "/SDDC-Datacenter/vm/Templates/ubuntu-2204-kube-v1-27"
T_VSPHERE_TEMPLATE_UBUNTU_2204_1_28: "/SDDC-Datacenter/vm/Templates/ubuntu-2204-kube-v1-28"
T_VSPHERE_TEMPLATE_UBUNTU_2204_1_29: "/SDDC-Datacenter/vm/Templates/ubuntu-2204-kube-v1-29"
T_VSPHERE_TEMPLATE_BR_1_25: "/SDDC-Datacenter/vm/Templates/bottlerocket-kube-v1-25"
T_VSPHERE_TEMPLATE_BR_1_26: "/SDDC-Datacenter/vm/Templates/bottlerocket-kube-v1-26"
T_VSPHERE_TEMPLATE_BR_1_27: "/SDDC-Datacenter/vm/Templates/bottlerocket-kube-v1-27"
T_VSPHERE_TEMPLATE_BR_1_28: "/SDDC-Datacenter/vm/Templates/bottlerocket-kube-v1-28"
T_VSPHERE_TEMPLATE_REDHAT_1_22: "/SDDC-Datacenter/vm/Templates/redhat-kube-v1-22"
T_VSPHERE_TEMPLATE_REDHAT_1_23: "/SDDC-Datacenter/vm/Templates/redhat-kube-v1-23"
T_VSPHERE_TEMPLATE_REDHAT_1_24: "/SDDC-Datacenter/vm/Templates/redhat-kube-v1-24"
T_VSPHERE_TEMPLATE_BR_1_29: "/SDDC-Datacenter/vm/Templates/bottlerocket-kube-v1-29"
T_VSPHERE_TEMPLATE_REDHAT_1_25: "/SDDC-Datacenter/vm/Templates/redhat-kube-v1-25"
T_VSPHERE_TEMPLATE_REDHAT_1_26: "/SDDC-Datacenter/vm/Templates/redhat-kube-v1-26"
T_VSPHERE_TEMPLATE_REDHAT_1_27: "/SDDC-Datacenter/vm/Templates/redhat-kube-v1-27"
T_VSPHERE_TEMPLATE_REDHAT_1_28: "/SDDC-Datacenter/vm/Templates/redhat-kube-v1-28"
T_VSPHERE_TEMPLATE_REDHAT_1_29: "/SDDC-Datacenter/vm/Templates/redhat-kube-v1-29"
T_NUTANIX_MACHINE_VCPU_PER_SOCKET: 1
T_NUTANIX_MACHINE_VCPU_SOCKET: 2
T_NUTANIX_MACHINE_MEMORY_SIZE: "4Gi"
Expand Down Expand Up @@ -82,23 +81,24 @@ env:
T_CLOUDSTACK_POD_CIDR: "cloudstack_ci_beta_connection:pod_cidr"
T_CLOUDSTACK_SERVICE_CIDR: "cloudstack_ci_beta_connection:service_cidr"
T_CLOUDSTACK_SSH_AUTHORIZED_KEY: "vsphere_ci_beta_connection:ssh_authorized_key"
T_TINKERBELL_IMAGE_UBUNTU_1_22: "tinkerbell_ci:image_ubuntu_1_22"
T_TINKERBELL_IMAGE_UBUNTU_1_23: "tinkerbell_ci:image_ubuntu_1_23"
T_TINKERBELL_IMAGE_UBUNTU_1_24: "tinkerbell_ci:image_ubuntu_1_24"
T_TINKERBELL_IMAGE_UBUNTU_1_25: "tinkerbell_ci:image_ubuntu_1_25"
T_TINKERBELL_IMAGE_UBUNTU_1_26: "tinkerbell_ci:image_ubuntu_1_26"
T_TINKERBELL_IMAGE_UBUNTU_1_27: "tinkerbell_ci:image_ubuntu_1_27"
T_TINKERBELL_IMAGE_UBUNTU_1_28: "tinkerbell_ci:image_ubuntu_1_28"
T_TINKERBELL_IMAGE_REDHAT_1_22: "tinkerbell_ci:image_redhat_1_22"
T_TINKERBELL_IMAGE_REDHAT_1_23: "tinkerbell_ci:image_redhat_1_23"
T_TINKERBELL_IMAGE_REDHAT_1_24: "tinkerbell_ci:image_redhat_1_24"
T_TINKERBELL_IMAGE_UBUNTU_1_29: "tinkerbell_ci:image_ubuntu_1_29"
T_TINKERBELL_IMAGE_UBUNTU_2204_1_25: "tinkerbell_ci:image_ubuntu_2204_1_25"
T_TINKERBELL_IMAGE_UBUNTU_2204_1_26: "tinkerbell_ci:image_ubuntu_2204_1_26"
T_TINKERBELL_IMAGE_UBUNTU_2204_1_27: "tinkerbell_ci:image_ubuntu_2204_1_27"
T_TINKERBELL_IMAGE_UBUNTU_2204_1_28: "tinkerbell_ci:image_ubuntu_2204_1_28"
T_TINKERBELL_IMAGE_UBUNTU_2204_1_29: "tinkerbell_ci:image_ubuntu_2204_1_29"
T_TINKERBELL_IMAGE_REDHAT_1_25: "tinkerbell_ci:image_redhat_1_25"
T_TINKERBELL_IMAGE_REDHAT_1_26: "tinkerbell_ci:image_redhat_1_26"
T_TINKERBELL_IMAGE_REDHAT_1_27: "tinkerbell_ci:image_redhat_1_27"
T_TINKERBELL_IMAGE_REDHAT_1_28: "tinkerbell_ci:image_redhat_1_28"
T_TINKERBELL_SSH_AUTHORIZED_KEY: "vsphere_ci_beta_connection:ssh_authorized_key"
T_TINKERBELL_CP_NETWORK_CIDR: "tinkerbell_ci:cp_network_cidr"
T_TINKERBELL_S3_INVENTORY_CSV_KEY: "tinkerbell_ci:s3_inventory_csv"
T_TINKERBELL_S3_AG_INVENTORY_CSV_KEY: "tinkerbell_ci:s3_ag_inventory_csv"
TEST_RUNNER_GOVC_USERNAME: "tinkerbell_ci:govc_username"
TEST_RUNNER_GOVC_PASSWORD: "tinkerbell_ci:govc_password"
TEST_RUNNER_GOVC_URL: "tinkerbell_ci:govc_url"
Expand All @@ -123,6 +123,18 @@ env:
T_NUTANIX_TEMPLATE_NAME_UBUNTU_1_26: "nutanix_ci:nutanix_template_ubuntu_1_26"
T_NUTANIX_TEMPLATE_NAME_UBUNTU_1_27: "nutanix_ci:nutanix_template_ubuntu_1_27"
T_NUTANIX_TEMPLATE_NAME_UBUNTU_1_28: "nutanix_ci:nutanix_template_ubuntu_1_28"
T_NUTANIX_TEMPLATE_NAME_UBUNTU_1_29: "nutanix_ci:nutanix_template_ubuntu_1_29"
T_NUTANIX_TEMPLATE_NAME_REDHAT_1_25: "nutanix_ci:nutanix_template_rhel_8_1_25"
T_NUTANIX_TEMPLATE_NAME_REDHAT_1_26: "nutanix_ci:nutanix_template_rhel_8_1_26"
T_NUTANIX_TEMPLATE_NAME_REDHAT_1_27: "nutanix_ci:nutanix_template_rhel_8_1_27"
T_NUTANIX_TEMPLATE_NAME_REDHAT_1_28: "nutanix_ci:nutanix_template_rhel_8_1_28"
T_NUTANIX_TEMPLATE_NAME_REDHAT_1_29: "nutanix_ci:nutanix_template_rhel_8_1_29"
T_NUTANIX_TEMPLATE_NAME_REDHAT_9_1_25: "nutanix_ci:nutanix_template_rhel_9_1_25"
T_NUTANIX_TEMPLATE_NAME_REDHAT_9_1_26: "nutanix_ci:nutanix_template_rhel_9_1_26"
T_NUTANIX_TEMPLATE_NAME_REDHAT_9_1_27: "nutanix_ci:nutanix_template_rhel_9_1_27"
T_NUTANIX_TEMPLATE_NAME_REDHAT_9_1_28: "nutanix_ci:nutanix_template_rhel_9_1_28"
T_NUTANIX_TEMPLATE_NAME_REDHAT_9_1_29: "nutanix_ci:nutanix_template_rhel_9_1_29"

phases:
pre_build:
commands:
Expand Down
56 changes: 38 additions & 18 deletions internal/pkg/conformance/download.go
Original file line number Diff line number Diff line change
@@ -1,37 +1,57 @@
package conformance

import (
"bytes"
"encoding/json"
"fmt"

"golang.org/x/sys/unix"
"io"
"net/http"
"runtime"
"strings"

"github.com/aws/eks-anywhere/internal/pkg/files"
)

const (
destinationFile = "sonobuoy"
sonobuoyDarwin = "https://github.com/vmware-tanzu/sonobuoy/releases/download/v0.53.2/sonobuoy_0.53.2_darwin_amd64.tar.gz"
sonobuoyLinux = "https://github.com/vmware-tanzu/sonobuoy/releases/download/v0.53.2/sonobuoy_0.53.2_linux_amd64.tar.gz"
destinationFile = "sonobuoy"
sonobouyGitHubAPI = "https://api.github.com/repos/vmware-tanzu/sonobuoy/releases/latest"
)

type githubRelease struct {
Assets []asset `json:"assets"`
}

type asset struct {
BrowserDownloadURL string `json:"browser_download_url"`
}

func Download() error {
var err error
var utsname unix.Utsname
err = unix.Uname(&utsname)
resp, err := http.Get(sonobouyGitHubAPI)
if err != nil {
return fmt.Errorf("getting latest sonobouy version from GitHub: %v", err)
}
body, err := io.ReadAll(resp.Body)
if err != nil {
return fmt.Errorf("uname call failure: %v", err)
return fmt.Errorf("reading the response body for sonobouy release: %v", err)
}

sonobouyRelease := githubRelease{}
if err := json.Unmarshal(body, &sonobouyRelease); err != nil {
return fmt.Errorf("unmarshalling the response body for sonobouy release: %v", err)
}

var downloadFile string
sysname := string(bytes.Trim(utsname.Sysname[:], "\x00"))
if sysname == "Darwin" {
downloadFile = sonobuoyDarwin
} else {
downloadFile = sonobuoyLinux
downloadURL := ""
for _, asset := range sonobouyRelease.Assets {
if strings.Contains(asset.BrowserDownloadURL, runtime.GOOS) && strings.Contains(asset.BrowserDownloadURL, runtime.GOARCH) {
downloadURL = asset.BrowserDownloadURL
}
}
fmt.Println("Downloading sonobuoy for " + sysname + ": " + downloadFile)
err = files.GzipFileDownloadExtract(downloadFile, destinationFile, "")

if downloadURL == "" {
return fmt.Errorf("no binaries found for sonobouy for OS %s and ARCH %s", runtime.GOOS, runtime.GOARCH)
}

fmt.Printf("Downloading sonobuoy from %s\n", downloadURL)
err = files.GzipFileDownloadExtract(downloadURL, destinationFile, "")
if err != nil {
return fmt.Errorf("failed to download sonobouy: %v", err)
}
Expand Down
9 changes: 9 additions & 0 deletions test/e2e/SKIPPED_TESTS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,12 @@ skipped_tests:
- TestTinkerbellKubernetes129UbuntuCuratedPackagesAdotSimpleFlow
- TestTinkerbellKubernetes129UbuntuCuratedPackagesPrometheusSimpleFlow
- TestTinkerbellKubernetes129UbuntuCuratedPackagesClusterAutoscalerSimpleFlow

# Tinkerbell conformance
- TestTinkerbellKubernetes125BottleRocketThreeReplicasTwoWorkersConformanceFlow
- TestTinkerbellKubernetes126BottleRocketThreeReplicasTwoWorkersConformanceFlow
- TestTinkerbellKubernetes125ThreeReplicasTwoWorkersConformanceFlow
- TestTinkerbellKubernetes126ThreeReplicasTwoWorkersConformanceFlow
- TestTinkerbellKubernetes127ThreeReplicasTwoWorkersConformanceFlow
- TestTinkerbellKubernetes128ThreeReplicasTwoWorkersConformanceFlow
- TestTinkerbellKubernetes129ThreeReplicasTwoWorkersConformanceFlow
149 changes: 149 additions & 0 deletions test/e2e/conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,36 @@ func TestDockerKubernetes126ThreeWorkersConformanceFlow(t *testing.T) {
runConformanceFlow(test)
}

func TestDockerKubernetes127ThreeWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube127)),
framework.WithClusterFiller(api.WithWorkerNodeCount(3)),
)
runConformanceFlow(test)
}

func TestDockerKubernetes128ThreeWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube128)),
framework.WithClusterFiller(api.WithWorkerNodeCount(3)),
)
runConformanceFlow(test)
}

func TestDockerKubernetes129ThreeWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
framework.NewDocker(t),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube129)),
framework.WithClusterFiller(api.WithWorkerNodeCount(3)),
)
runConformanceFlow(test)
}

func TestVSphereKubernetes125ThreeWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
Expand All @@ -69,6 +99,36 @@ func TestVSphereKubernetes126ThreeWorkersConformanceFlow(t *testing.T) {
runConformanceFlow(test)
}

func TestVSphereKubernetes127ThreeWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
framework.NewVSphere(t, framework.WithUbuntu127()),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube127)),
framework.WithClusterFiller(api.WithWorkerNodeCount(3)),
)
runConformanceFlow(test)
}

func TestVSphereKubernetes128ThreeWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
framework.NewVSphere(t, framework.WithUbuntu128()),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube128)),
framework.WithClusterFiller(api.WithWorkerNodeCount(3)),
)
runConformanceFlow(test)
}

func TestVSphereKubernetes129ThreeWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
framework.NewVSphere(t, framework.WithUbuntu129()),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube129)),
framework.WithClusterFiller(api.WithWorkerNodeCount(3)),
)
runConformanceFlow(test)
}

func TestVSphereKubernetes125BottleRocketThreeWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
Expand All @@ -89,6 +149,36 @@ func TestVSphereKubernetes126BottleRocketThreeWorkersConformanceFlow(t *testing.
runConformanceFlow(test)
}

func TestVSphereKubernetes127BottleRocketThreeWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
framework.NewVSphere(t, framework.WithBottleRocket127()),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube127)),
framework.WithClusterFiller(api.WithWorkerNodeCount(3)),
)
runConformanceFlow(test)
}

func TestVSphereKubernetes128BottleRocketThreeWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
framework.NewVSphere(t, framework.WithBottleRocket128()),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube128)),
framework.WithClusterFiller(api.WithWorkerNodeCount(3)),
)
runConformanceFlow(test)
}

func TestVSphereKubernetes129BottleRocketThreeWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
framework.NewVSphere(t, framework.WithBottleRocket129()),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube129)),
framework.WithClusterFiller(api.WithWorkerNodeCount(3)),
)
runConformanceFlow(test)
}

func TestTinkerbellKubernetes125ThreeReplicasTwoWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
Expand All @@ -115,6 +205,45 @@ func TestTinkerbellKubernetes126ThreeReplicasTwoWorkersConformanceFlow(t *testin
runTinkerbellConformanceFlow(test)
}

func TestTinkerbellKubernetes127ThreeReplicasTwoWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
framework.NewTinkerbell(t, framework.WithUbuntu127Tinkerbell()),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube127)),
framework.WithClusterFiller(api.WithWorkerNodeCount(2)),
framework.WithClusterFiller(api.WithControlPlaneCount(3)),
framework.WithControlPlaneHardware(3),
framework.WithWorkerHardware(2),
)
runTinkerbellConformanceFlow(test)
}

func TestTinkerbellKubernetes128ThreeReplicasTwoWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
framework.NewTinkerbell(t, framework.WithUbuntu128Tinkerbell()),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube128)),
framework.WithClusterFiller(api.WithWorkerNodeCount(2)),
framework.WithClusterFiller(api.WithControlPlaneCount(3)),
framework.WithControlPlaneHardware(3),
framework.WithWorkerHardware(2),
)
runTinkerbellConformanceFlow(test)
}

func TestTinkerbellKubernetes129ThreeReplicasTwoWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
framework.NewTinkerbell(t, framework.WithUbuntu129Tinkerbell()),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube129)),
framework.WithClusterFiller(api.WithWorkerNodeCount(2)),
framework.WithClusterFiller(api.WithControlPlaneCount(3)),
framework.WithControlPlaneHardware(3),
framework.WithWorkerHardware(2),
)
runTinkerbellConformanceFlow(test)
}

func TestTinkerbellKubernetes125BottleRocketThreeReplicasTwoWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
Expand Down Expand Up @@ -170,3 +299,23 @@ func TestNutanixKubernetes127ThreeWorkersConformanceFlow(t *testing.T) {
)
runConformanceFlow(test)
}

func TestNutanixKubernetes128ThreeWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
framework.NewNutanix(t, framework.WithUbuntu128Nutanix()),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube128)),
framework.WithClusterFiller(api.WithWorkerNodeCount(3)),
)
runConformanceFlow(test)
}

func TestNutanixKubernetes129ThreeWorkersConformanceFlow(t *testing.T) {
test := framework.NewClusterE2ETest(
t,
framework.NewNutanix(t, framework.WithUbuntu129Nutanix()),
framework.WithClusterFiller(api.WithKubernetesVersion(v1alpha1.Kube129)),
framework.WithClusterFiller(api.WithWorkerNodeCount(3)),
)
runConformanceFlow(test)
}

0 comments on commit de7fbef

Please sign in to comment.