|
| 1 | +--- |
| 2 | +suite: Secret files |
| 3 | +templates: |
| 4 | + # primary template files |
| 5 | + - secrets_st2auth.yaml |
| 6 | + - deployments.yaml |
| 7 | + - jobs.yaml |
| 8 | + |
| 9 | + # included templates must also be listed |
| 10 | + - configmaps_overrides.yaml |
| 11 | + - configmaps_packs.yaml |
| 12 | + - configmaps_rbac.yaml |
| 13 | + - configmaps_st2-conf.yaml |
| 14 | + - configmaps_st2-urls.yaml |
| 15 | + - configmaps_st2web.yaml |
| 16 | + - secrets_datastore_crypto_key.yaml |
| 17 | + - secrets_ssh.yaml |
| 18 | + - secrets_st2apikeys.yaml |
| 19 | + - secrets_st2auth.yaml |
| 20 | + - secrets_st2chatops.yaml |
| 21 | + |
| 22 | +tests: |
| 23 | + - it: ST2 Auth Secret include by default |
| 24 | + template: secrets_st2auth.yaml |
| 25 | + set: |
| 26 | + st2: {} |
| 27 | + release: |
| 28 | + name: st2ha |
| 29 | + asserts: |
| 30 | + - hasDocuments: |
| 31 | + count: 1 |
| 32 | + - isNotEmpty: |
| 33 | + path: data.ST2_AUTH_PASSWORD |
| 34 | + documentIndex: 0 |
| 35 | + - equal: |
| 36 | + path: data.ST2_AUTH_USERNAME |
| 37 | + value: c3QyYWRtaW4= |
| 38 | + documentIndex: 0 |
| 39 | + |
| 40 | + - it: ST2 Auth Secret set custom username and password |
| 41 | + template: secrets_st2auth.yaml |
| 42 | + set: |
| 43 | + st2: |
| 44 | + username: example |
| 45 | + password: badPassword |
| 46 | + release: |
| 47 | + name: st2ha |
| 48 | + asserts: |
| 49 | + - hasDocuments: |
| 50 | + count: 1 |
| 51 | + - equal: |
| 52 | + path: data.ST2_AUTH_USERNAME |
| 53 | + value: "ZXhhbXBsZQ==" # Base64 encoded value |
| 54 | + documentIndex: 0 |
| 55 | + - equal: |
| 56 | + path: data.ST2_AUTH_PASSWORD |
| 57 | + value: "YmFkUGFzc3dvcmQ=" # Base64 encoded value |
| 58 | + documentIndex: 0 |
| 59 | + |
| 60 | + - it: ST2 Auth Secret disable generation |
| 61 | + template: secrets_st2auth.yaml |
| 62 | + set: |
| 63 | + st2: |
| 64 | + existingAuthSecret: "hello-world" |
| 65 | + release: |
| 66 | + name: st2ha |
| 67 | + asserts: |
| 68 | + - hasDocuments: |
| 69 | + count: 0 |
| 70 | + |
| 71 | + - it: ST2 Auth Secret custom secret Name |
| 72 | + template: deployments.yaml |
| 73 | + set: |
| 74 | + st2: |
| 75 | + existingAuthSecret: "hello-world" |
| 76 | + st2chatops: |
| 77 | + enabled: true |
| 78 | + release: |
| 79 | + name: st2ha |
| 80 | + asserts: |
| 81 | + - hasDocuments: |
| 82 | + count: 14 |
| 83 | + - equal: |
| 84 | + path: spec.template.spec.initContainers[2].envFrom[0].secretRef.name |
| 85 | + value: "hello-world" |
| 86 | + documentIndex: 0 # st2auth |
| 87 | + - equal: |
| 88 | + path: spec.template.spec.initContainers[0].envFrom[1].secretRef.name |
| 89 | + value: "hello-world" |
| 90 | + documentIndex: 12 # st2client |
| 91 | + - equal: |
| 92 | + path: spec.template.spec.containers[0].envFrom[1].secretRef.name |
| 93 | + value: "hello-world" |
| 94 | + documentIndex: 13 # st2chatops |
| 95 | + |
| 96 | + - it: ST2 Auth Secret custom secret Name |
| 97 | + template: jobs.yaml |
| 98 | + set: |
| 99 | + st2: |
| 100 | + existingAuthSecret: "hello-world" |
| 101 | + st2chatops: |
| 102 | + enabled: true |
| 103 | + release: |
| 104 | + name: st2ha |
| 105 | + asserts: |
| 106 | + - hasDocuments: |
| 107 | + count: 3 |
| 108 | + - equal: |
| 109 | + path: spec.template.spec.initContainers[2].envFrom[1].secretRef.name |
| 110 | + value: "hello-world" |
| 111 | + documentIndex: 0 # st2-apikey-load |
| 112 | + - equal: |
| 113 | + path: spec.template.spec.initContainers[1].envFrom[1].secretRef.name |
| 114 | + value: "hello-world" |
| 115 | + documentIndex: 1 # st2-key-load |
0 commit comments