Add possibility to check response code in auth test

This PS allows to check the response code and if it's equal
to 22, the test will be considered as successful.

Change-Id: I3867c551be5785488248e956e6f8a124477232f5
This commit is contained in:
Dmitrii Kabanov 2019-04-11 15:20:07 -07:00
parent e44ad39421
commit b2e69ed678
1 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ kind: Pod
metadata: metadata:
name: "{{ .Release.Name }}-auth-test" name: "{{ .Release.Name }}-auth-test"
annotations: annotations:
helm.sh/hook: "test-failure" helm.sh/hook: "test-success"
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
labels: labels:
{{ tuple $envAll "drydock" "auth-test" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} {{ tuple $envAll "drydock" "auth-test" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
@ -38,6 +38,6 @@ spec:
image: {{ .Values.images.tags.drydock }} image: {{ .Values.images.tags.drydock }}
imagePullPolicy: {{ .Values.images.pull_policy }} imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple . .Values.pod.resources.test | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }} {{ tuple . .Values.pod.resources.test | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }}
command: ["/bin/bash", "-c", "curl -v -X GET --fail ${DRYDOCK_URL}/api/v1.0/tasks; exit $?"] command: ["/bin/bash", "-c", 'curl -v -X GET --fail ${DRYDOCK_URL}/api/v1.0/tasks; exit_code=$?; if [ "$exit_code" = "22" ]; then exit 0; fi; exit 1']
... ...
{{- end }} {{- end }}