@@ -406,23 +406,6 @@ func TestEnv(t *testing.T) {
406406 os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_STRESSER_REMOTE_REQUESTS_SUMMARY_READS_OUTPUT_NAME_PREFIX" , "stresser-out-pfx" )
407407 defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_STRESSER_REMOTE_REQUESTS_SUMMARY_READS_OUTPUT_NAME_PREFIX" )
408408
409- os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_ENABLE" , "true" )
410- defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_ENABLE" )
411- os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_NAMESPACE" , "conformance-test" )
412- defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_NAMESPACE" )
413- os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_PATH" , "aaaaa" )
414- defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_PATH" )
415- os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_DOWNLOAD_URL" , "sonobuoy-download-here" )
416- defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_DOWNLOAD_URL" )
417- os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_DELETE_TIMEOUT" , "10s" )
418- defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_DELETE_TIMEOUT" )
419- os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_TIMEOUT" , "10h" )
420- defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_TIMEOUT" )
421- os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_MODE" , "non-disruptive-conformance" )
422- defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_MODE" )
423- os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_KUBE_CONFORMANCE_IMAGE" , "hello.com/v1" )
424- defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_KUBE_CONFORMANCE_IMAGE" )
425-
426409 if err := cfg .UpdateFromEnvs (); err != nil {
427410 t .Fatal (err )
428411 }
@@ -1080,31 +1063,6 @@ func TestEnv(t *testing.T) {
10801063 t .Fatalf ("unexpected cfg.AddOnStresserRemote.RequestsSummaryReadsOutputNamePrefix %v" , cfg .AddOnStresserRemote .RequestsSummaryReadsOutputNamePrefix )
10811064 }
10821065
1083- if ! cfg .AddOnConformance .Enable {
1084- t .Fatalf ("unexpected cfg.AddOnConformance.Enable %v" , cfg .AddOnConformance .Enable )
1085- }
1086- if cfg .AddOnConformance .Namespace != "conformance-test" {
1087- t .Fatalf ("unexpected cfg.AddOnConformance.Namespace %q" , cfg .AddOnConformance .Namespace )
1088- }
1089- if cfg .AddOnConformance .SonobuoyPath != "aaaaa" {
1090- t .Fatalf ("unexpected cfg.AddOnConformance.SonobuoyPath %q" , cfg .AddOnConformance .SonobuoyPath )
1091- }
1092- if cfg .AddOnConformance .SonobuoyDownloadURL != "sonobuoy-download-here" {
1093- t .Fatalf ("unexpected cfg.AddOnConformance.SonobuoyDownloadURL %q" , cfg .AddOnConformance .SonobuoyDownloadURL )
1094- }
1095- if cfg .AddOnConformance .SonobuoyDeleteTimeout != 10 * time .Second {
1096- t .Fatalf ("unexpected cfg.AddOnConformance.SonobuoyDeleteTimeout %v" , cfg .AddOnConformance .SonobuoyDeleteTimeout )
1097- }
1098- if cfg .AddOnConformance .SonobuoyRunTimeout != 10 * time .Hour {
1099- t .Fatalf ("unexpected cfg.AddOnConformance.SonobuoyRunTimeout %v" , cfg .AddOnConformance .SonobuoyRunTimeout )
1100- }
1101- if cfg .AddOnConformance .SonobuoyRunMode != "non-disruptive-conformance" {
1102- t .Fatalf ("unexpected cfg.AddOnConformance.SonobuoyRunMode %q" , cfg .AddOnConformance .SonobuoyRunMode )
1103- }
1104- if cfg .AddOnConformance .SonobuoyRunKubeConformanceImage != "hello.com/v1" {
1105- t .Fatalf ("unexpected cfg.AddOnConformance.SonobuoyRunKubeConformanceImage %q" , cfg .AddOnConformance .SonobuoyRunKubeConformanceImage )
1106- }
1107-
11081066 cfg .Parameters .RoleManagedPolicyARNs = nil
11091067 cfg .Parameters .RoleServicePrincipals = nil
11101068 cfg .AddOnManagedNodeGroups .RoleName = ""
@@ -1231,6 +1189,69 @@ func TestEnvAddOnNodeGroupsGetRef(t *testing.T) {
12311189 }
12321190}
12331191
1192+ func TestEnvAddOnConformance (t * testing.T ) {
1193+ cfg := NewDefault ()
1194+ defer func () {
1195+ os .RemoveAll (cfg .ConfigPath )
1196+ os .RemoveAll (cfg .KubectlCommandsOutputPath )
1197+ os .RemoveAll (cfg .RemoteAccessCommandsOutputPath )
1198+ }()
1199+
1200+ os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_NODE_GROUPS_ENABLE" , `true` )
1201+ defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_NODE_GROUPS_ENABLE" )
1202+ 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}}` )
1203+ defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_NODE_GROUPS_ASGS" )
1204+
1205+ os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_ENABLE" , "true" )
1206+ defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_ENABLE" )
1207+ os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_NAMESPACE" , "conformance-test" )
1208+ defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_NAMESPACE" )
1209+ os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_PATH" , "aaaaa" )
1210+ defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_PATH" )
1211+ os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_DOWNLOAD_URL" , "sonobuoy-download-here" )
1212+ defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_DOWNLOAD_URL" )
1213+ os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_DELETE_TIMEOUT" , "10s" )
1214+ defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_DELETE_TIMEOUT" )
1215+ os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_TIMEOUT" , "10h" )
1216+ defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_TIMEOUT" )
1217+ os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_MODE" , "non-disruptive-conformance" )
1218+ defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_MODE" )
1219+ os .Setenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_KUBE_CONFORMANCE_IMAGE" , "hello.com/v1" )
1220+ defer os .Unsetenv ("AWS_K8S_TESTER_EKS_ADD_ON_CONFORMANCE_SONOBUOY_RUN_KUBE_CONFORMANCE_IMAGE" )
1221+
1222+ if err := cfg .UpdateFromEnvs (); err != nil {
1223+ t .Fatal (err )
1224+ }
1225+ if err := cfg .ValidateAndSetDefaults (); err != nil {
1226+ t .Fatal (err )
1227+ }
1228+
1229+ if ! cfg .AddOnConformance .Enable {
1230+ t .Fatalf ("unexpected cfg.AddOnConformance.Enable %v" , cfg .AddOnConformance .Enable )
1231+ }
1232+ if cfg .AddOnConformance .Namespace != "conformance-test" {
1233+ t .Fatalf ("unexpected cfg.AddOnConformance.Namespace %q" , cfg .AddOnConformance .Namespace )
1234+ }
1235+ if cfg .AddOnConformance .SonobuoyPath != "aaaaa" {
1236+ t .Fatalf ("unexpected cfg.AddOnConformance.SonobuoyPath %q" , cfg .AddOnConformance .SonobuoyPath )
1237+ }
1238+ if cfg .AddOnConformance .SonobuoyDownloadURL != "sonobuoy-download-here" {
1239+ t .Fatalf ("unexpected cfg.AddOnConformance.SonobuoyDownloadURL %q" , cfg .AddOnConformance .SonobuoyDownloadURL )
1240+ }
1241+ if cfg .AddOnConformance .SonobuoyDeleteTimeout != 10 * time .Second {
1242+ t .Fatalf ("unexpected cfg.AddOnConformance.SonobuoyDeleteTimeout %v" , cfg .AddOnConformance .SonobuoyDeleteTimeout )
1243+ }
1244+ if cfg .AddOnConformance .SonobuoyRunTimeout != 10 * time .Hour {
1245+ t .Fatalf ("unexpected cfg.AddOnConformance.SonobuoyRunTimeout %v" , cfg .AddOnConformance .SonobuoyRunTimeout )
1246+ }
1247+ if cfg .AddOnConformance .SonobuoyRunMode != "non-disruptive-conformance" {
1248+ t .Fatalf ("unexpected cfg.AddOnConformance.SonobuoyRunMode %q" , cfg .AddOnConformance .SonobuoyRunMode )
1249+ }
1250+ if cfg .AddOnConformance .SonobuoyRunKubeConformanceImage != "hello.com/v1" {
1251+ t .Fatalf ("unexpected cfg.AddOnConformance.SonobuoyRunKubeConformanceImage %q" , cfg .AddOnConformance .SonobuoyRunKubeConformanceImage )
1252+ }
1253+ }
1254+
12341255// TestEnvAddOnManagedNodeGroupsCNI tests CNI integration test MNG settings.
12351256// https://github.com/aws/amazon-vpc-cni-k8s/blob/master/scripts/lib/cluster.sh
12361257func TestEnvAddOnManagedNodeGroupsCNI (t * testing.T ) {
0 commit comments