123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- suite: pod configmap volume test
- templates:
- - common.yaml
- tests:
- - it: should pass with configmap volume
- set:
- some_object: some-object-name
- some_mode: "0777"
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec: {}
- persistence:
- conf-vol:
- enabled: true
- type: configmap
- objectName: "{{ .Values.some_object }}"
- defaultMode: "{{ .Values.some_mode }}"
- asserts:
- - documentIndex: &deploymentDoc 0
- isKind:
- of: Deployment
- - documentIndex: *deploymentDoc
- contains:
- path: spec.template.spec.volumes
- content:
- name: conf-vol
- configMap:
- name: release-name-common-test-some-object-name
- defaultMode: 0777
- - it: should pass with configmap volume with items
- set:
- some_object: some-object-name
- some_mode: "0777"
- some_key: some-key
- some_path: some-path
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec: {}
- persistence:
- conf-vol:
- enabled: true
- type: configmap
- objectName: "{{ .Values.some_object }}"
- defaultMode: "{{ .Values.some_mode }}"
- items:
- - key: "{{ .Values.some_key }}"
- path: "{{ .Values.some_path }}"
- - key: some-other-key
- path: some-other-path
- asserts:
- - documentIndex: *deploymentDoc
- isKind:
- of: Deployment
- - documentIndex: *deploymentDoc
- contains:
- path: spec.template.spec.volumes
- content:
- name: conf-vol
- configMap:
- name: release-name-common-test-some-object-name
- defaultMode: 0777
- items:
- - key: some-key
- path: some-path
- - key: some-other-key
- path: some-other-path
- - it: should pass with configmap volume without expanding object name
- set:
- some_object: some-object-name
- workload:
- workload-name1:
- enabled: true
- primary: true
- type: Deployment
- podSpec: {}
- persistence:
- conf-vol:
- enabled: true
- type: configmap
- objectName: "{{ .Values.some_object }}"
- expandObjectName: false
- asserts:
- - documentIndex: *deploymentDoc
- isKind:
- of: Deployment
- - documentIndex: *deploymentDoc
- contains:
- path: spec.template.spec.volumes
- content:
- name: conf-vol
- configMap:
- name: some-object-name
- # Failures
- - it: should fail without objectName in configmap
- set:
- workload:
- some-workload:
- enabled: true
- primary: true
- type: Deployment
- podSpec: {}
- persistence:
- volume1:
- enabled: true
- type: configmap
- asserts:
- - failedTemplate:
- errorMessage: Persistence - Expected non-empty <objectName> on <configmap> type
- - it: should fail with empty objectName in configmap
- set:
- workload:
- some-workload:
- enabled: true
- primary: true
- type: Deployment
- podSpec: {}
- persistence:
- volume1:
- enabled: true
- type: configmap
- objectName: ""
- asserts:
- - failedTemplate:
- errorMessage: Persistence - Expected non-empty <objectName> on <configmap> type
- - it: should fail with defaultMode not a string in configmap
- set:
- workload:
- some-workload:
- enabled: true
- primary: true
- type: Deployment
- podSpec: {}
- persistence:
- volume1:
- enabled: true
- type: configmap
- objectName: some-object-name
- defaultMode: 1234
- asserts:
- - failedTemplate:
- errorMessage: Persistence - Expected <defaultMode> to be [string], but got [float64]
- - it: should fail with defaultMode not in format of "0000"-"0777" in configmap
- set:
- workload:
- some-workload:
- enabled: true
- primary: true
- type: Deployment
- podSpec: {}
- persistence:
- volume1:
- enabled: true
- type: configmap
- objectName: some-object-name
- defaultMode: "123"
- asserts:
- - failedTemplate:
- errorMessage: Persistence - Expected <defaultMode> to have be in format of ["0777"], but got ["123"]
- - it: should fail without key in items in configmap
- set:
- workload:
- some-workload:
- enabled: true
- primary: true
- type: Deployment
- podSpec: {}
- persistence:
- volume1:
- enabled: true
- type: configmap
- objectName: some-object-name
- items:
- - key: ""
- path: some-path
- asserts:
- - failedTemplate:
- errorMessage: Persistence - Expected non-empty <items.key>
- - it: should fail without path in items in configmap
- set:
- workload:
- some-workload:
- enabled: true
- primary: true
- type: Deployment
- podSpec: {}
- persistence:
- volume1:
- enabled: true
- type: configmap
- objectName: some-object-name
- items:
- - key: some-key
- path: ""
- asserts:
- - failedTemplate:
- errorMessage: Persistence - Expected non-empty <items.path>
|