diff --git a/library/common-test/tests/pod/deployment_container_command-arg_test.yaml b/library/common-test/tests/container_in_deployment/command-arg_test.yaml similarity index 99% rename from library/common-test/tests/pod/deployment_container_command-arg_test.yaml rename to library/common-test/tests/container_in_deployment/command-arg_test.yaml index 3de6da504f..249e0dce27 100644 --- a/library/common-test/tests/pod/deployment_container_command-arg_test.yaml +++ b/library/common-test/tests/container_in_deployment/command-arg_test.yaml @@ -1,4 +1,4 @@ -suite: deployment container command-arg test +suite: container in deployment command-arg test templates: - common.yaml tests: diff --git a/library/common-test/tests/pod/deployment_container_env_from.yaml b/library/common-test/tests/container_in_deployment/env_from.yaml similarity index 98% rename from library/common-test/tests/pod/deployment_container_env_from.yaml rename to library/common-test/tests/container_in_deployment/env_from.yaml index b22b8b18ae..c24969aef8 100644 --- a/library/common-test/tests/pod/deployment_container_env_from.yaml +++ b/library/common-test/tests/container_in_deployment/env_from.yaml @@ -1,4 +1,4 @@ -suite: deployment container envFrom test +suite: container in deployment envFrom test templates: - common.yaml tests: diff --git a/library/common-test/tests/pod/deployment_container_env_list.yaml b/library/common-test/tests/container_in_deployment/env_list.yaml similarity index 99% rename from library/common-test/tests/pod/deployment_container_env_list.yaml rename to library/common-test/tests/container_in_deployment/env_list.yaml index 3086c6ef5c..f4671d3d21 100644 --- a/library/common-test/tests/pod/deployment_container_env_list.yaml +++ b/library/common-test/tests/container_in_deployment/env_list.yaml @@ -1,4 +1,4 @@ -suite: deployment container env list test +suite: container in deployment env list test templates: - common.yaml tests: diff --git a/library/common-test/tests/pod/deployment_container_env_test.yaml b/library/common-test/tests/container_in_deployment/env_test.yaml similarity index 99% rename from library/common-test/tests/pod/deployment_container_env_test.yaml rename to library/common-test/tests/container_in_deployment/env_test.yaml index 21e3c32f9b..4ef655359c 100644 --- a/library/common-test/tests/pod/deployment_container_env_test.yaml +++ b/library/common-test/tests/container_in_deployment/env_test.yaml @@ -1,4 +1,4 @@ -suite: deployment container env test +suite: container in deployment env test templates: - common.yaml tests: diff --git a/library/common-test/tests/pod/deployment_container_fixedEnv_test.yaml b/library/common-test/tests/container_in_deployment/fixedEnv_test.yaml similarity index 99% rename from library/common-test/tests/pod/deployment_container_fixedEnv_test.yaml rename to library/common-test/tests/container_in_deployment/fixedEnv_test.yaml index a1efc7300a..4a49c9e823 100644 --- a/library/common-test/tests/pod/deployment_container_fixedEnv_test.yaml +++ b/library/common-test/tests/container_in_deployment/fixedEnv_test.yaml @@ -1,4 +1,4 @@ -suite: deployment container fixed env test +suite: container in deployment fixed env test templates: - common.yaml tests: diff --git a/library/common-test/tests/pod/deployment_container_image_test.yaml b/library/common-test/tests/container_in_deployment/image_test.yaml similarity index 97% rename from library/common-test/tests/pod/deployment_container_image_test.yaml rename to library/common-test/tests/container_in_deployment/image_test.yaml index 0d7b74853b..c3f04148a5 100644 --- a/library/common-test/tests/pod/deployment_container_image_test.yaml +++ b/library/common-test/tests/container_in_deployment/image_test.yaml @@ -1,5 +1,5 @@ -suite: deployment container image test +suite: container in deployment image test templates: - common.yaml tests: diff --git a/library/common-test/tests/pod/deployment_container_lifecycle_test.yaml b/library/common-test/tests/container_in_deployment/lifecycle_test.yaml similarity index 87% rename from library/common-test/tests/pod/deployment_container_lifecycle_test.yaml rename to library/common-test/tests/container_in_deployment/lifecycle_test.yaml index 8a4c97a4fe..6238d904d3 100644 --- a/library/common-test/tests/pod/deployment_container_lifecycle_test.yaml +++ b/library/common-test/tests/container_in_deployment/lifecycle_test.yaml @@ -1,5 +1,5 @@ -suite: deployment container lifecycle test +suite: container in deployment lifecycle test templates: - common.yaml tests: @@ -165,3 +165,23 @@ tests: asserts: - failedTemplate: errorMessage: No commands were given for postStart lifecycle hook + + - it: should fail with no command in preStop + documentIndex: *deploymentDoc + set: + lifecycle: + preStop: + command: "" + asserts: + - failedTemplate: + errorMessage: No commands were given for preStop lifecycle hook + + - it: should fail with no command in postStart + documentIndex: *deploymentDoc + set: + lifecycle: + postStart: + command: "" + asserts: + - failedTemplate: + errorMessage: No commands were given for postStart lifecycle hook diff --git a/library/common-test/tests/pod/deployment_contaner_port_test.yaml b/library/common-test/tests/container_in_deployment/port_test.yaml similarity index 99% rename from library/common-test/tests/pod/deployment_contaner_port_test.yaml rename to library/common-test/tests/container_in_deployment/port_test.yaml index 888de1fdcc..4207ae7c4f 100644 --- a/library/common-test/tests/pod/deployment_contaner_port_test.yaml +++ b/library/common-test/tests/container_in_deployment/port_test.yaml @@ -1,4 +1,4 @@ -suite: deployment container port test +suite: container in deployment port test templates: - common.yaml tests: diff --git a/library/common-test/tests/pod/deployment_contaner_probe_test.yaml b/library/common-test/tests/container_in_deployment/probe_test.yaml similarity index 99% rename from library/common-test/tests/pod/deployment_contaner_probe_test.yaml rename to library/common-test/tests/container_in_deployment/probe_test.yaml index a560a26b06..30c9271e1a 100644 --- a/library/common-test/tests/pod/deployment_contaner_probe_test.yaml +++ b/library/common-test/tests/container_in_deployment/probe_test.yaml @@ -1,4 +1,4 @@ -suite: deployment container probe test +suite: container in deployment probe test templates: - common.yaml tests: diff --git a/library/common-test/tests/pod/deployment_contaner_resources_test.yaml b/library/common-test/tests/container_in_deployment/resources_test.yaml similarity index 99% rename from library/common-test/tests/pod/deployment_contaner_resources_test.yaml rename to library/common-test/tests/container_in_deployment/resources_test.yaml index 44e0c13151..b9da2b36cb 100644 --- a/library/common-test/tests/pod/deployment_contaner_resources_test.yaml +++ b/library/common-test/tests/container_in_deployment/resources_test.yaml @@ -1,4 +1,4 @@ -suite: deployment container resources test +suite: container in deployment resources test templates: - common.yaml tests: diff --git a/library/common-test/tests/pod/deployment_container_securityContext_test.yaml b/library/common-test/tests/container_in_deployment/securityContext_test.yaml similarity index 98% rename from library/common-test/tests/pod/deployment_container_securityContext_test.yaml rename to library/common-test/tests/container_in_deployment/securityContext_test.yaml index b03effc0c1..7b557f7a57 100644 --- a/library/common-test/tests/pod/deployment_container_securityContext_test.yaml +++ b/library/common-test/tests/container_in_deployment/securityContext_test.yaml @@ -1,4 +1,4 @@ -suite: deployment container securityContext test +suite: container in deployment securityContext test templates: - common.yaml tests: diff --git a/library/common-test/tests/container_in_deployment/various_options_test.yaml b/library/common-test/tests/container_in_deployment/various_options_test.yaml new file mode 100644 index 0000000000..b357568ede --- /dev/null +++ b/library/common-test/tests/container_in_deployment/various_options_test.yaml @@ -0,0 +1,80 @@ + +suite: container in deployment various options test +templates: + - common.yaml +tests: + - it: should pass with default values + documentIndex: &deploymentDoc 0 + asserts: + - isKind: + of: Deployment + + - it: should pass with tty set + documentIndex: *deploymentDoc + set: + tty: true + asserts: + - equal: + path: spec.template.spec.containers[0].tty + value: true + + - it: should pass with stdin set + documentIndex: *deploymentDoc + set: + stdin: true + asserts: + - equal: + path: spec.template.spec.containers[0].stdin + value: true + + - it: should pass with terminationMessagePath set + documentIndex: *deploymentDoc + set: + termination: + messagePath: /tmp/log + asserts: + - equal: + path: spec.template.spec.containers[0].terminationMessagePath + value: /tmp/log + + - it: should pass with terminationMessagePath set from tpl + documentIndex: *deploymentDoc + set: + some_path: /tmp/log + termination: + messagePath: "{{ .Values.some_path }}" + asserts: + - equal: + path: spec.template.spec.containers[0].terminationMessagePath + value: /tmp/log + + - it: should pass with terminationMessagePolicy set + documentIndex: *deploymentDoc + set: + termination: + messagePolicy: FallbackToLogsOnError + asserts: + - equal: + path: spec.template.spec.containers[0].terminationMessagePolicy + value: FallbackToLogsOnError + + - it: should pass with terminationMessagePolicy set from tpl + documentIndex: *deploymentDoc + set: + some_key: FallbackToLogsOnError + termination: + messagePolicy: "{{ .Values.some_key }}" + asserts: + - equal: + path: spec.template.spec.containers[0].terminationMessagePolicy + value: FallbackToLogsOnError + + - it: should fail with invalid terminationMessagePolicy + documentIndex: *deploymentDoc + set: + some_key: invalid + termination: + messagePolicy: "{{ .Values.some_key }}" + asserts: + - failedTemplate: + errorMessage: Not valid option for messagePolicy diff --git a/library/common-test/tests/pod/deployment_container_volumeMounts_test.yaml b/library/common-test/tests/container_in_deployment/volumeMounts_test.yaml similarity index 99% rename from library/common-test/tests/pod/deployment_container_volumeMounts_test.yaml rename to library/common-test/tests/container_in_deployment/volumeMounts_test.yaml index 69b76c2072..f61b560c22 100644 --- a/library/common-test/tests/pod/deployment_container_volumeMounts_test.yaml +++ b/library/common-test/tests/container_in_deployment/volumeMounts_test.yaml @@ -1,4 +1,4 @@ -suite: deployment volumeMount test +suite: container in deployment volumeMount test templates: - common.yaml tests: diff --git a/library/common-test/tests/pod/deployment_annotation_test.yaml b/library/common-test/tests/deployment/annotation_test.yaml similarity index 100% rename from library/common-test/tests/pod/deployment_annotation_test.yaml rename to library/common-test/tests/deployment/annotation_test.yaml diff --git a/library/common-test/tests/pod/deployment_controller_test.yaml b/library/common-test/tests/deployment/controller_test.yaml similarity index 100% rename from library/common-test/tests/pod/deployment_controller_test.yaml rename to library/common-test/tests/deployment/controller_test.yaml diff --git a/library/common-test/tests/pod/deployment_default_test.yaml b/library/common-test/tests/deployment/default_test.yaml similarity index 100% rename from library/common-test/tests/pod/deployment_default_test.yaml rename to library/common-test/tests/deployment/default_test.yaml diff --git a/library/common-test/tests/pod/deployment_dns-network_test.yaml b/library/common-test/tests/deployment/dns-network_test.yaml similarity index 100% rename from library/common-test/tests/pod/deployment_dns-network_test.yaml rename to library/common-test/tests/deployment/dns-network_test.yaml diff --git a/library/common-test/tests/pod/deployment_label_test.yaml b/library/common-test/tests/deployment/label_test.yaml similarity index 100% rename from library/common-test/tests/pod/deployment_label_test.yaml rename to library/common-test/tests/deployment/label_test.yaml diff --git a/library/common-test/tests/pod/deployment_names_test.yaml b/library/common-test/tests/deployment/names_test.yaml similarity index 100% rename from library/common-test/tests/pod/deployment_names_test.yaml rename to library/common-test/tests/deployment/names_test.yaml diff --git a/library/common-test/tests/pod/deployment_podSecurityContext_test.yaml b/library/common-test/tests/deployment/podSecurityContext_test.yaml similarity index 100% rename from library/common-test/tests/pod/deployment_podSecurityContext_test.yaml rename to library/common-test/tests/deployment/podSecurityContext_test.yaml diff --git a/library/common-test/tests/pod/deployment_serviceAccountName_test.yaml b/library/common-test/tests/deployment/serviceAccountName_test.yaml similarity index 100% rename from library/common-test/tests/pod/deployment_serviceAccountName_test.yaml rename to library/common-test/tests/deployment/serviceAccountName_test.yaml diff --git a/library/common-test/tests/pod/deployment_container_other_test.yaml b/library/common-test/tests/deployment/various_options_test.yaml similarity index 78% rename from library/common-test/tests/pod/deployment_container_other_test.yaml rename to library/common-test/tests/deployment/various_options_test.yaml index 1460f2bf51..48f07e7772 100644 --- a/library/common-test/tests/pod/deployment_container_other_test.yaml +++ b/library/common-test/tests/deployment/various_options_test.yaml @@ -1,5 +1,5 @@ -suite: deployment container various options test +suite: deployment various options test templates: - common.yaml tests: @@ -9,24 +9,6 @@ tests: - isKind: of: Deployment - - it: should pass with tty set - documentIndex: *deploymentDoc - set: - tty: true - asserts: - - equal: - path: spec.template.spec.containers[0].tty - value: true - - - it: should pass with stdin set - documentIndex: *deploymentDoc - set: - stdin: true - asserts: - - equal: - path: spec.template.spec.containers[0].stdin - value: true - - it: should pass with gracePeriodSeconds set documentIndex: *deploymentDoc set: @@ -75,78 +57,6 @@ tests: path: spec.template.spec.priorityClassName value: some_priority_class_name - - it: should pass with terminationMessagePath set - documentIndex: *deploymentDoc - set: - termination: - messagePath: /tmp/log - asserts: - - equal: - path: spec.template.spec.containers[0].terminationMessagePath - value: /tmp/log - - - it: should pass with terminationMessagePath set from tpl - documentIndex: *deploymentDoc - set: - some_path: /tmp/log - termination: - messagePath: "{{ .Values.some_path }}" - asserts: - - equal: - path: spec.template.spec.containers[0].terminationMessagePath - value: /tmp/log - - - it: should pass with terminationMessagePolicy set - documentIndex: *deploymentDoc - set: - termination: - messagePolicy: FallbackToLogsOnError - asserts: - - equal: - path: spec.template.spec.containers[0].terminationMessagePolicy - value: FallbackToLogsOnError - - - it: should pass with terminationMessagePolicy set from tpl - documentIndex: *deploymentDoc - set: - some_key: FallbackToLogsOnError - termination: - messagePolicy: "{{ .Values.some_key }}" - asserts: - - equal: - path: spec.template.spec.containers[0].terminationMessagePolicy - value: FallbackToLogsOnError - - - it: should fail with invalid terminationMessagePolicy - documentIndex: *deploymentDoc - set: - some_key: invalid - termination: - messagePolicy: "{{ .Values.some_key }}" - asserts: - - failedTemplate: - errorMessage: Not valid option for messagePolicy - - - it: should fail with no command in preStop - documentIndex: *deploymentDoc - set: - lifecycle: - preStop: - command: "" - asserts: - - failedTemplate: - errorMessage: No commands were given for preStop lifecycle hook - - - it: should fail with no command in postStart - documentIndex: *deploymentDoc - set: - lifecycle: - postStart: - command: "" - asserts: - - failedTemplate: - errorMessage: No commands were given for postStart lifecycle hook - - it: should fail with no value in a key in nodeSelector documentIndex: *deploymentDoc set: diff --git a/library/common-test/tests/pod/deployment_volume_test.yaml b/library/common-test/tests/deployment/volume_test.yaml similarity index 100% rename from library/common-test/tests/pod/deployment_volume_test.yaml rename to library/common-test/tests/deployment/volume_test.yaml