Skip to content

Commit e70c8f3

Browse files
committed
test misconfigured st2.packs.volumes
1 parent f5a5727 commit e70c8f3

File tree

1 file changed

+65
-8
lines changed

1 file changed

+65
-8
lines changed

tests/unit/packs_volumes_test.yaml

Lines changed: 65 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,11 +1018,68 @@ tests:
10181018
- notContains: *pack_configs_vol_mnt
10191019
documentIndex: 2
10201020

1021-
# st2.packs.volumes
1022-
# st2api
1023-
# st2sensorcontainer
1024-
# st2actionrunner
1025-
# st2client
1026-
# jobs register_content
1027-
#
1028-
# fails if st2.packs.volumes.enabled without volume definitions
1021+
- it: Deployments with st2.packs.volumes but missing volumes config
1022+
template: deployments.yaml
1023+
set:
1024+
st2:
1025+
rbac: { enabled: true } # enable rbac job
1026+
packs:
1027+
sensors: [] # ensure only 1 sensor
1028+
images: []
1029+
volumes:
1030+
enabled: true
1031+
packs: {} # required when enabled
1032+
virtualenvs: {} # required when enabled
1033+
configs: {} # optional
1034+
configs: {} # has one core.yaml config file by default (dicts get merged)
1035+
st2chatops:
1036+
enabled: true
1037+
release:
1038+
name: missing-volumes-release
1039+
asserts:
1040+
- failedTemplate:
1041+
errorMessage: &volumes_err "Volume definition(s) missing! When st2.packs.volumes.enabled, you must define volumes for both packs and virtualenvs."
1042+
1043+
- it: Deployments with st2.packs.volumes but missing packs volume config
1044+
template: deployments.yaml
1045+
set:
1046+
st2:
1047+
rbac: { enabled: true } # enable rbac job
1048+
packs:
1049+
sensors: [] # ensure only 1 sensor
1050+
images: []
1051+
volumes:
1052+
enabled: true
1053+
packs: *nfs_packs_volume # required when enabled
1054+
virtualenvs: {} # required when enabled
1055+
configs: {} # optional
1056+
configs: {} # has one core.yaml config file by default (dicts get merged)
1057+
st2chatops:
1058+
enabled: true
1059+
release:
1060+
name: missing-volumes-release
1061+
asserts:
1062+
- failedTemplate:
1063+
errorMessage: *volumes_err
1064+
1065+
- it: Deployments with st2.packs.volumes but missing virtualenvs volume config
1066+
template: deployments.yaml
1067+
set:
1068+
st2:
1069+
rbac: { enabled: true } # enable rbac job
1070+
packs:
1071+
sensors: [] # ensure only 1 sensor
1072+
images: []
1073+
volumes:
1074+
enabled: true
1075+
packs: {} # required when enabled
1076+
virtualenvs: *nfs_venvs_volume # required when enabled
1077+
configs: {} # optional
1078+
configs: {} # has one core.yaml config file by default (dicts get merged)
1079+
st2chatops:
1080+
enabled: true
1081+
release:
1082+
name: missing-volumes-release
1083+
asserts:
1084+
- failedTemplate:
1085+
errorMessage: *volumes_err

0 commit comments

Comments
 (0)