curl.yaml 1.33 KB
Newer Older
Sandro Mathys's avatar
Sandro Mathys committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
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