diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/configmap_bindings_type_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/configmap_bindings_type_test.yaml index 83ece1c08bd44bc06afaa631215dcf699fd33239..874ac81be33b6ee09d036fff685c76223431cd16 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/configmap_bindings_type_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/configmap_bindings_type_test.yaml @@ -32,6 +32,8 @@ tests: asserts: - isKind: of: ConfigMap + - isAPIVersion: + of: v1 - equal: path: metadata.name value: bindings-type diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_container_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_container_test.yaml index 462e66f312dc001e037e1684545c168375caead4..56ca88385cee5f3dc63b022b256f06caa272e0ba 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_container_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_container_test.yaml @@ -28,13 +28,13 @@ release: namespace: sh-helm-test templates: - deployment.yaml +set: + image: + name: hase + tag: latest + imagePullSecret: imagePullSecret tests: - it: validate image type and container image - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: spec.template.spec.containers[0].name @@ -47,11 +47,6 @@ tests: value: Always - it: validate health checks - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: spec.template.spec.containers[0].readinessProbe @@ -78,11 +73,6 @@ tests: timeoutSeconds: 5 - it: validate security context - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: spec.template.spec.containers[0].securityContext diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_env_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_env_customList_test.yaml similarity index 100% rename from ozgcloud-elasticsearch-operator/src/test/helm/deployment_env_test.yaml rename to ozgcloud-elasticsearch-operator/src/test/helm/deployment_env_customList_test.yaml diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_metadata_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_metadata_test.yaml index fa5662446d960e6f468552a9caed3f8bdde19067..d39d5767dc076781a3c508315b82af17b4530dc4 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_metadata_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_metadata_test.yaml @@ -28,42 +28,30 @@ release: namespace: sh-helm-test templates: - templates/deployment.yaml +set: + image: + name: hase + tag: latest + imagePullSecret: imagePullSecret tests: - it: check metadata labels - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: - path: metadata.labels["app.kubernetes.io/instance"] - value: ozgcloud-elasticsearch-operator - - equal: - path: metadata.labels["app.kubernetes.io/name"] - value: ozgcloud-elasticsearch-operator - - equal: - path: metadata.labels["app.kubernetes.io/part-of"] - value: ozg - - equal: - path: metadata.labels["app.kubernetes.io/namespace"] - value: sh-helm-test + path: metadata.labels + value: + app.kubernetes.io/instance: ozgcloud-elasticsearch-operator + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: ozgcloud-elasticsearch-operator + app.kubernetes.io/namespace: sh-helm-test + app.kubernetes.io/part-of: ozg + app.kubernetes.io/version: 0.0.0-MANAGED-BY-JENKINS + helm.sh/chart: ozgcloud-elasticsearch-operator-0.0.0-MANAGED-BY-JENKINS - it: check metadata name - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: metadata.name value: ozgcloud-elasticsearch-operator - it: check metadata namespace - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: metadata.namespace diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_resources_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_resources_test.yaml index 5e871d26719f7d886e29729a2134f75419fd4aae..cff78bac3b635d719160aa2fb86d2f956be54862 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_resources_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_resources_test.yaml @@ -27,6 +27,11 @@ release: name: afm-adapter templates: - templates/deployment.yaml +set: + image: + name: hase + tag: latest + imagePullSecret: imagePullSecret tests: - it: test resources set: @@ -37,10 +42,6 @@ tests: requests: cpu: "33m" memory: "44Mi" - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: spec.template.spec.containers[0].resources.limits.cpu @@ -56,11 +57,6 @@ tests: value: 44Mi - it: test empty resources - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - isEmpty: path: spec.template.spec.containers[0].resources diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_template_spec_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_template_spec_test.yaml index 8ec9dbacd2267f9b2579ca4c5e2e57330edf10f6..1aa878d93eb858a164a086a07fc90c92918f32fd 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_template_spec_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_template_spec_test.yaml @@ -28,39 +28,43 @@ release: namespace: sh-helm-test templates: - deployment.yaml +set: + image: + name: hase + tag: latest + imagePullSecret: imagePullSecret tests: - it: validate serviceaccount name - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: spec.template.spec.serviceAccountName value: ozgcloud-elasticsearch-operator-serviceaccount - it: validate restartPolicy - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: spec.template.spec.restartPolicy value: Always - it: validate dns config - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - equal: path: spec.template.spec.dnsConfig value: {} - equal: path: spec.template.spec.dnsPolicy - value: ClusterFirst \ No newline at end of file + value: ClusterFirst + - it: should have correct values for container terminationMessagePolicy, terminationMessagePath, stdin, tty + asserts: + - equal: + path: spec.template.spec.containers[0].terminationMessagePolicy + value: File + - equal: + path: spec.template.spec.containers[0].terminationMessagePath + value: /dev/termination-log + - equal: + path: spec.template.spec.containers[0].stdin + value: true + - equal: + path: spec.template.spec.containers[0].tty + value: true \ No newline at end of file diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_type_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_type_test.yaml index e992e29f94ea59c82a59b616a7db948864061c56..8216a628ae690a5d3aca70e17d399dda9d2a11d6 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_type_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_type_test.yaml @@ -28,13 +28,13 @@ release: namespace: sh-helm-test templates: - deployment.yaml +set: + image: + name: hase + tag: latest + imagePullSecret: imagePullSecret tests: - it: validate template type and api Version - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - isKind: of: Deployment diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_volumes.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_volumes_test.yaml similarity index 86% rename from ozgcloud-elasticsearch-operator/src/test/helm/deployment_volumes.yaml rename to ozgcloud-elasticsearch-operator/src/test/helm/deployment_volumes_test.yaml index 15ce39bf9a4c2bafc6f15c13bb54a9e86c3e4c37..db2cdd14bc48739f580c2aac598d91eeb13c273d 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_volumes.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_volumes_test.yaml @@ -22,19 +22,20 @@ # unter der Lizenz sind dem Lizenztext zu entnehmen. # -suite: deployment type test +suite: deployment volumes test release: name: elastic-test-operator namespace: sh-helm-test templates: - - deployment.yaml + - templates/deployment.yaml + +set: + image: + name: hase + tag: latest + imagePullSecret: imagePullSecret tests: - it: should create SERVICE_BINDING_ROOT - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - contains: path: spec.template.spec.containers[0].env @@ -43,11 +44,6 @@ tests: value: "/bindings" - it: should create volumes - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - contains: path: spec.template.spec.volumes @@ -64,11 +60,6 @@ tests: optional: false - it: should create volumeMounts - set: - image: - name: hase - tag: latest - imagePullSecret: imagePullSecret asserts: - contains: path: spec.template.spec.containers[0].volumeMounts diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/linter_values.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/linter_values.yaml index aab55aca7ad1c21dbc0730aa82a28e0b3d8d872b..a27fd79bc5ea4c8798f61c9b947854d90c9166a3 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/linter_values.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/linter_values.yaml @@ -5,7 +5,3 @@ image: imagePullSecret: "docker-secret" -env: - customList: - - name: my_test_environment_name - value: "A test value" \ No newline at end of file diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_serviceaccount_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_serviceaccount_test.yaml index c2a93ca53960bf57424ff9d3f153e5cfbecb9a43..e52b66866a9b63042b848a5fd8b19ea8dac0e195 100644 --- a/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_serviceaccount_test.yaml +++ b/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_serviceaccount_test.yaml @@ -33,6 +33,8 @@ tests: asserts: - isKind: of: ServiceAccount + - isAPIVersion: + of: v1 - equal: path: metadata.name value: ozgcloud-elasticsearch-operator-serviceaccount