diff --git a/eksconfig/add-on-conformance.go b/eksconfig/add-on-conformance.go index 3e94d7ef3..b3d28b5e7 100644 --- a/eksconfig/add-on-conformance.go +++ b/eksconfig/add-on-conformance.go @@ -84,6 +84,35 @@ func getDefaultAddOnConformance() *AddOnConformance { return addOn } +/* +TODO: fix this... conformance with managed node group does not work + +Plugin: e2e +Status: failed +Total: 4897 +Passed: 267 +Failed: 9 +Skipped: 4621 + +Failed tests: +[sig-network] Services should be able to change the type from ClusterIP to ExternalName [Conformance] +[sig-network] Services should be able to create a functioning NodePort service [Conformance] +[sig-api-machinery] Aggregator Should be able to support the 1.10 Sample API Server using the current Aggregator [Conformance] +[sig-network] Networking Granular Checks: Pods should function for intra-pod communication: udp [LinuxOnly] [NodeConformance] [Conformance] +[sig-cli] Kubectl client Kubectl run --rm job should create a job from an image, then delete the job [Conformance] +[sig-network] Services should be able to change the type from ExternalName to NodePort [Conformance] +[sig-network] DNS should provide DNS for ExternalName services [Conformance] +[sig-network] Networking Granular Checks: Pods should function for node-pod communication: udp [LinuxOnly] [NodeConformance] [Conformance] +[sig-network] DNS should provide DNS for pods for Hostname [LinuxOnly] [Conformance] + +Plugin: systemd-logs +Status: passed +Total: 14 +Passed: 14 +Failed: 0 +Skipped: 0 +*/ + func (cfg *Config) validateAddOnConformance() error { if !cfg.IsEnabledAddOnConformance() { return nil @@ -92,6 +121,11 @@ func (cfg *Config) validateAddOnConformance() error { return errors.New("AddOnConformance.Enable true but no node group is enabled") } + // TODO: fix this... + if cfg.IsEnabledAddOnManagedNodeGroups() { + return errors.New("AddOnConformance.Enable true with AddOnManagedNodeGroups.Enable true") + } + if cfg.AddOnConformance.Namespace == "" { cfg.AddOnConformance.Namespace = cfg.Name + "-conformance" } diff --git a/eksconfig/env_test.go b/eksconfig/env_test.go index 2542cbbdf..e25b81513 100644 --- a/eksconfig/env_test.go +++ b/eksconfig/env_test.go @@ -406,23 +406,6 @@ func TestEnv(t *testing.T) { os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_STRESSER_REMOTE_REQUESTS_SUMMARY_READS_OUTPUT_NAME_PREFIX", "stresser-out-pfx") defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_STRESSER_REMOTE_REQUESTS_SUMMARY_READS_OUTPUT_NAME_PREFIX") - os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_ENABLE", "true") - defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_ENABLE") - os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_NAMESPACE", "conformance-test") - defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_NAMESPACE") - os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_PATH", "aaaaa") - defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_PATH") - os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_DOWNLOAD_URL", "sonobuoy-download-here") - defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_DOWNLOAD_URL") - os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_DELETE_TIMEOUT", "10s") - defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_DELETE_TIMEOUT") - os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_TIMEOUT", "10h") - defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_TIMEOUT") - os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_MODE", "non-disruptive-conformance") - defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_MODE") - os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_KUBE_CONFORMANCE_IMAGE", "hello.com/v1") - defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_KUBE_CONFORMANCE_IMAGE") - if err := cfg.UpdateFromEnvs(); err != nil { t.Fatal(err) } @@ -1080,31 +1063,6 @@ func TestEnv(t *testing.T) { t.Fatalf("unexpected cfg.AddOnStresserRemote.RequestsSummaryReadsOutputNamePrefix %v", cfg.AddOnStresserRemote.RequestsSummaryReadsOutputNamePrefix) } - if !cfg.AddOnConformance.Enable { - t.Fatalf("unexpected cfg.AddOnConformance.Enable %v", cfg.AddOnConformance.Enable) - } - if cfg.AddOnConformance.Namespace != "conformance-test" { - t.Fatalf("unexpected cfg.AddOnConformance.Namespace %q", cfg.AddOnConformance.Namespace) - } - if cfg.AddOnConformance.SonobuoyPath != "aaaaa" { - t.Fatalf("unexpected cfg.AddOnConformance.SonobuoyPath %q", cfg.AddOnConformance.SonobuoyPath) - } - if cfg.AddOnConformance.SonobuoyDownloadURL != "sonobuoy-download-here" { - t.Fatalf("unexpected cfg.AddOnConformance.SonobuoyDownloadURL %q", cfg.AddOnConformance.SonobuoyDownloadURL) - } - if cfg.AddOnConformance.SonobuoyDeleteTimeout != 10*time.Second { - t.Fatalf("unexpected cfg.AddOnConformance.SonobuoyDeleteTimeout %v", cfg.AddOnConformance.SonobuoyDeleteTimeout) - } - if cfg.AddOnConformance.SonobuoyRunTimeout != 10*time.Hour { - t.Fatalf("unexpected cfg.AddOnConformance.SonobuoyRunTimeout %v", cfg.AddOnConformance.SonobuoyRunTimeout) - } - if cfg.AddOnConformance.SonobuoyRunMode != "non-disruptive-conformance" { - t.Fatalf("unexpected cfg.AddOnConformance.SonobuoyRunMode %q", cfg.AddOnConformance.SonobuoyRunMode) - } - if cfg.AddOnConformance.SonobuoyRunKubeConformanceImage != "hello.com/v1" { - t.Fatalf("unexpected cfg.AddOnConformance.SonobuoyRunKubeConformanceImage %q", cfg.AddOnConformance.SonobuoyRunKubeConformanceImage) - } - cfg.Parameters.RoleManagedPolicyARNs = nil cfg.Parameters.RoleServicePrincipals = nil cfg.AddOnManagedNodeGroups.RoleName = "" @@ -1231,6 +1189,69 @@ func TestEnvAddOnNodeGroupsGetRef(t *testing.T) { } } +func TestEnvAddOnConformance(t *testing.T) { + cfg := NewDefault() + defer func() { + os.RemoveAll(cfg.ConfigPath) + os.RemoveAll(cfg.KubectlCommandsOutputPath) + os.RemoveAll(cfg.RemoteAccessCommandsOutputPath) + }() + + os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_NODE_GROUPS_ENABLE", `true`) + defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_NODE_GROUPS_ENABLE") + os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_NODE_GROUPS_ASGS", `{"GetRef.Name-ng-for-cni":{"name":"GetRef.Name-ng-for-cni","remote-access-user-name":"ec2-user","ami-type":"AL2_x86_64","asg-min-size":30,"asg-max-size":35,"asg-desired-capacity":34,"image-id":"my-ami", "ssm-document-create":true, "instance-types":["type-2"], "ssm-document-cfn-stack-name":"GetRef.Name-ssm", "ssm-document-name":"GetRef.Name-document", "kubelet-extra-args":"aaa aa", "volume-size":500}}`) + defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_NODE_GROUPS_ASGS") + + os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_ENABLE", "true") + defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_ENABLE") + os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_NAMESPACE", "conformance-test") + defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_NAMESPACE") + os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_PATH", "aaaaa") + defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_PATH") + os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_DOWNLOAD_URL", "sonobuoy-download-here") + defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_DOWNLOAD_URL") + os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_DELETE_TIMEOUT", "10s") + defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_DELETE_TIMEOUT") + os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_TIMEOUT", "10h") + defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_TIMEOUT") + os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_MODE", "non-disruptive-conformance") + defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_MODE") + os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_KUBE_CONFORMANCE_IMAGE", "hello.com/v1") + defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_KUBE_CONFORMANCE_IMAGE") + + if err := cfg.UpdateFromEnvs(); err != nil { + t.Fatal(err) + } + if err := cfg.ValidateAndSetDefaults(); err != nil { + t.Fatal(err) + } + + if !cfg.AddOnConformance.Enable { + t.Fatalf("unexpected cfg.AddOnConformance.Enable %v", cfg.AddOnConformance.Enable) + } + if cfg.AddOnConformance.Namespace != "conformance-test" { + t.Fatalf("unexpected cfg.AddOnConformance.Namespace %q", cfg.AddOnConformance.Namespace) + } + if cfg.AddOnConformance.SonobuoyPath != "aaaaa" { + t.Fatalf("unexpected cfg.AddOnConformance.SonobuoyPath %q", cfg.AddOnConformance.SonobuoyPath) + } + if cfg.AddOnConformance.SonobuoyDownloadURL != "sonobuoy-download-here" { + t.Fatalf("unexpected cfg.AddOnConformance.SonobuoyDownloadURL %q", cfg.AddOnConformance.SonobuoyDownloadURL) + } + if cfg.AddOnConformance.SonobuoyDeleteTimeout != 10*time.Second { + t.Fatalf("unexpected cfg.AddOnConformance.SonobuoyDeleteTimeout %v", cfg.AddOnConformance.SonobuoyDeleteTimeout) + } + if cfg.AddOnConformance.SonobuoyRunTimeout != 10*time.Hour { + t.Fatalf("unexpected cfg.AddOnConformance.SonobuoyRunTimeout %v", cfg.AddOnConformance.SonobuoyRunTimeout) + } + if cfg.AddOnConformance.SonobuoyRunMode != "non-disruptive-conformance" { + t.Fatalf("unexpected cfg.AddOnConformance.SonobuoyRunMode %q", cfg.AddOnConformance.SonobuoyRunMode) + } + if cfg.AddOnConformance.SonobuoyRunKubeConformanceImage != "hello.com/v1" { + t.Fatalf("unexpected cfg.AddOnConformance.SonobuoyRunKubeConformanceImage %q", cfg.AddOnConformance.SonobuoyRunKubeConformanceImage) + } +} + // TestEnvAddOnManagedNodeGroupsCNI tests CNI integration test MNG settings. // https://github.com/aws/amazon-vpc-cni-k8s/blob/master/scripts/lib/cluster.sh func TestEnvAddOnManagedNodeGroupsCNI(t *testing.T) {