curl.yaml 1.55 KB
Newer Older
Sandro Mathys's avatar
Sandro Mathys committed
1
2
3
4
---
apiVersion: v1
kind: Pod
metadata:
5
  name: {{ include "shibboleth-sp.name" . }}-helm-test-curl
Sandro Mathys's avatar
Sandro Mathys committed
6
7
8
  annotations:
    "helm.sh/hook": test
spec:
9
10
11
  imagePullSecrets:
    # personal(!) access token with read AND write privileges to the registry in order to use the dependency proxy
    - name: shibboleth-sp-dependency-proxy
Sandro Mathys's avatar
Sandro Mathys committed
12
13
14
  containers:
    # check apache is responding
    - name: root
Sandro Mathys's avatar
Sandro Mathys committed
15
      image: "gitlab.switch.ch/helm-charts/shibboleth-sp/dependency_proxy/containers/curlimages/curl:7.75.0"
Sandro Mathys's avatar
Sandro Mathys committed
16
17
18
19
20
21
22
23
24
25
26
27
28
29
      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
Sandro Mathys's avatar
Sandro Mathys committed
30
      image: "gitlab.switch.ch/helm-charts/shibboleth-sp/dependency_proxy/containers/curlimages/curl:7.75.0"
Sandro Mathys's avatar
Sandro Mathys committed
31
32
33
34
35
36
37
38
39
40
41
42
43
      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