{{- if .Values.tests.enabled }} --- apiVersion: v1 kind: Pod metadata: name: {{ include "shibboleth-sp.fullname" . }}-helm-test-curl annotations: "helm.sh/hook": test spec: {{- if .Values.tests.imagePullSecrets }} imagePullSecrets: {{- with .Values.tests.imagePullSecrets }} {{- toYaml . | nindent 8 }} {{- end }} {{- end }} containers: # check apache is responding - name: root image: "{{ include "shibboleth-sp.tests.image" . }}" imagePullPolicy: "{{ include "shibboleth-sp.tests.imagePullPolicy" . }}" command: - "sh" - "-c" - | curl --fail http://{{ include "shibboleth-sp.fullname" . }} -D /tmp/header.out -o /tmp/document.out echo "### HEADER ###" cat /tmp/header.out echo "### DOCUMENT ###" cat /tmp/document.out echo "### TESTS ###" grep "302 Found" /tmp/header.out grep "Location: https://wayf.switch.ch/SWITCHaai/WAYF" /tmp/header.out # check shibboleth is responding - name: session image: "{{ include "shibboleth-sp.tests.image" . }}" imagePullPolicy: "{{ include "shibboleth-sp.tests.imagePullPolicy" . }}" command: - "sh" - "-c" - | curl --fail http://{{ include "shibboleth-sp.fullname" . }}/Shibboleth.sso/Session -D /tmp/header.out -o /tmp/document.out echo "### HEADER ###" cat /tmp/header.out echo "### DOCUMENT ###" cat /tmp/document.out echo "### TESTS ###" grep "200 OK" /tmp/header.out grep "A valid session was not found." /tmp/document.out restartPolicy: Never {{- end -}}