Files
chart/library/common-test/tests/pod/volume_ixVolume_test.yaml
Stavros Kois 929e60d801 NAS-121003 / 23.10 / Adapt charts CI and improve/fix common (#1011)
* Adapt charts CI and improve/fix common

* add check on permissions contaienr

* add postgres template

* update comments

* Update create_app.sh

* add check

* update script

* auto gen item.yaml from Chart,yaml

* rename readme on dest

* duplicate readme from the same source

* correct comment

* reoder

* remove extra space

* keep both README and app-readme

* update regex, to also allow 2 letter names, which is also valid

* No need to check host network if there aren't any pod values

* use same pattern as the pod.name label (not prepending release-name

* update deps

* add chart dirs to ci

* Add a validation to check if there is any yaml errors after merging files

* update charts path on ci

* common/1.0.0/ -> common/

* update common-test dep path

* temp update create_app script

* make permissions container name configurable, incase we want to change order of execution

* update naming convention

* fix typo and a missed name change

* do not allow `--` in names
2023-03-16 17:36:19 +02:00

177 lines
4.7 KiB
YAML

suite: pod ixVolume volume test
templates:
- common.yaml
tests:
- it: should pass with ixVolume volume
set:
workload:
workload-name1:
enabled: true
primary: true
type: Deployment
podSpec: {}
ixVolumes:
- hostPath: /mnt/pool/ix-applications/ix-app
persistence:
ix-vol:
enabled: true
type: ixVolume
datasetName: ix-app
asserts:
- documentIndex: &deploymentDoc 0
isKind:
of: Deployment
- documentIndex: *deploymentDoc
contains:
path: spec.template.spec.volumes
content:
name: ix-vol
hostPath:
path: /mnt/pool/ix-applications/ix-app
- it: should pass with multiple ixVolume volumes
set:
workload:
workload-name1:
enabled: true
primary: true
type: Deployment
podSpec: {}
ixVolumes:
- hostPath: /mnt/pool/ix-applications/ix-app1
- hostPath: /mnt/pool/ix-applications/ix-app2
persistence:
ix-vol1:
enabled: true
type: ixVolume
datasetName: ix-app1
ix-vol2:
enabled: true
type: ixVolume
datasetName: ix-app2
asserts:
- documentIndex: &deploymentDoc 0
isKind:
of: Deployment
- documentIndex: *deploymentDoc
contains:
path: spec.template.spec.volumes
content:
name: ix-vol1
hostPath:
path: /mnt/pool/ix-applications/ix-app1
- documentIndex: *deploymentDoc
contains:
path: spec.template.spec.volumes
content:
name: ix-vol2
hostPath:
path: /mnt/pool/ix-applications/ix-app2
- it: should pass with ixVolume and hostPathType
set:
some_dataset: ix-app
some_type: DirectoryOrCreate
workload:
workload-name1:
enabled: true
primary: true
type: Deployment
podSpec: {}
ixVolumes:
- hostPath: /mnt/pool/ix-applications/ix-app
persistence:
ix-vol:
enabled: true
type: ixVolume
datasetName: "{{ .Values.some_dataset }}"
hostPathType: "{{ .Values.some_type }}"
asserts:
- documentIndex: *deploymentDoc
isKind:
of: Deployment
- documentIndex: *deploymentDoc
contains:
path: spec.template.spec.volumes
content:
name: ix-vol
hostPath:
path: /mnt/pool/ix-applications/ix-app
type: DirectoryOrCreate
# Failures
- it: should fail without datasetName
set:
workload:
some-workload:
enabled: true
primary: true
type: Deployment
podSpec: {}
persistence:
volume1:
enabled: true
type: ixVolume
datasetname: ""
asserts:
- failedTemplate:
errorMessage: Persistence - Expected non-empty <datasetName> on <ixVolume> type
- it: should fail with empty ixVolumes
set:
workload:
some-workload:
enabled: true
primary: true
type: Deployment
podSpec: {}
ixVolumes: []
persistence:
volume1:
enabled: true
type: ixVolume
datasetName: ix-app
asserts:
- failedTemplate:
errorMessage: Persistence - Expected non-empty <ixVolumes> in values on <ixVolume> type
- it: should fail with wrong ixVolumes
set:
workload:
some-workload:
enabled: true
primary: true
type: Deployment
podSpec: {}
ixVolumes:
- hostPath: /mnt/pool/ix-applications/ix-wrong-app
- hostPath: /mnt/pool/ix-applications/ix-other-app
persistence:
volume1:
enabled: true
type: ixVolume
datasetName: ix-app
asserts:
- failedTemplate:
errorMessage: Persistence - Expected <datasetName> [ix-app] to exist on <ixVolumes> list, but list contained [ix-wrong-app, ix-other-app] on <ixVolume> type
- it: should fail with invalid hostPathType
set:
workload:
some-workload:
enabled: true
primary: true
type: Deployment
podSpec: {}
ixVolumes:
- hostPath: /mnt/pool/ix-applications/ix-app
persistence:
volume1:
enabled: true
type: ixVolume
datasetName: ix-app
hostPathType: invalid
asserts:
- failedTemplate:
errorMessage: Persistence - Expected <hostPathType> to be one of [DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice, BlockDevice], but got [invalid]