123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- suite: persistence validation test
- templates:
- - common.yaml
- tests:
- - it: should fail with annotations not a dict
- set:
- persistence:
- volume1:
- enabled: true
- annotations: not-a-dict
- asserts:
- - failedTemplate:
- errorMessage: Persistence - Expected <annotations> to be a dictionary, but got [string]
- - it: should fail with labels not a dict
- set:
- persistence:
- volume1:
- enabled: true
- labels: not-a-dict
- asserts:
- - failedTemplate:
- errorMessage: Persistence - Expected <labels> to be a dictionary, but got [string]
- - it: should fail with pod targetSelector not a map
- set:
- workload:
- main:
- enabled: true
- primary: true
- type: Deployment
- podSpec: {}
- persistence:
- volume1:
- enabled: true
- targetSelector: not-a-map
- asserts:
- - failedTemplate:
- errorMessage: Persistence - Expected <targetSelector> to be [dict], but got [string]
- - it: should fail with invalid type
- set:
- workload:
- main:
- enabled: true
- primary: true
- type: Deployment
- podSpec: {}
- persistence:
- volume1:
- enabled: true
- type: not-a-type
- asserts:
- - failedTemplate:
- errorMessage: Persistence - Expected <type> to be one of [smb-pv-pvc, nfs-pv-pvc, ix-zfs-pvc, pvc, emptyDir, hostPath, ixVolume, secret, configmap, device], but got [not-a-type]
- - it: should fail with invalid accessMode
- set:
- persistence:
- volume1:
- enabled: true
- type: ix-zfs-pvc
- accessModes:
- - not-an-access-mode
- asserts:
- - failedTemplate:
- errorMessage: Persistent Volume Claim - Expected <accessModes> entry to be one of [ReadWriteOnce, ReadOnlyMany, ReadWriteMany, ReadWriteOncePod], but got [not-an-access-mode]
- - it: should fail without storageClassName in ixChartContext
- set:
- global:
- ixChartContext:
- storageClassName: ""
- persistence:
- volume1:
- enabled: true
- type: ix-zfs-pvc
- asserts:
- - failedTemplate:
- errorMessage: Persistent Volume Claim - Expected non-empty <global.ixChartContext.storageClassName> on [ix-zfs-pvc] type
- - it: should fail with non-existent configmap
- set:
- configmap:
- my-configmap:
- enabled: true
- data:
- foo: bar
- persistence:
- volume1:
- enabled: true
- type: configmap
- mountPath: /mnt/volume1
- objectName: my-non-existent-configmap
- image: &image
- repository: nginx
- tag: 1.17.6
- pullPolicy: IfNotPresent
- workload: &workload
- main:
- enabled: true
- primary: true
- type: Deployment
- podSpec:
- containers:
- main:
- enabled: true
- primary: true
- probes:
- liveness:
- enabled: false
- readiness:
- enabled: false
- startup:
- enabled: false
- asserts:
- - failedTemplate:
- errorMessage: Persistence - Expected configmap [my-non-existent-configmap] defined in <objectName> to exist
- - it: should fail with non-existent secret
- set:
- secret:
- my-secret:
- enabled: true
- data:
- foo: bar
- persistence:
- volume1:
- enabled: true
- type: secret
- mountPath: /mnt/volume1
- objectName: my-non-existent-secret
- image: *image
- workload: *workload
- asserts:
- - failedTemplate:
- errorMessage: Persistence - Expected secret [my-non-existent-secret] defined in <objectName> to exist
- - it: should fail without server on nfs-pv-pvc
- set:
- persistence:
- volume1:
- enabled: true
- type: nfs-pv-pvc
- asserts:
- - failedTemplate:
- errorMessage: NFS CSI - Expected <server> to be non-empty
- - it: should fail without share on nfs-pv-pvc
- set:
- persistence:
- volume1:
- enabled: true
- type: nfs-pv-pvc
- server: my-server.local
- asserts:
- - failedTemplate:
- errorMessage: NFS CSI - Expected <share> to be non-empty
- - it: should fail without server on smb-pv-pvc
- set:
- persistence:
- volume1:
- enabled: true
- type: smb-pv-pvc
- asserts:
- - failedTemplate:
- errorMessage: SMB CSI - Expected <server> to be non-empty
- - it: should fail without share on smb-pv-pvc
- set:
- persistence:
- volume1:
- enabled: true
- type: smb-pv-pvc
- server: my-server.local
- asserts:
- - failedTemplate:
- errorMessage: SMB CSI - Expected <share> to be non-empty
- - it: should fail without CSI when in ixChartContext on smb-pv-pvc
- set:
- global:
- ixChartContext: {}
- persistence:
- volume1:
- enabled: true
- type: smb-pv-pvc
- server: my-server.local
- share: share
- asserts:
- - failedTemplate:
- errorMessage: SMB CSI - Not supported CSI
- - it: should fail without CSI when in ixChartContext on nfs-pv-pvc
- set:
- global:
- ixChartContext: {}
- persistence:
- volume1:
- enabled: true
- type: nfs-pv-pvc
- server: my-server.local
- share: /share
- asserts:
- - failedTemplate:
- errorMessage: NFS CSI - Not supported CSI
- - it: should fail without username smb-pv-pvc
- set:
- persistence:
- volume1:
- enabled: true
- type: smb-pv-pvc
- server: my-server.local
- share: share
- asserts:
- - failedTemplate:
- errorMessage: SMB CSI - Expected <username> to be non-empty
- - it: should fail without password on smb-pv-pvc
- set:
- persistence:
- volume1:
- enabled: true
- type: smb-pv-pvc
- server: my-server.local
- share: share
- username: my-user
- asserts:
- - failedTemplate:
- errorMessage: SMB CSI - Expected <password> to be non-empty
- - it: should fail with server starting with // on smb-pv-pvc
- set:
- persistence:
- volume1:
- enabled: true
- type: smb-pv-pvc
- server: //my-server.local
- share: share
- username: my-user
- password: my-password
- asserts:
- - failedTemplate:
- errorMessage: SMB CSI - Did not expect <server> to start with [//]
- - it: should fail with share starting with / on smb-pv-pvc
- set:
- persistence:
- volume1:
- enabled: true
- type: smb-pv-pvc
- server: my-server.local
- share: /share
- username: my-user
- password: my-password
- asserts:
- - failedTemplate:
- errorMessage: SMB CSI - Did not expect <share> to start with [/]
- - it: should fail with share starting with / on nfs-pv-pvc
- set:
- persistence:
- volume1:
- enabled: true
- type: nfs-pv-pvc
- server: my-server.local
- share: share
- asserts:
- - failedTemplate:
- errorMessage: NFS CSI - Expected <share> to start with [/]
- - it: should fail with empty key on mountOptions in nfs-pv-pvc
- set:
- persistence:
- volume1:
- enabled: true
- type: nfs-pv-pvc
- server: my-server.local
- share: /share
- mountOptions:
- - key: ""
- asserts:
- - failedTemplate:
- errorMessage: NFS CSI - Expected key in <mountOptions> to be non-empty
- - it: should fail with empty key on mountOptions in smb-pv-pvc
- set:
- persistence:
- volume1:
- enabled: true
- type: smb-pv-pvc
- server: my-server.local
- share: share
- username: my-user
- password: my-password
- mountOptions:
- - key: ""
- asserts:
- - failedTemplate:
- errorMessage: SMB CSI - Expected key in <mountOptions> to be non-empty
- - it: should fail with item in mountOptions not a map in smb-pv-pvc
- set:
- persistence:
- volume1:
- enabled: true
- type: smb-pv-pvc
- server: my-server.local
- share: share
- username: my-user
- password: my-password
- mountOptions:
- - not-a-map
- asserts:
- - failedTemplate:
- errorMessage: SMB CSI - Expected <mountOption> item to be a dict, but got [string]
- - it: should fail with item in mountOptions not a map in nfs-pv-pvc
- set:
- persistence:
- volume1:
- enabled: true
- type: nfs-pv-pvc
- server: my-server.local
- share: /share
- mountOptions:
- - not-a-map
- asserts:
- - failedTemplate:
- errorMessage: NFS CSI - Expected <mountOption> item to be a dict, but got [string]
|