Browse Source

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
Dmitrii Kabanov 1 week ago
parent
commit
b2e69ed678
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      charts/drydock/templates/tests/test-drydock-auth.yaml

+ 2
- 2
charts/drydock/templates/tests/test-drydock-auth.yaml View File

@@ -24,7 +24,7 @@ kind: Pod
24 24
 metadata:
25 25
   name: "{{ .Release.Name }}-auth-test"
26 26
   annotations:
27
-    helm.sh/hook: "test-failure"
27
+    helm.sh/hook: "test-success"
28 28
     {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
29 29
   labels:
30 30
 {{ tuple $envAll "drydock" "auth-test" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
@@ -38,6 +38,6 @@ spec:
38 38
       image: {{ .Values.images.tags.drydock }}
39 39
       imagePullPolicy: {{ .Values.images.pull_policy }}
40 40
 {{ tuple . .Values.pod.resources.test | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }}
41
-      command: ["/bin/bash", "-c", "curl -v -X GET --fail ${DRYDOCK_URL}/api/v1.0/tasks; exit $?"]
41
+      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']
42 42
 ...
43 43
 {{- end }}

Loading…
Cancel
Save