test_powervault.yml 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355
  1. # Copyright 2021 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. # Testcase OMNIA_1.1_PV_TC_001
  16. # Test case to verify the connectivity to powervault and validate product id
  17. - name: OMNIA_1.1_PV_TC_001
  18. hosts: powervault
  19. connection: local
  20. tags: TC_001
  21. gather_subset:
  22. - 'min'
  23. vars_files:
  24. - ../input_params/base_vars.yml
  25. - ../input_params/powervault_me4_vars.yml
  26. - test_vars/test_powervault_vars.yml
  27. tasks:
  28. - name: Check login_vars file is encrypted
  29. command: cat {{ login_vars_path }}
  30. changed_when: false
  31. register: config_content
  32. no_log: true
  33. tags: always
  34. - name: Decrpyt login_vars.yml
  35. command: >-
  36. ansible-vault decrypt {{ login_vars_path }}
  37. --vault-password-file {{ login_vars_vault_path }}
  38. changed_when: false
  39. when: "'$ANSIBLE_VAULT;' in config_content.stdout"
  40. no_log: true
  41. tags: always
  42. - name: Include variable file login_vars.yml
  43. include_vars: "{{ login_vars_path }}"
  44. no_log: true
  45. tags: always
  46. - name: Get auth string
  47. shell: echo -n {{ powervault_me4_username }}_{{ powervault_me4_password }} | sha256sum
  48. register: auth_string_output
  49. changed_when: false
  50. failed_when: false
  51. no_log: true
  52. tags: always
  53. - name: Set the powervault username and password
  54. set_fact:
  55. powervault_username: "{{ powervault_me4_username }}"
  56. powervault_password: "{{ powervault_me4_password }}"
  57. auth_string: "{{ auth_string_output }}"
  58. no_log: true
  59. tags: always
  60. - name: Encypt login file
  61. command: >-
  62. ansible-vault encrypt {{ login_vars_path }}
  63. --vault-password-file {{ login_vars_vault_path }}
  64. changed_when: false
  65. no_log: true
  66. tags: always
  67. - name: Ping the powervault device to validate connectivity
  68. command: ping -c1 {{ inventory_hostname }}
  69. register: validate_login
  70. changed_when: false
  71. failed_when: false
  72. tags: VERIFY_OMNIA_01
  73. - name: Validate the powervault connectivity
  74. assert:
  75. that:
  76. - "'ping' in validate_login.stdout"
  77. success_msg: "{{ connectivity_success_msg }}"
  78. fail_msg: "{{ connectivity_failure_msg }}"
  79. tags: VERIFY_OMNIA_01
  80. - name: Get session key
  81. uri:
  82. url: https://{{ inventory_hostname }}/api/login/{{ auth_string.stdout | replace(" -", "") }}
  83. method: GET
  84. headers:
  85. {'datatype': 'json'}
  86. validate_certs: no
  87. register: session_key
  88. tags: VERIFY_OMNIA_01
  89. - name: Execute show system command
  90. uri:
  91. url: https://{{ inventory_hostname }}/api/show/system
  92. method: GET
  93. body_format: json
  94. validate_certs: no
  95. use_proxy: no
  96. headers:
  97. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  98. register: system_info
  99. tags: VERIFY_OMNIA_01
  100. - name: Verify the product id of device
  101. assert:
  102. that:
  103. - scsi_product_id in system_info.json.system[0]['scsi-product-id']
  104. - system_info.json.system[0]['product-id'] == "ME4012" or
  105. system_info.json.system[0]['product-id'] == "ME4024" or
  106. system_info.json.system[0]['product-id'] == "ME4084"
  107. success_msg: "{{ product_id_success_msg }}"
  108. fail_msg: "{{ product_id_failure_msg }}"
  109. tags: VERIFY_OMNIA_01
  110. # Testcase OMNIA_1.1_PV_TC_002
  111. # Test case to verify the powervault management port IP is in dhcp range
  112. - name: OMNIA_1.1_PV_TC_002
  113. hosts: powervault
  114. connection: local
  115. tags: TC_002
  116. gather_subset:
  117. - 'min'
  118. vars_files:
  119. - test_vars/test_powervault_vars.yml
  120. - ../input_params/powervault_me4_vars.yml
  121. - ../input_params/base_vars.yml
  122. tasks:
  123. - name: Set base vars parameters
  124. lineinfile:
  125. path: "{{ base_var_path }}"
  126. regexp: "{{ item.regexp }}"
  127. line: "{{ item.line }}"
  128. loop:
  129. - { regexp: '^mngmnt_network_dhcp_start_range', line: 'mngmnt_network_dhcp_start_range: "{{ dhcp_start_range }}"' }
  130. - { regexp: '^mngmnt_network_dhcp_end_range', line: 'mngmnt_network_dhcp_end_range: "{{ dhcp_end_range }}"' }
  131. - name: Execute show controllers command
  132. uri:
  133. url: https://{{ inventory_hostname }}/api/show/controllers
  134. method: GET
  135. body_format: json
  136. validate_certs: no
  137. use_proxy: no
  138. headers:
  139. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  140. register: controller_info
  141. - name: Assert the IP ranges
  142. assert:
  143. that:
  144. - ip_range in controller_info.json.controllers[0]['ip-address']
  145. - ip_range in mngmnt_network_dhcp_start_range
  146. - ip_range in mngmnt_network_dhcp_end_range
  147. success_msg: "{{ ip_validation_success_msg }}"
  148. fail_msg: "{{ ip_validation_failure_msg }}"
  149. # Testcase OMNIA_1.1_PV_TC_003
  150. # Test case to verify the users settings
  151. - name: OMNIA_1.1_PV_TC_003
  152. hosts: powervault
  153. connection: local
  154. tags: TC_003
  155. gather_subset:
  156. - 'min'
  157. vars_files:
  158. - test_vars/test_powervault_vars.yml
  159. - ../input_params/powervault_me4_vars.yml
  160. - ../input_params/base_vars.yml
  161. tasks:
  162. - name: Execute show users command
  163. uri:
  164. url: https://{{ inventory_hostname }}/api/show/users/{{ powervault_username }}
  165. method: GET
  166. body_format: json
  167. validate_certs: no
  168. use_proxy: no
  169. headers:
  170. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  171. register: user_info
  172. no_log: true
  173. tags: VERIFY_OMNIA_01
  174. - name: Verify the user settings
  175. assert:
  176. that:
  177. - user_roles in user_info.json.users[0].roles
  178. - user_type in user_info.json.users[0]['user-type']
  179. - user_locale in user_info.json.users[0]['user-locale']
  180. - "'****' in user_info.json.users[0].password"
  181. success_msg: "{{ user_validation_success_msg }}"
  182. fail_msg: "{{ user_validation_failure_msg }}"
  183. tags: VERIFY_OMNIA_01
  184. # Testcase OMNIA_1.1_PV_TC_018
  185. # Test case to validate linear storage with linear pools and disk groups
  186. - name: OMNIA_1.1_PV_TC_018
  187. hosts: powervault
  188. connection: local
  189. tags: TC_018
  190. gather_subset:
  191. - 'min'
  192. vars_files:
  193. - test_vars/test_powervault_vars.yml
  194. - ../input_params/powervault_me4_vars.yml
  195. - ../input_params/base_vars.yml
  196. - ../roles/webui_awx/vars/main.yml
  197. tasks:
  198. - name: Set powervault parameters
  199. lineinfile:
  200. path: "{{ powervault_me4_var_path }}"
  201. regexp: "{{ item.regexp }}"
  202. line: "{{ item.line }}"
  203. loop:
  204. - { regexp: '^powervault_me4_pool_type', line: 'powervault_me4_pool_type: "{{ linear_pool_type }}"' }
  205. - { regexp: '^powervault_me4_disk_group_name', line: 'powervault_me4_disk_group_name: "{{ disk_group_name_omnia }}"' }
  206. - { regexp: '^powervault_me4_raid_levels', line: 'powervault_me4_raid_levels: "{{ raid1_level }}"' }
  207. - { regexp: '^powervault_me4_disk_range', line: 'powervault_me4_disk_range: "{{ disk_range_1_2 }}"' }
  208. - { regexp: '^powervault_me4_k8s_volume_name', line: 'powervault_me4_k8s_volume_name: "{{ volume_name_k8s_v1 }}"' }
  209. - { regexp: '^powervault_me4_slurm_volume_name', line: 'powervault_me4_slurm_volume_name: "{{ volume_name_slurm_v1 }}"' }
  210. - { regexp: '^powervault_me4_volume_size', line: 'powervault_me4_volume_size: "{{ volume_size_input_100gb }}"' }
  211. - name: Execute powervault playbook using AWX collections
  212. vars:
  213. inventory_name: "{{ powervault_inventory_name }}"
  214. template_name: "{{ template_value }}"
  215. job_template_name: "{{ job_name }}"
  216. playbook_path: "{{ powervault_playbook_path }}"
  217. delete_status: false
  218. include_tasks: "{{ awx_script_path }}"
  219. - name: Validate powervault playbook execution output
  220. assert:
  221. that:
  222. - success_job_status in job_status.status
  223. success_msg: "{{ playbook_exec_success_msg }}"
  224. fail_msg: "{{ playbook_exec_fail_msg }}"
  225. changed_when: false
  226. - name: Execute show disk groups command
  227. uri:
  228. url: https://{{ inventory_hostname }}/api/show/disk-groups/pool/{{ disk_group_name_omnia }}/{{ disk_group_name_omnia }}
  229. method: GET
  230. body_format: json
  231. validate_certs: no
  232. use_proxy: no
  233. headers:
  234. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  235. register: pools_diskgroup_info
  236. tags: VERIFY_OMNIA_01
  237. - name: Verify the pool and disk group additions
  238. assert:
  239. that:
  240. - linear_pool_type in pools_diskgroup_info.json['disk-groups'][0]['storage-type']
  241. - disk_group_name_omnia in pools_diskgroup_info.json['disk-groups'][0].name
  242. - disk_group_name_omnia in pools_diskgroup_info.json['disk-groups'][0].pool
  243. - disk_type_ssdsas in pools_diskgroup_info.json['disk-groups'][0]['disk-description']
  244. - raid1_level in pools_diskgroup_info.json['disk-groups'][0].raidtype
  245. success_msg: "{{ pool_diskgroup_config_success_msg }}"
  246. fail_msg: "{{ pool_diskgroup_config_failure_msg }}"
  247. tags: VERIFY_OMNIA_01
  248. - name: Execute show volumes command for k8s
  249. uri:
  250. url: https://{{ inventory_hostname }}/api/show/volumes/{{ volume_name_k8s_v1 }}
  251. method: GET
  252. body_format: json
  253. validate_certs: no
  254. use_proxy: no
  255. headers:
  256. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  257. register: k8s_volumes_info
  258. tags: VERIFY_OMNIA_01
  259. - name: Execute show volumes command for slurm
  260. uri:
  261. url: https://{{ inventory_hostname }}/api/show/volumes/{{ volume_name_slurm_v1 }}
  262. method: GET
  263. body_format: json
  264. validate_certs: no
  265. use_proxy: no
  266. headers:
  267. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  268. register: slurm_volumes_info
  269. tags: VERIFY_OMNIA_01
  270. - name: Verify the volumes creation
  271. assert:
  272. that:
  273. - volume_name_k8s_v1 in k8s_volumes_info.json.volumes[0]['volume-name']
  274. - volume_size_100gb in k8s_volumes_info.json.volumes[0].size
  275. - volume_name_slurm_v1 in slurm_volumes_info.json.volumes[0]['volume-name']
  276. - volume_size_100gb in slurm_volumes_info.json.volumes[0].size
  277. - disk_group_name_omnia in k8s_volumes_info.json.volumes[0]['storage-pool-name']
  278. success_msg: "{{ volumes_creation_success_msg }}"
  279. fail_msg: "{{ volumes_creation_failure_msg }}"
  280. tags: VERIFY_OMNIA_01
  281. - name: Delete the disk group created
  282. uri:
  283. url: https://{{ inventory_hostname }}/api/remove/disk-groups/{{ disk_group_name_omnia }}
  284. method: GET
  285. body_format: json
  286. validate_certs: no
  287. use_proxy: no
  288. headers:
  289. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  290. register: delete_diskgroup
  291. # Testcase OMNIA_1.1_PV_TC_005
  292. # Test case to validate configuration of pools, disk group and storage volumes with SAS MDL disks, RAID 1 level, storage with rw access
  293. - name: OMNIA_1.1_PV_TC_005
  294. hosts: powervault
  295. connection: local
  296. tags: TC_005
  297. gather_subset:
  298. - 'min'
  299. vars_files:
  300. - test_vars/test_powervault_vars.yml
  301. - ../roles/webui_awx/vars/main.yml
  302. - ../input_params/powervault_me4_vars.yml
  303. - ../input_params/base_vars.yml
  304. tasks:
  305. - name: Set powervault parameters
  306. lineinfile:
  307. path: "{{ powervault_me4_var_path }}"
  308. regexp: "{{ item.regexp }}"
  309. line: "{{ item.line }}"
  310. loop:
  311. - { regexp: '^powervault_me4_pool', line: 'powervault_me4_pool: "{{ pool_a }}"' }
  312. - { regexp: '^powervault_me4_pool_type', line: 'powervault_me4_pool_type: "{{ pool_type }}"' }
  313. - { regexp: '^powervault_me4_disk_group_name', line: 'powervault_me4_disk_group_name: "{{ disk_group_name_omnia_dgA01 }}"' }
  314. - { regexp: '^powervault_me4_raid_levels', line: 'powervault_me4_raid_levels: "{{ raid1_level }}"' }
  315. - { regexp: '^powervault_me4_disk_range', line: 'powervault_me4_disk_range: "{{ disk_range_5_6 }}"' }
  316. - { regexp: '^powervault_me4_k8s_volume_name', line: 'powervault_me4_k8s_volume_name: "{{ volume_name_k8s_v1 }}"' }
  317. - { regexp: '^powervault_me4_slurm_volume_name', line: 'powervault_me4_slurm_volume_name: "{{ volume_name_slurm_v1 }}"' }
  318. - { regexp: '^powervault_me4_volume_size', line: 'powervault_me4_volume_size: "{{ volume_size_input_100gb }}"' }
  319. - name: Execute powervault playbook using AWX collections
  320. vars:
  321. inventory_name: "{{ powervault_inventory_name }}"
  322. template_name: "{{ template_value }}"
  323. job_template_name: "{{ job_name }}"
  324. playbook_path: "{{ powervault_playbook_path }}"
  325. delete_status: false
  326. include_tasks: "{{ awx_script_path }}"
  327. - name: Validate powervault playbook execution output
  328. assert:
  329. that:
  330. - success_job_status in job_status.status
  331. success_msg: "{{ playbook_exec_success_msg }}"
  332. fail_msg: "{{ playbook_exec_fail_msg }}"
  333. changed_when: false
  334. - name: Get session key
  335. uri:
  336. url: https://{{ inventory_hostname }}/api/login/{{ auth_string.stdout | replace(" -", "") }}
  337. method: GET
  338. headers:
  339. {'datatype': 'json'}
  340. validate_certs: no
  341. register: session_key
  342. - name: Execute show disk groups command
  343. uri:
  344. url: https://{{ inventory_hostname }}/api/show/disk-groups/pool/{{ pool_a }}/{{ disk_group_name_omnia_dgA01 }}
  345. method: GET
  346. body_format: json
  347. validate_certs: no
  348. use_proxy: no
  349. headers:
  350. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  351. register: pools_diskgroup_info
  352. - name: Verify the pool and disk group additions
  353. assert:
  354. that:
  355. - pool_type in pools_diskgroup_info.json['disk-groups'][0]['storage-type']
  356. - disk_group_name_omnia_dgA01 in pools_diskgroup_info.json['disk-groups'][0].name
  357. - pool_a in pools_diskgroup_info.json['disk-groups'][0].pool
  358. - disk_type_sasmdl in pools_diskgroup_info.json['disk-groups'][0]['disk-description']
  359. - raid1_level in pools_diskgroup_info.json['disk-groups'][0].raidtype
  360. success_msg: "{{ pool_diskgroup_config_success_msg }}"
  361. fail_msg: "{{ pool_diskgroup_config_failure_msg }}"
  362. - name: Execute show volumes command
  363. uri:
  364. url: https://{{ inventory_hostname }}/api/show/volumes/{{ volume_name_k8s_v1 }}
  365. method: GET
  366. body_format: json
  367. validate_certs: no
  368. use_proxy: no
  369. headers:
  370. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  371. register: k8s_volumes_info
  372. - name: Execute show volumes command
  373. uri:
  374. url: https://{{ inventory_hostname }}/api/show/volumes/{{ volume_name_slurm_v1 }}
  375. method: GET
  376. body_format: json
  377. validate_certs: no
  378. use_proxy: no
  379. headers:
  380. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  381. register: slurm_volumes_info
  382. - name: Verify the volumes creation
  383. assert:
  384. that:
  385. - volume_name_k8s_v1 in k8s_volumes_info.json.volumes[0]['volume-name']
  386. - volume_size_100gb in k8s_volumes_info.json.volumes[0].size
  387. - volume_name_slurm_v1 in slurm_volumes_info.json.volumes[0]['volume-name']
  388. - volume_size_100gb in slurm_volumes_info.json.volumes[0].size
  389. - pool_a in k8s_volumes_info.json.volumes[0]['storage-pool-name']
  390. success_msg: "{{ volumes_creation_success_msg }}"
  391. fail_msg: "{{ volumes_creation_failure_msg }}"
  392. # Testcase OMNIA_1.1_PV_TC_004
  393. # Test case to validate the SNMP trap notification when level is set to none
  394. - name: OMNIA_1.1_PV_TC_004
  395. hosts: powervault
  396. connection: local
  397. tags: TC_004
  398. gather_subset:
  399. - 'min'
  400. vars_files:
  401. - test_vars/test_powervault_vars.yml
  402. - ../input_params/powervault_me4_vars.yml
  403. - ../input_params/base_vars.yml
  404. tasks:
  405. - name: Execute show snmp parameters command
  406. uri:
  407. url: https://{{ inventory_hostname }}/api/show/snmp-parameters
  408. method: GET
  409. body_format: json
  410. validate_certs: no
  411. use_proxy: no
  412. headers:
  413. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  414. register: snmp_trap_info
  415. - name: Verify the snmp trap configuration
  416. assert:
  417. that:
  418. - snmp_notify_status_disable in snmp_trap_info.json['snmp-parameters'][0]['snmp-enabled']
  419. - snmp_notify_level_none in snmp_trap_info.json['snmp-parameters'][0]['snmp-filter']
  420. success_msg: "{{ snmp_trap_success_msg }}"
  421. fail_msg: "{{ snmp_trap_failure_msg }}"
  422. # Testcase OMNIA_1.1_PV_TC_014
  423. # Test case to validate the error mesage when mixed type of disks (SSD SAS and SAS MDL disks) are added to the virtual disk groups
  424. - name: OMNIA_1.1_PV_TC_014
  425. hosts: powervault
  426. connection: local
  427. tags: TC_014
  428. gather_subset:
  429. - 'min'
  430. vars_files:
  431. - test_vars/test_powervault_vars.yml
  432. - ../input_params/powervault_me4_vars.yml
  433. - ../input_params/base_vars.yml
  434. - ../roles/webui_awx/vars/main.yml
  435. tasks:
  436. - name: Set powervault parameters
  437. lineinfile:
  438. path: "{{ powervault_me4_var_path }}"
  439. regexp: "{{ item.regexp }}"
  440. line: "{{ item.line }}"
  441. loop:
  442. - { regexp: '^powervault_me4_pool', line: 'powervault_me4_pool: "{{ pool_a }}"' }
  443. - { regexp: '^powervault_me4_pool_type', line: 'powervault_me4_pool_type: "{{ pool_type }}"' }
  444. - { regexp: '^powervault_me4_disk_group_name', line: 'powervault_me4_disk_group_name: "{{ disk_group_name_omnia_dgA02 }}"' }
  445. - { regexp: '^powervault_me4_raid_levels', line: 'powervault_me4_raid_levels: "{{ raid1_level }}"' }
  446. - { regexp: '^powervault_me4_disk_range', line: 'powervault_me4_disk_range: "{{ disk_range_3_4 }}"' }
  447. - { regexp: '^powervault_me4_k8s_volume_name', line: 'powervault_me4_k8s_volume_name: "{{ volume_name_k8s_v1 }}"' }
  448. - { regexp: '^powervault_me4_slurm_volume_name', line: 'powervault_me4_slurm_volume_name: "{{ volume_name_slurm_v1 }}"' }
  449. - { regexp: '^powervault_me4_volume_size', line: 'powervault_me4_volume_size: "{{ volume_size_input_100gb }}"' }
  450. - name: Execute powervault playbook using AWX collections
  451. vars:
  452. inventory_name: "{{ powervault_inventory_name }}"
  453. template_name: "{{ template_value }}"
  454. job_template_name: "{{ job_name }}"
  455. playbook_path: "{{ powervault_playbook_path }}"
  456. delete_status: false
  457. include_tasks: "{{ awx_script_path }}"
  458. - name: Validate powervault playbook execution output
  459. assert:
  460. that:
  461. - failed_job_status in job_status.status
  462. success_msg: "{{ failed_job_status_success_msg }}"
  463. fail_msg: "{{ playbook_exec_fail_msg }}"
  464. changed_when: false
  465. # Testcase OMNIA_1.1_PV_TC_015
  466. # Test case to validate the error in addition of virtual disk groups when the specified disks are already part of an existing disk group
  467. - name: OMNIA_1.1_PV_TC_015
  468. hosts: powervault
  469. connection: local
  470. tags: TC_015
  471. gather_subset:
  472. - 'min'
  473. vars_files:
  474. - test_vars/test_powervault_vars.yml
  475. - ../input_params/powervault_me4_vars.yml
  476. - ../input_params/base_vars.yml
  477. - ../roles/webui_awx/vars/main.yml
  478. tasks:
  479. - name: Set powervault parameters
  480. lineinfile:
  481. path: "{{ powervault_me4_var_path }}"
  482. regexp: "{{ item.regexp }}"
  483. line: "{{ item.line }}"
  484. loop:
  485. - { regexp: '^powervault_me4_pool', line: 'powervault_me4_pool: "{{ pool_a }}"' }
  486. - { regexp: '^powervault_me4_pool_type', line: 'powervault_me4_pool_type: "{{ pool_type }}"' }
  487. - { regexp: '^powervault_me4_disk_group_name', line: 'powervault_me4_disk_group_name: "{{ disk_group_name_omnia_dgA02 }}"' }
  488. - { regexp: '^powervault_me4_raid_levels', line: 'powervault_me4_raid_levels: "{{ raid1_level }}"' }
  489. - { regexp: '^powervault_me4_disk_range', line: 'powervault_me4_disk_range: "{{ disk_range_5_6 }}"' }
  490. - { regexp: '^powervault_me4_k8s_volume_name', line: 'powervault_me4_k8s_volume_name: "{{ volume_name_k8s_v1 }}"' }
  491. - { regexp: '^powervault_me4_slurm_volume_name', line: 'powervault_me4_slurm_volume_name: "{{ volume_name_slurm_v1 }}"' }
  492. - { regexp: '^powervault_me4_volume_size', line: 'powervault_me4_volume_size: "{{ volume_size_input_100gb }}"' }
  493. - name: Execute powervault playbook using AWX collections
  494. vars:
  495. inventory_name: "{{ powervault_inventory_name }}"
  496. template_name: "{{ template_value }}"
  497. job_template_name: "{{ job_name }}"
  498. playbook_path: "{{ powervault_playbook_path }}"
  499. delete_status: false
  500. include_tasks: "{{ awx_script_path }}"
  501. - name: Validate powervault playbook execution output
  502. assert:
  503. that:
  504. - failed_job_status in job_status.status
  505. success_msg: "{{ failed_job_status_success_msg }}"
  506. fail_msg: "{{ playbook_exec_fail_msg }}"
  507. changed_when: false
  508. # Testcase OMNIA_1.1_PV_TC_016
  509. # Test case to validate error when specified name is already in use while adding disk groups
  510. - name: OMNIA_1.1_PV_TC_016
  511. hosts: powervault
  512. connection: local
  513. tags: TC_016
  514. gather_subset:
  515. - 'min'
  516. vars_files:
  517. - test_vars/test_powervault_vars.yml
  518. - ../input_params/powervault_me4_vars.yml
  519. - ../input_params/base_vars.yml
  520. - ../roles/webui_awx/vars/main.yml
  521. tasks:
  522. - name: Set powervault parameters
  523. lineinfile:
  524. path: "{{ powervault_me4_var_path }}"
  525. regexp: "{{ item.regexp }}"
  526. line: "{{ item.line }}"
  527. loop:
  528. - { regexp: '^powervault_me4_pool', line: 'powervault_me4_pool: "{{ pool_a }}"' }
  529. - { regexp: '^powervault_me4_pool_type', line: 'powervault_me4_pool_type: "{{ pool_type }}"' }
  530. - { regexp: '^powervault_me4_disk_group_name', line: 'powervault_me4_disk_group_name: "{{ disk_group_name_omnia_dgA01 }}"' }
  531. - { regexp: '^powervault_me4_raid_levels', line: 'powervault_me4_raid_levels: "{{ raid1_level }}"' }
  532. - { regexp: '^powervault_me4_disk_range', line: 'powervault_me4_disk_range: "{{ disk_range_2_3 }}"' }
  533. - { regexp: '^powervault_me4_k8s_volume_name', line: 'powervault_me4_k8s_volume_name: "{{ volume_name_k8s_v1 }}"' }
  534. - { regexp: '^powervault_me4_slurm_volume_name', line: 'powervault_me4_slurm_volume_name: "{{ volume_name_slurm_v1 }}"' }
  535. - { regexp: '^powervault_me4_volume_size', line: 'powervault_me4_volume_size: "{{ volume_size_input_100gb }}"' }
  536. - name: Execute powervault playbook using AWX collections
  537. vars:
  538. inventory_name: "{{ powervault_inventory_name }}"
  539. template_name: "{{ template_value }}"
  540. job_template_name: "{{ job_name }}"
  541. playbook_path: "{{ powervault_playbook_path }}"
  542. delete_status: false
  543. include_tasks: "{{ awx_script_path }}"
  544. - name: Validate powervault playbook execution output
  545. assert:
  546. that:
  547. - failed_job_status in job_status.status
  548. success_msg: "{{ failed_job_status_success_msg }}"
  549. fail_msg: "{{ playbook_exec_fail_msg }}"
  550. changed_when: false
  551. # Testcase OMNIA_1.1_PV_TC_017
  552. # Test case to validate error when specified name is already in use while creating volumes
  553. - name: OMNIA_1.1_PV_TC_017
  554. hosts: powervault
  555. connection: local
  556. tags: TC_017
  557. gather_subset:
  558. - 'min'
  559. vars_files:
  560. - test_vars/test_powervault_vars.yml
  561. - ../input_params/powervault_me4_vars.yml
  562. - ../input_params/base_vars.yml
  563. - ../roles/webui_awx/vars/main.yml
  564. tasks:
  565. - name: Set powervault parameters
  566. lineinfile:
  567. path: "{{ powervault_me4_var_path }}"
  568. regexp: "{{ item.regexp }}"
  569. line: "{{ item.line }}"
  570. loop:
  571. - { regexp: '^powervault_me4_pool', line: 'powervault_me4_pool: "{{ pool_a }}"' }
  572. - { regexp: '^powervault_me4_pool_type', line: 'powervault_me4_pool_type: "{{ pool_type }}"' }
  573. - { regexp: '^powervault_me4_disk_group_name', line: 'powervault_me4_disk_group_name: "{{ disk_group_name_omnia_dgA02 }}"' }
  574. - { regexp: '^powervault_me4_raid_levels', line: 'powervault_me4_raid_levels: "{{ raid1_level }}"' }
  575. - { regexp: '^powervault_me4_disk_range', line: 'powervault_me4_disk_range: "{{ disk_range_2_3 }}"' }
  576. - { regexp: '^powervault_me4_k8s_volume_name', line: 'powervault_me4_k8s_volume_name: "{{ volume_name_k8s_v1 }}"' }
  577. - { regexp: '^powervault_me4_slurm_volume_name', line: 'powervault_me4_slurm_volume_name: "{{ volume_name_slurm_v2 }}"' }
  578. - { regexp: '^powervault_me4_volume_size', line: 'powervault_me4_volume_size: "{{ volume_size_input_100gb }}"' }
  579. - name: Execute powervault playbook using AWX collections
  580. vars:
  581. inventory_name: "{{ powervault_inventory_name }}"
  582. template_name: "{{ template_value }}"
  583. job_template_name: "{{ job_name }}"
  584. playbook_path: "{{ powervault_playbook_path }}"
  585. delete_status: false
  586. include_tasks: "{{ awx_script_path }}"
  587. - name: Validate powervault playbook execution output
  588. assert:
  589. that:
  590. - failed_job_status in job_status.status
  591. success_msg: "{{ failed_job_status_success_msg }}"
  592. fail_msg: "{{ playbook_exec_fail_msg }}"
  593. changed_when: false
  594. - name: Get session key
  595. uri:
  596. url: https://{{ inventory_hostname }}/api/login/{{ auth_string.stdout | replace(" -", "") }}
  597. method: GET
  598. headers:
  599. {'datatype': 'json'}
  600. validate_certs: no
  601. register: session_key
  602. - name: Delete the disk group created
  603. uri:
  604. url: https://{{ inventory_hostname }}/api/remove/disk-groups/{{ disk_group_name_omnia_dgA02 }}
  605. method: GET
  606. body_format: json
  607. validate_certs: no
  608. use_proxy: no
  609. headers:
  610. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  611. register: delete_diskgroup
  612. - name: Delete the volumes created
  613. uri:
  614. url: https://{{ inventory_hostname }}/api/delete/volumes/{{ volume_name_slurm_v2 }}
  615. method: GET
  616. body_format: json
  617. validate_certs: no
  618. use_proxy: no
  619. headers:
  620. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  621. register: delete_volumes
  622. # Testcase OMNIA_1.1_PV_TC_012
  623. # Test case to validate error when same name is used for creation of both volumes
  624. - name: OMNIA_1.1_PV_TC_012
  625. hosts: powervault
  626. connection: local
  627. tags: TC_012
  628. gather_subset:
  629. - 'min'
  630. vars_files:
  631. - test_vars/test_powervault_vars.yml
  632. - ../input_params/powervault_me4_vars.yml
  633. - ../input_params/base_vars.yml
  634. - ../roles/webui_awx/vars/main.yml
  635. tasks:
  636. - name: Set powervault parameters
  637. lineinfile:
  638. path: "{{ powervault_me4_var_path }}"
  639. regexp: "{{ item.regexp }}"
  640. line: "{{ item.line }}"
  641. loop:
  642. - { regexp: '^powervault_me4_pool', line: 'powervault_me4_pool: "{{ pool_a }}"' }
  643. - { regexp: '^powervault_me4_pool_type', line: 'powervault_me4_pool_type: "{{ pool_type }}"' }
  644. - { regexp: '^powervault_me4_disk_group_name', line: 'powervault_me4_disk_group_name: "{{ disk_group_name_omnia_dgA02 }}"' }
  645. - { regexp: '^powervault_me4_raid_levels', line: 'powervault_me4_raid_levels: "{{ raid1_level }}"' }
  646. - { regexp: '^powervault_me4_disk_range', line: 'powervault_me4_disk_range: "{{ disk_range_2_3 }}"' }
  647. - { regexp: '^powervault_me4_k8s_volume_name', line: 'powervault_me4_k8s_volume_name: "{{ volume_name_k8s_v2 }}"' }
  648. - { regexp: '^powervault_me4_slurm_volume_name', line: 'powervault_me4_slurm_volume_name: "{{ volume_name_k8s_v2 }}"' }
  649. - { regexp: '^powervault_me4_volume_size', line: 'powervault_me4_volume_size: "{{ volume_size_input_100gb }}"' }
  650. - name: Execute powervault playbook using AWX collections
  651. vars:
  652. inventory_name: "{{ powervault_inventory_name }}"
  653. template_name: "{{ template_value }}"
  654. job_template_name: "{{ job_name }}"
  655. playbook_path: "{{ powervault_playbook_path }}"
  656. delete_status: false
  657. include_tasks: "{{ awx_script_path }}"
  658. - name: Validate powervault playbook execution output
  659. assert:
  660. that:
  661. - failed_job_status in job_status.status
  662. success_msg: "{{ failed_job_status_success_msg }}"
  663. fail_msg: "{{ playbook_exec_fail_msg }}"
  664. changed_when: false
  665. - name: Get session key
  666. uri:
  667. url: https://{{ inventory_hostname }}/api/login/{{ auth_string.stdout | replace(" -", "") }}
  668. method: GET
  669. headers:
  670. {'datatype': 'json'}
  671. validate_certs: no
  672. register: session_key
  673. - name: Delete the disk group created
  674. uri:
  675. url: https://{{ inventory_hostname }}/api/remove/disk-groups/{{ disk_group_name_omnia_dgA02 }}
  676. method: GET
  677. body_format: json
  678. validate_certs: no
  679. use_proxy: no
  680. headers:
  681. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  682. register: delete_diskgroup
  683. - name: Delete the volumes created
  684. uri:
  685. url: https://{{ inventory_hostname }}/api/delete/volumes/{{ volume_name_k8s_v2 }}
  686. method: GET
  687. body_format: json
  688. validate_certs: no
  689. use_proxy: no
  690. headers:
  691. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  692. register: delete_volumes
  693. # Testcase OMNIA_1.1_PV_TC_006
  694. # Test case to validate configuration of pools and disk group with SSD SAS disks, RAID 5 level
  695. - name: OMNIA_1.1_PV_TC_006
  696. hosts: powervault
  697. connection: local
  698. tags: TC_006
  699. gather_subset:
  700. - 'min'
  701. vars_files:
  702. - test_vars/test_powervault_vars.yml
  703. - ../input_params/powervault_me4_vars.yml
  704. - ../input_params/base_vars.yml
  705. - ../roles/webui_awx/vars/main.yml
  706. tasks:
  707. - name: Set powervault parameters
  708. lineinfile:
  709. path: "{{ powervault_me4_var_path }}"
  710. regexp: "{{ item.regexp }}"
  711. line: "{{ item.line }}"
  712. loop:
  713. - { regexp: '^powervault_me4_pool', line: 'powervault_me4_pool: "{{ pool_a }}"' }
  714. - { regexp: '^powervault_me4_pool_type', line: 'powervault_me4_pool_type: "{{ pool_type }}"' }
  715. - { regexp: '^powervault_me4_disk_group_name', line: 'powervault_me4_disk_group_name: "{{ disk_group_name_omnia_dgA02 }}"' }
  716. - { regexp: '^powervault_me4_raid_levels', line: 'powervault_me4_raid_levels: "{{ raid5_level }}"' }
  717. - { regexp: '^powervault_me4_disk_range', line: 'powervault_me4_disk_range: "{{ disk_range_0_2 }}"' }
  718. - { regexp: '^powervault_me4_k8s_volume_name', line: 'powervault_me4_k8s_volume_name: "{{ volume_name_k8s_v2 }}"' }
  719. - { regexp: '^powervault_me4_slurm_volume_name', line: 'powervault_me4_slurm_volume_name: "{{ volume_name_slurm_v2 }}"' }
  720. - { regexp: '^powervault_me4_volume_size', line: 'powervault_me4_volume_size: "{{ volume_size_input_100gb }}"' }
  721. - name: Execute powervault playbook using AWX collections
  722. vars:
  723. inventory_name: "{{ powervault_inventory_name }}"
  724. template_name: "{{ template_value }}"
  725. job_template_name: "{{ job_name }}"
  726. playbook_path: "{{ powervault_playbook_path }}"
  727. delete_status: false
  728. include_tasks: "{{ awx_script_path }}"
  729. - name: Validate powervault playbook execution output
  730. assert:
  731. that:
  732. - success_job_status in job_status.status
  733. success_msg: "{{ playbook_exec_success_msg }}"
  734. fail_msg: "{{ playbook_exec_fail_msg }}"
  735. changed_when: false
  736. - name: Get session key
  737. uri:
  738. url: https://{{ inventory_hostname }}/api/login/{{ auth_string.stdout | replace(" -", "") }}
  739. method: GET
  740. headers:
  741. {'datatype': 'json'}
  742. validate_certs: no
  743. register: session_key
  744. - name: Execute show disk groups command
  745. uri:
  746. url: https://{{ inventory_hostname }}/api/show/disk-groups/pool/{{ pool_a }}/{{ disk_group_name_omnia_dgA02 }}
  747. method: GET
  748. body_format: json
  749. validate_certs: no
  750. use_proxy: no
  751. headers:
  752. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  753. register: pools_diskgroup_info
  754. - name: Verify the pool and disk group additions
  755. assert:
  756. that:
  757. - pool_type in pools_diskgroup_info.json['disk-groups'][0]['storage-type']
  758. - disk_group_name_omnia_dgA02 in pools_diskgroup_info.json['disk-groups'][0].name
  759. - pool_a in pools_diskgroup_info.json['disk-groups'][0].pool
  760. - disk_type_ssdsas in pools_diskgroup_info.json['disk-groups'][0]['disk-description']
  761. - raid5_level in pools_diskgroup_info.json['disk-groups'][0].raidtype
  762. success_msg: "{{ pool_diskgroup_config_success_msg }}"
  763. fail_msg: "{{ pool_diskgroup_config_failure_msg }}"
  764. - name: Delete the disk group created
  765. uri:
  766. url: https://{{ inventory_hostname }}/api/remove/disk-groups/{{ disk_group_name_omnia_dgA02 }}
  767. method: GET
  768. body_format: json
  769. validate_certs: no
  770. use_proxy: no
  771. headers:
  772. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  773. register: delete_diskgroup
  774. - name: Delete the volumes created
  775. uri:
  776. url: https://{{ inventory_hostname }}/api/delete/volumes/{{ volume_name_k8s_v2 }},{{ volume_name_slurm_v2 }}
  777. method: GET
  778. body_format: json
  779. validate_certs: no
  780. use_proxy: no
  781. headers:
  782. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  783. register: delete_volumes
  784. # Testcase OMNIA_1.1_PV_TC_007
  785. # Test case to validate configuration of pools and disk group with SAS MDL disks, RAID 6 level
  786. - name: OMNIA_1.1_PV_TC_007
  787. hosts: powervault
  788. connection: local
  789. tags: TC_007
  790. gather_subset:
  791. - 'min'
  792. vars_files:
  793. - test_vars/test_powervault_vars.yml
  794. - ../input_params/powervault_me4_vars.yml
  795. - ../input_params/base_vars.yml
  796. - ../roles/webui_awx/vars/main.yml
  797. tasks:
  798. - name: Set powervault parameters
  799. lineinfile:
  800. path: "{{ powervault_me4_var_path }}"
  801. regexp: "{{ item.regexp }}"
  802. line: "{{ item.line }}"
  803. loop:
  804. - { regexp: '^powervault_me4_pool', line: 'powervault_me4_pool: "{{ pool_b }}"' }
  805. - { regexp: '^powervault_me4_pool_type', line: 'powervault_me4_pool_type: "{{ pool_type }}"' }
  806. - { regexp: '^powervault_me4_disk_group_name', line: 'powervault_me4_disk_group_name: "{{ disk_group_name_omnia_dgB01 }}"' }
  807. - { regexp: '^powervault_me4_raid_levels', line: 'powervault_me4_raid_levels: "{{ raid6_level }}"' }
  808. - { regexp: '^powervault_me4_disk_range', line: 'powervault_me4_disk_range: "{{ disk_range_7_10 }}"' }
  809. - { regexp: '^powervault_me4_k8s_volume_name', line: 'powervault_me4_k8s_volume_name: "{{ volume_name_k8s_v2 }}"' }
  810. - { regexp: '^powervault_me4_slurm_volume_name', line: 'powervault_me4_slurm_volume_name: "{{ volume_name_slurm_v2 }}"' }
  811. - { regexp: '^powervault_me4_volume_size', line: 'powervault_me4_volume_size: "{{ volume_size_input_100gb }}"' }
  812. - name: Execute powervault playbook using AWX collections
  813. vars:
  814. inventory_name: "{{ powervault_inventory_name }}"
  815. template_name: "{{ template_value }}"
  816. job_template_name: "{{ job_name }}"
  817. playbook_path: "{{ powervault_playbook_path }}"
  818. delete_status: false
  819. include_tasks: "{{ awx_script_path }}"
  820. - name: Validate powervault playbook execution output
  821. assert:
  822. that:
  823. - success_job_status in job_status.status
  824. success_msg: "{{ playbook_exec_success_msg }}"
  825. fail_msg: "{{ playbook_exec_fail_msg }}"
  826. changed_when: false
  827. - name: Get session key
  828. uri:
  829. url: https://{{ inventory_hostname }}/api/login/{{ auth_string.stdout | replace(" -", "") }}
  830. method: GET
  831. headers:
  832. {'datatype': 'json'}
  833. validate_certs: no
  834. register: session_key
  835. - name: Execute show disk groups command
  836. uri:
  837. url: https://{{ inventory_hostname }}/api/show/disk-groups/pool/{{ pool_b }}/{{ disk_group_name_omnia_dgB01 }}
  838. method: GET
  839. body_format: json
  840. validate_certs: no
  841. use_proxy: no
  842. headers:
  843. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  844. register: pools_diskgroup_info
  845. - name: Verify the pool and disk group additions
  846. assert:
  847. that:
  848. - pool_type in pools_diskgroup_info.json['disk-groups'][0]['storage-type']
  849. - disk_group_name_omnia_dgB01 in pools_diskgroup_info.json['disk-groups'][0].name
  850. - pool_b in pools_diskgroup_info.json['disk-groups'][0].pool
  851. - disk_type_sasmdl in pools_diskgroup_info.json['disk-groups'][0]['disk-description']
  852. - raid6_level in pools_diskgroup_info.json['disk-groups'][0].raidtype
  853. success_msg: "{{ pool_diskgroup_config_success_msg }}"
  854. fail_msg: "{{ pool_diskgroup_config_failure_msg }}"
  855. - name: Delete the disk group created
  856. uri:
  857. url: https://{{ inventory_hostname }}/api/remove/disk-groups/{{ disk_group_name_omnia_dgB01 }}
  858. method: GET
  859. body_format: json
  860. validate_certs: no
  861. use_proxy: no
  862. headers:
  863. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  864. register: delete_diskgroup
  865. - name: Delete the volumes created
  866. uri:
  867. url: https://{{ inventory_hostname }}/api/delete/volumes/{{ volume_name_k8s_v2 }},{{ volume_name_slurm_v2 }}
  868. method: GET
  869. body_format: json
  870. validate_certs: no
  871. use_proxy: no
  872. headers:
  873. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  874. register: delete_volumes
  875. # Testcase OMNIA_1.1_PV_TC_008
  876. # Test case to validate configuration of pools and disk group with SAS MDL disks, RAID 10 level
  877. - name: OMNIA_1.1_PV_TC_008
  878. hosts: powervault
  879. connection: local
  880. tags: TC_008
  881. gather_subset:
  882. - 'min'
  883. vars_files:
  884. - test_vars/test_powervault_vars.yml
  885. - ../input_params/powervault_me4_vars.yml
  886. - ../input_params/base_vars.yml
  887. - ../roles/webui_awx/vars/main.yml
  888. tasks:
  889. - name: Set powervault parameters
  890. lineinfile:
  891. path: "{{ powervault_me4_var_path }}"
  892. regexp: "{{ item.regexp }}"
  893. line: "{{ item.line }}"
  894. loop:
  895. - { regexp: '^powervault_me4_pool', line: 'powervault_me4_pool: "{{ pool_b }}"' }
  896. - { regexp: '^powervault_me4_pool_type', line: 'powervault_me4_pool_type: "{{ pool_type }}"' }
  897. - { regexp: '^powervault_me4_disk_group_name', line: 'powervault_me4_disk_group_name: "{{ disk_group_name_omnia_dgB01 }}"' }
  898. - { regexp: '^powervault_me4_raid_levels', line: 'powervault_me4_raid_levels: "{{ raid10_level }}"' }
  899. - { regexp: '^powervault_me4_disk_range', line: 'powervault_me4_disk_range: "{{ disk_range_8_11 }}"' }
  900. - { regexp: '^powervault_me4_k8s_volume_name', line: 'powervault_me4_k8s_volume_name: "{{ volume_name_k8s_v2 }}"' }
  901. - { regexp: '^powervault_me4_slurm_volume_name', line: 'powervault_me4_slurm_volume_name: "{{ volume_name_slurm_v2 }}"' }
  902. - { regexp: '^powervault_me4_volume_size', line: 'powervault_me4_volume_size: "{{ volume_size_input_100gb }}"' }
  903. - name: Execute powervault playbook using AWX collections
  904. vars:
  905. inventory_name: "{{ powervault_inventory_name }}"
  906. template_name: "{{ template_value }}"
  907. job_template_name: "{{ job_name }}"
  908. playbook_path: "{{ powervault_playbook_path }}"
  909. delete_status: false
  910. include_tasks: "{{ awx_script_path }}"
  911. - name: Validate powervault playbook execution output
  912. assert:
  913. that:
  914. - success_job_status in job_status.status
  915. success_msg: "{{ playbook_exec_success_msg }}"
  916. fail_msg: "{{ playbook_exec_fail_msg }}"
  917. changed_when: false
  918. - name: Get session key
  919. uri:
  920. url: https://{{ inventory_hostname }}/api/login/{{ auth_string.stdout | replace(" -", "") }}
  921. method: GET
  922. headers:
  923. {'datatype': 'json'}
  924. validate_certs: no
  925. register: session_key
  926. - name: Execute show disk groups command
  927. uri:
  928. url: https://{{ inventory_hostname }}/api/show/disk-groups/pool/{{ pool_b }}/{{ disk_group_name_omnia_dgB01 }}
  929. method: GET
  930. body_format: json
  931. validate_certs: no
  932. use_proxy: no
  933. headers:
  934. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  935. register: pools_diskgroup_info
  936. - name: Verify the pool and disk group additions
  937. assert:
  938. that:
  939. - pool_type in pools_diskgroup_info.json['disk-groups'][0]['storage-type']
  940. - disk_group_name_omnia_dgB01 in pools_diskgroup_info.json['disk-groups'][0].name
  941. - pool_b in pools_diskgroup_info.json['disk-groups'][0].pool
  942. - disk_type_sasmdl in pools_diskgroup_info.json['disk-groups'][0]['disk-description']
  943. - raid10_level in pools_diskgroup_info.json['disk-groups'][0].raidtype
  944. success_msg: "{{ pool_diskgroup_config_success_msg }}"
  945. fail_msg: "{{ pool_diskgroup_config_failure_msg }}"
  946. - name: Delete the disk group created
  947. uri:
  948. url: https://{{ inventory_hostname }}/api/remove/disk-groups/{{ disk_group_name_omnia_dgB01 }}
  949. method: GET
  950. body_format: json
  951. validate_certs: no
  952. use_proxy: no
  953. headers:
  954. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  955. register: delete_diskgroup
  956. - name: Delete the volumes created
  957. uri:
  958. url: https://{{ inventory_hostname }}/api/delete/volumes/{{ volume_name_k8s_v2 }},{{ volume_name_slurm_v2 }}
  959. method: GET
  960. body_format: json
  961. validate_certs: no
  962. use_proxy: no
  963. headers:
  964. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  965. register: delete_volumes
  966. # Testcase OMNIA_1.1_PV_TC_009
  967. # Test case to validate configuration of pools and disk group with SAS MDL disks, ADAPT level
  968. - name: OMNIA_1.1_PV_TC_009
  969. hosts: powervault
  970. connection: local
  971. tags: TC_009
  972. gather_subset:
  973. - 'min'
  974. vars_files:
  975. - test_vars/test_powervault_vars.yml
  976. - ../input_params/powervault_me4_vars.yml
  977. - ../input_params/base_vars.yml
  978. - ../roles/webui_awx/vars/main.yml
  979. tasks:
  980. - name: Set powervault parameters
  981. lineinfile:
  982. path: "{{ powervault_me4_var_path }}"
  983. regexp: "{{ item.regexp }}"
  984. line: "{{ item.line }}"
  985. loop:
  986. - { regexp: '^powervault_me4_pool', line: 'powervault_me4_pool: "{{ pool_b }}"' }
  987. - { regexp: '^powervault_me4_pool_type', line: 'powervault_me4_pool_type: "{{ pool_type }}"' }
  988. - { regexp: '^powervault_me4_disk_group_name', line: 'powervault_me4_disk_group_name: "{{ disk_group_name_omnia_dgB01 }}"' }
  989. - { regexp: '^powervault_me4_raid_levels', line: 'powervault_me4_raid_levels: "{{ raid_adapt_level }}"' }
  990. - { regexp: '^powervault_me4_disk_range', line: 'powervault_me4_disk_range: "{{ disk_range_0_11 }}"' }
  991. - { regexp: '^powervault_me4_k8s_volume_name', line: 'powervault_me4_k8s_volume_name: "{{ volume_name_k8s_v2 }}"' }
  992. - { regexp: '^powervault_me4_slurm_volume_name', line: 'powervault_me4_slurm_volume_name: "{{ volume_name_slurm_v2 }}"' }
  993. - { regexp: '^powervault_me4_volume_size', line: 'powervault_me4_volume_size: "{{ volume_size_input_100gb }}"' }
  994. - name: Execute powervault playbook using AWX collections
  995. vars:
  996. inventory_name: "{{ powervault_inventory_name }}"
  997. template_name: "{{ template_value }}"
  998. job_template_name: "{{ job_name }}"
  999. playbook_path: "{{ powervault_playbook_path }}"
  1000. delete_status: false
  1001. include_tasks: "{{ awx_script_path }}"
  1002. - name: Validate powervault playbook execution output
  1003. assert:
  1004. that:
  1005. - failed_job_status in job_status.status
  1006. success_msg: "{{ failed_job_status_success_msg }}"
  1007. fail_msg: "{{ playbook_exec_fail_msg }}"
  1008. changed_when: false
  1009. # Testcase OMNIA_1.1_PV_TC_011
  1010. # Test case to validate the success of volume creation when volume size is more than the pool size
  1011. - name: OMNIA_1.1_PV_TC_011
  1012. hosts: powervault
  1013. connection: local
  1014. tags: TC_011
  1015. gather_subset:
  1016. - 'min'
  1017. vars_files:
  1018. - test_vars/test_powervault_vars.yml
  1019. - ../input_params/powervault_me4_vars.yml
  1020. - ../input_params/base_vars.yml
  1021. - ../roles/webui_awx/vars/main.yml
  1022. tasks:
  1023. - name: Get session key
  1024. uri:
  1025. url: https://{{ inventory_hostname }}/api/login/{{ auth_string.stdout | replace(" -", "") }}
  1026. method: GET
  1027. headers:
  1028. {'datatype': 'json'}
  1029. validate_certs: no
  1030. register: session_key
  1031. - name: Execute show disk groups command
  1032. uri:
  1033. url: https://{{ inventory_hostname }}/api/show/pools/{{ pool_a }}
  1034. method: GET
  1035. body_format: json
  1036. validate_certs: no
  1037. use_proxy: no
  1038. headers:
  1039. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  1040. register: pools_info
  1041. - name: Set the volume size
  1042. set_fact:
  1043. volume_size_overcommit: "{{ (pools_info.json['pools'][0]['total-size'] | regex_replace('GB','') | regex_replace('MB','')) | int + 1000 }}GB"
  1044. - name: Set powervault parameters
  1045. lineinfile:
  1046. path: "{{ powervault_me4_var_path }}"
  1047. regexp: "{{ item.regexp }}"
  1048. line: "{{ item.line }}"
  1049. loop:
  1050. - { regexp: '^powervault_me4_pool', line: 'powervault_me4_pool: "{{ pool_a }}"' }
  1051. - { regexp: '^powervault_me4_pool_type', line: 'powervault_me4_pool_type: "{{ pool_type }}"' }
  1052. - { regexp: '^powervault_me4_disk_group_name', line: 'powervault_me4_disk_group_name: "{{ disk_group_name_omnia_dgA02 }}"' }
  1053. - { regexp: '^powervault_me4_raid_levels', line: 'powervault_me4_raid_levels: "{{ raid1_level }}"' }
  1054. - { regexp: '^powervault_me4_disk_range', line: 'powervault_me4_disk_range: "{{ disk_range_2_3 }}"' }
  1055. - { regexp: '^powervault_me4_k8s_volume_name', line: 'powervault_me4_k8s_volume_name: "{{ volume_name_k8s_v2 }}"' }
  1056. - { regexp: '^powervault_me4_slurm_volume_name', line: 'powervault_me4_slurm_volume_name: "{{ volume_name_slurm_v2 }}"' }
  1057. - { regexp: '^powervault_me4_volume_size', line: 'powervault_me4_volume_size: "{{ volume_size_overcommit }}"' }
  1058. - name: Execute powervault playbook using AWX collections
  1059. vars:
  1060. inventory_name: "{{ powervault_inventory_name }}"
  1061. template_name: "{{ template_value }}"
  1062. job_template_name: "{{ job_name }}"
  1063. playbook_path: "{{ powervault_playbook_path }}"
  1064. delete_status: false
  1065. include_tasks: "{{ awx_script_path }}"
  1066. - name: Validate powervault playbook execution output
  1067. assert:
  1068. that:
  1069. - success_job_status in job_status.status
  1070. success_msg: "{{ playbook_exec_success_msg }}"
  1071. fail_msg: "{{ playbook_exec_fail_msg }}"
  1072. changed_when: false
  1073. - name: Execute show k8s volumes command
  1074. uri:
  1075. url: https://{{ inventory_hostname }}/api/show/volumes/{{ volume_name_k8s_v2 }}
  1076. method: GET
  1077. body_format: json
  1078. validate_certs: no
  1079. use_proxy: no
  1080. headers:
  1081. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  1082. register: k8s_volumes_info
  1083. - name: Execute show slurm volumes command
  1084. uri:
  1085. url: https://{{ inventory_hostname }}/api/show/volumes/{{ volume_name_slurm_v2 }}
  1086. method: GET
  1087. body_format: json
  1088. validate_certs: no
  1089. use_proxy: no
  1090. headers:
  1091. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  1092. register: slurm_volumes_info
  1093. - name: Verify the volumes creation
  1094. assert:
  1095. that:
  1096. - volume_name_k8s_v2 in k8s_volumes_info.json.volumes[0]['volume-name']
  1097. - volume_name_slurm_v2 in slurm_volumes_info.json.volumes[0]['volume-name']
  1098. - pool_a in slurm_volumes_info.json.volumes[0]['storage-pool-name']
  1099. success_msg: "{{ volumes_creation_success_msg }}"
  1100. fail_msg: "{{ volumes_creation_failure_msg }}"
  1101. - name: Delete the disk group created
  1102. uri:
  1103. url: https://{{ inventory_hostname }}/api/remove/disk-groups/{{ disk_group_name_omnia_dgA02 }}
  1104. method: GET
  1105. body_format: json
  1106. validate_certs: no
  1107. use_proxy: no
  1108. headers:
  1109. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  1110. register: delete_diskgroup
  1111. - name: Delete the volumes created
  1112. uri:
  1113. url: https://{{ inventory_hostname }}/api/delete/volumes/{{ volume_name_k8s_v2 }},{{ volume_name_slurm_v2 }}
  1114. method: GET
  1115. body_format: json
  1116. validate_certs: no
  1117. use_proxy: no
  1118. headers:
  1119. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  1120. register: delete_volumes
  1121. # Testcase OMNIA_1.1_PV_TC_013
  1122. #Test case to validate the SNMP trap notification when level is set to crit
  1123. - name: OMNIA_1.1_PV_TC_013
  1124. hosts: powervault
  1125. connection: local
  1126. tags: TC_013
  1127. gather_subset:
  1128. - 'min'
  1129. vars_files:
  1130. - test_vars/test_powervault_vars.yml
  1131. - ../input_params/powervault_me4_vars.yml
  1132. - ../input_params/base_vars.yml
  1133. - ../roles/webui_awx/vars/main.yml
  1134. tasks:
  1135. - name: Set base vars parameters
  1136. lineinfile:
  1137. path: "{{ base_var_path }}"
  1138. regexp: "{{ item.regexp }}"
  1139. line: "{{ item.line }}"
  1140. loop:
  1141. - { regexp: '^snmp_trap_destination', line: 'snmp_trap_destination: "{{ snmp_destination }}"' }
  1142. - name: Set powervault parameters
  1143. lineinfile:
  1144. path: "{{ powervault_me4_var_path }}"
  1145. regexp: "{{ item.regexp }}"
  1146. line: "{{ item.line }}"
  1147. loop:
  1148. - { regexp: '^powervault_me4_snmp_notify_level', line: 'powervault_me4_snmp_notify_level: "{{ snmp_notify_level_crit }}"' }
  1149. - { regexp: '^powervault_me4_pool', line: 'powervault_me4_pool: "{{ pool_a }}"' }
  1150. - { regexp: '^powervault_me4_pool_type', line: 'powervault_me4_pool_type: "{{ pool_type }}"' }
  1151. - { regexp: '^powervault_me4_disk_group_name', line: 'powervault_me4_disk_group_name: "{{ disk_group_name_omnia_dgA02 }}"' }
  1152. - { regexp: '^powervault_me4_raid_levels', line: 'powervault_me4_raid_levels: "{{ raid1_level }}"' }
  1153. - { regexp: '^powervault_me4_disk_range', line: 'powervault_me4_disk_range: "{{ disk_range_2_3 }}"' }
  1154. - { regexp: '^powervault_me4_k8s_volume_name', line: 'powervault_me4_k8s_volume_name: "{{ volume_name_k8s_v2 }}"' }
  1155. - { regexp: '^powervault_me4_slurm_volume_name', line: 'powervault_me4_slurm_volume_name: "{{ volume_name_slurm_v2 }}"' }
  1156. - { regexp: '^powervault_me4_volume_size', line: 'powervault_me4_volume_size: "{{ volume_size_input_100gb }}"' }
  1157. - name: Execute powervault playbook using AWX collections
  1158. vars:
  1159. inventory_name: "{{ powervault_inventory_name }}"
  1160. template_name: "{{ template_value }}"
  1161. job_template_name: "{{ job_name }}"
  1162. playbook_path: "{{ powervault_playbook_path }}"
  1163. delete_status: true
  1164. include_tasks: "{{ awx_script_path }}"
  1165. - name: Validate powervault playbook execution output
  1166. assert:
  1167. that:
  1168. - success_job_status in job_status.status
  1169. success_msg: "{{ playbook_exec_success_msg }}"
  1170. fail_msg: "{{ playbook_exec_fail_msg }}"
  1171. changed_when: false
  1172. - name: Get session key
  1173. uri:
  1174. url: https://{{ inventory_hostname }}/api/login/{{ auth_string.stdout | replace(" -", "") }}
  1175. method: GET
  1176. headers:
  1177. {'datatype': 'json'}
  1178. validate_certs: no
  1179. register: session_key
  1180. - name: Execute show snmp parameters command
  1181. uri:
  1182. url: https://{{ inventory_hostname }}/api/show/snmp-parameters
  1183. method: GET
  1184. body_format: json
  1185. validate_certs: no
  1186. use_proxy: no
  1187. headers:
  1188. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  1189. register: snmp_trap_info
  1190. - name: Verify the snmp trap configuration
  1191. assert:
  1192. that:
  1193. - snmp_notify_status_enable in snmp_trap_info.json['snmp-parameters'][0]['snmp-enabled']
  1194. - snmp_notify_level_crit in snmp_trap_info.json['snmp-parameters'][0]['snmp-filter']
  1195. success_msg: "{{ snmp_trap_enable_success_msg }}"
  1196. fail_msg: "{{ snmp_trap_failure_msg }}"
  1197. - name: Delete the disk group created
  1198. uri:
  1199. url: https://{{ inventory_hostname }}/api/remove/disk-groups/{{ disk_group_name_omnia_dgA02 }}
  1200. method: GET
  1201. body_format: json
  1202. validate_certs: no
  1203. use_proxy: no
  1204. headers:
  1205. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  1206. register: delete_diskgroup
  1207. - name: Delete the volumes created
  1208. uri:
  1209. url: https://{{ inventory_hostname }}/api/delete/volumes/{{ volume_name_k8s_v2 }},{{ volume_name_slurm_v2 }}
  1210. method: GET
  1211. body_format: json
  1212. validate_certs: no
  1213. use_proxy: no
  1214. headers:
  1215. {'sessionKey': "{{ session_key.json.status[0].response }}", 'datatype':'json'}
  1216. register: delete_volumes