Commit fc97f8f6 authored by Sandro Mathys's avatar Sandro Mathys
Browse files

add helm test using curl

parent ff01b5a6
---
apiVersion: v1
kind: Pod
metadata:
name: {{ include "shibboleth-sp.fullname" . }}-helm-test-curl
annotations:
"helm.sh/hook": test
spec:
containers:
# check apache is responding
- name: root
image: "cr.gitlab-int.switch.ch/maps/upstream-images/curlimages/curl:7.75.0"
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: "cr.gitlab-int.switch.ch/maps/upstream-images/curlimages/curl:7.75.0"
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment