test_common.yml 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882
  1. # Copyright 2020 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_DIO_US_DVC_TC_001
  16. # Execute common role in management station with os installed centos 7.9
  17. - name: OMNIA_DIO_US_DVC_TC_001
  18. hosts: localhost
  19. connection: local
  20. gather_subset:
  21. - 'min'
  22. vars_files:
  23. - test_vars/test_common_vars.yml
  24. - ../roles/common/vars/main.yml
  25. tasks:
  26. - name: Check OS support
  27. fail:
  28. msg: "{{ os_status }}"
  29. when: not(ansible_distribution == os_name and ansible_distribution_version >= os_version)
  30. tags: TC_001
  31. - name: Delete docker volume
  32. docker_volume:
  33. name: "{{ docker_volume_name }}"
  34. state: absent
  35. tags: TC_001
  36. - block:
  37. - name: Call common role
  38. include_role:
  39. name: ../roles/common
  40. vars:
  41. input_config_filename: "{{ test_input_config_filename }}"
  42. tags: TC_001
  43. - name: Fetch package installed
  44. package_facts:
  45. manager: auto
  46. tags: TC_001,VERIFY_001
  47. - name: Verify all required packages is installed
  48. assert:
  49. that: "'{{ item }}' in ansible_facts.packages"
  50. success_msg: "{{ install_package_success_msg }}"
  51. fail_msg: "{{ install_package_fail_msg }}"
  52. when: "'python-docker' not in item"
  53. with_items: "{{ common_packages }}"
  54. tags: TC_001,VERIFY_001
  55. - name: Verify python-docker-py package is installed
  56. assert:
  57. that: "'python-docker-py' in ansible_facts.packages"
  58. success_msg: "{{ install_package_success_msg }}"
  59. fail_msg: "{{ install_package_fail_msg }}"
  60. tags: TC_001,VERIFY_001
  61. - name: Fetching docker volume info
  62. docker_volume_info:
  63. name: "{{ docker_volume_name }}"
  64. register: docker_volume_status
  65. tags: TC_001,VERIFY_001
  66. - name: Validate docker volume
  67. assert:
  68. that: docker_volume_status.exists
  69. fail_msg: "{{ docker_volume_fail_msg }}"
  70. success_msg: "{{ docker_volume_success_msg }}"
  71. tags: TC_001,VERIFY_001
  72. - name: Check input config file is encrypted
  73. command: cat {{ test_input_config_filename }}
  74. changed_when: false
  75. register: config_content
  76. tags: TC_001,VERIFY_001
  77. - name: Validate input config file is encypted or not
  78. assert:
  79. that: "'$ANSIBLE_VAULT;' in config_content.stdout"
  80. fail_msg: "{{ input_config_fail_msg }}"
  81. success_msg: "{{ input_config_success_msg }}"
  82. tags: TC_001,VERIFY_001
  83. # Testcase OMNIA_DIO_US_DVC_TC_002
  84. # Execute common role in management station with docker volume omnia-storage already present
  85. - name: OMNIA_DIO_US_DVC_TC_002
  86. hosts: localhost
  87. connection: local
  88. gather_subset:
  89. - 'min'
  90. vars_files:
  91. - test_vars/test_common_vars.yml
  92. - ../roles/common/vars/main.yml
  93. tasks:
  94. - block:
  95. - name: Call common role
  96. include_role:
  97. name: ../roles/common
  98. vars:
  99. input_config_filename: "{{ test_input_config_filename }}"
  100. tags: TC_002
  101. - name: Fetch package installed
  102. package_facts:
  103. manager: auto
  104. tags: TC_002,VERIFY_002
  105. - name: Verify all required packages is installed
  106. assert:
  107. that: "'{{ item }}' in ansible_facts.packages"
  108. success_msg: "{{ install_package_success_msg }}"
  109. fail_msg: "{{ install_package_fail_msg }}"
  110. when: "'python-docker' not in item"
  111. with_items: "{{ common_packages }}"
  112. tags: TC_002,VERIFY_002
  113. - name: Verify python-docker-py package is installed
  114. assert:
  115. that: "'python-docker-py' in ansible_facts.packages"
  116. success_msg: "{{ install_package_success_msg }}"
  117. fail_msg: "{{ install_package_fail_msg }}"
  118. tags: TC_002,VERIFY_002
  119. - name: Fetching docker volume info
  120. docker_volume_info:
  121. name: "{{ docker_volume_name }}"
  122. register: docker_volume_status
  123. tags: TC_002,VERIFY_002
  124. - name: Validate docker volume
  125. assert:
  126. that: docker_volume_status.exists
  127. fail_msg: "{{ docker_volume_fail_msg }}"
  128. success_msg: "{{ docker_volume_success_msg }}"
  129. tags: TC_002,VERIFY_002
  130. - name: Check input config file is encrypted
  131. command: cat {{ test_input_config_filename }}
  132. changed_when: false
  133. register: config_content
  134. tags: TC_002,VERIFY_002
  135. - name: Validate input config file is encypted or not
  136. assert:
  137. that: "'$ANSIBLE_VAULT;' in config_content.stdout"
  138. fail_msg: "{{ input_config_fail_msg }}"
  139. success_msg: "{{ input_config_success_msg }}"
  140. tags: TC_002,VERIFY_002
  141. # Testcase OMNIA_DIO_US_DVC_TC_003
  142. # Execute common role in management station with os installed different than centos 7.9
  143. - name: OMNIA_DIO_US_DVC_TC_003
  144. hosts: localhost
  145. connection: local
  146. gather_subset:
  147. - 'min'
  148. vars_files:
  149. - test_vars/test_common_vars.yml
  150. - ../roles/common/vars/main.yml
  151. tasks:
  152. - block:
  153. - name: Call common role
  154. include_role:
  155. name: ../roles/common
  156. vars:
  157. input_config_filename: "{{ test_input_config_filename }}"
  158. ansible_distribution_version: "{{ centos_version }}"
  159. rescue:
  160. - name: Validate OS check failure message
  161. assert:
  162. that: os_status in os_value.msg
  163. success_msg: "{{ os_check_success_msg }}"
  164. fail_msg: "{{ os_check_fail_msg }}"
  165. tags: TC_003
  166. # Testcase OMNIA_DIO_US_DVC_TC_004
  167. # Execute common role in management station without internet connectivity
  168. - name: OMNIA_DIO_US_DVC_TC_004
  169. hosts: localhost
  170. connection: local
  171. gather_subset:
  172. - 'min'
  173. vars_files:
  174. - test_vars/test_common_vars.yml
  175. - ../roles/common/vars/main.yml
  176. tasks:
  177. - name: Down internet connectivity
  178. lineinfile:
  179. path: /etc/hosts
  180. line: "172.16.0.5 github.com"
  181. state: present
  182. backup: yes
  183. tags: TC_004
  184. - block:
  185. - name: Call common role
  186. include_role:
  187. name: ../roles/common
  188. vars:
  189. input_config_filename: "{{ test_input_config_filename }}"
  190. rescue:
  191. - name: Validate internet connectivity failure message
  192. assert:
  193. that: internet_status in internet_value.msg
  194. success_msg: "{{ internet_check_success_msg }}"
  195. fail_msg: "{{ internet_check_fail_msg }}"
  196. tags: TC_004
  197. - name: Up internet connectivity
  198. lineinfile:
  199. path: /etc/hosts
  200. line: "172.16.0.5 github.com"
  201. state: absent
  202. tags: TC_004
  203. # Testcase OMNIA_DIO_US_DVC_TC_005
  204. # Execute common role in management station with different user than root
  205. - name: OMNIA_DIO_US_DVC_TC_005
  206. hosts: localhost
  207. connection: local
  208. gather_subset:
  209. - 'min'
  210. vars_files:
  211. - test_vars/test_common_vars.yml
  212. tasks:
  213. - name: Create temp user
  214. user:
  215. name: temp
  216. tags: TC_005
  217. - block:
  218. - name: Execute playbook with different user
  219. command: ansible-playbook ../appliance.yml --become-user=temp -e "input_config_filename=test/input_config_test.yml"
  220. register: temp_user_output
  221. rescue:
  222. - name: Validate the different user execution failure message
  223. assert:
  224. that:
  225. - '"FAILED" in temp_user_output.stdout'
  226. - '"This command has to be run under the root user" in temp_user_output.stdout'
  227. success_msg: "{{ different_user_check_success_msg }}"
  228. fail_msg: "{{ different_user_check_fail_msg }}"
  229. tags: TC_005
  230. - name: Remove temp user
  231. user:
  232. name: temp
  233. state: absent
  234. remove: yes
  235. tags: TC_005
  236. # Testcase OMNIA_DIO_US_DVC_TC_006
  237. # Execute common role in management station with selinux enabled.
  238. - name: OMNIA_DIO_US_DVC_TC_006
  239. hosts: localhost
  240. connection: local
  241. gather_subset:
  242. - 'min'
  243. vars_files:
  244. - test_vars/test_common_vars.yml
  245. - ../roles/common/vars/main.yml
  246. tasks:
  247. - name: Enable selinux
  248. selinux:
  249. policy: targeted
  250. state: enforcing
  251. when: ansible_selinux.status == "disabled"
  252. tags: TC_006
  253. - name: Reboot localhost
  254. command: reboot
  255. when: ansible_selinux.status == "disabled"
  256. tags: TC_006
  257. - block:
  258. - name: Call common role
  259. include_role:
  260. name: ../roles/common
  261. vars:
  262. input_config_filename: "{{ test_input_config_filename }}"
  263. rescue:
  264. - name: Validate selinux failure message
  265. assert:
  266. that: selinux_status in selinux_value.msg
  267. success_msg: "{{ selinux_check_success_msg }}"
  268. fail_msg: "{{ selinux_check_fail_msg }}"
  269. tags: TC_006
  270. - name: Disable selinux
  271. selinux:
  272. state: disabled
  273. tags: TC_006
  274. # Testcase OMNIA_DIO_US_DVC_TC_007
  275. # Execute common role in management station with all input paramter as empty
  276. - name: OMNIA_DIO_US_DVC_TC_007
  277. hosts: localhost
  278. connection: local
  279. gather_subset:
  280. - 'min'
  281. vars_files:
  282. - test_vars/test_common_vars.yml
  283. - ../roles/common/vars/main.yml
  284. tasks:
  285. - block:
  286. - name: Call common role
  287. include_role:
  288. name: ../roles/common
  289. tasks_from: "{{ password_config_file }}"
  290. vars:
  291. input_config_filename: "{{ empty_input_config_filename }}"
  292. rescue:
  293. - name: Validate error
  294. assert:
  295. that: input_config_failure_msg in input_config_check.msg
  296. success_msg: "{{ input_config_check_success_msg }}"
  297. fail_msg: "{{ input_config_check_fail_msg }}"
  298. tags: TC_007
  299. # Testcase OMNIA_DIO_US_DVC_TC_008
  300. # Execute common role in management station with provision_password as empty
  301. - name: OMNIA_DIO_US_DVC_TC_008
  302. hosts: localhost
  303. connection: local
  304. gather_subset:
  305. - 'min'
  306. vars_files:
  307. - test_vars/test_common_vars.yml
  308. - ../roles/common/vars/main.yml
  309. tasks:
  310. - name: Delete "{{ new_input_config_filename }}"
  311. file:
  312. path: "{{ new_input_config_filename }}"
  313. state: absent
  314. tags: TC_008
  315. - name: Copy "{{ empty_input_config_filename }}" to new file
  316. copy:
  317. src: "{{ empty_input_config_filename }}"
  318. dest: "{{ new_input_config_filename }}"
  319. tags: TC_008
  320. - name: Edit "{{ new_input_config_filename }}"
  321. replace:
  322. path: "{{ new_input_config_filename }}"
  323. regexp: "{{ item.regexp }}"
  324. replace: "{{ item.replace }}"
  325. with_items:
  326. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  327. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  328. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  329. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  330. tags: TC_008
  331. - block:
  332. - name: Call common role
  333. include_role:
  334. name: ../roles/common
  335. tasks_from: "{{ password_config_file }}"
  336. vars:
  337. input_config_filename: "{{ new_input_config_filename }}"
  338. rescue:
  339. - name: Validate error
  340. assert:
  341. that: input_config_failure_msg in input_config_check.msg
  342. success_msg: "{{ input_config_check_success_msg }}"
  343. fail_msg: "{{ input_config_check_fail_msg }}"
  344. tags: TC_008
  345. - name: Delete "{{ new_input_config_filename }}"
  346. file:
  347. path: "{{ new_input_config_filename }}"
  348. state: absent
  349. tags: TC_008
  350. # Testcase OMNIA_DIO_US_DVC_TC_009
  351. # Execute common role in management station with awx_password as empty
  352. - name: OMNIA_DIO_US_DVC_TC_009
  353. hosts: localhost
  354. connection: local
  355. gather_subset:
  356. - 'min'
  357. vars_files:
  358. - test_vars/test_common_vars.yml
  359. - ../roles/common/vars/main.yml
  360. tasks:
  361. - name: Delete "{{ new_input_config_filename }}"
  362. file:
  363. path: "{{ new_input_config_filename }}"
  364. state: absent
  365. tags: TC_009
  366. - name: Copy "{{ empty_input_config_filename }}" to new file
  367. copy:
  368. src: "{{ empty_input_config_filename }}"
  369. dest: "{{ new_input_config_filename }}"
  370. tags: TC_009
  371. - name: Edit "{{ new_input_config_filename }}"
  372. replace:
  373. path: "{{ new_input_config_filename }}"
  374. regexp: "{{ item.regexp }}"
  375. replace: "{{ item.replace }}"
  376. with_items:
  377. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  378. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  379. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  380. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  381. tags: TC_009
  382. - block:
  383. - name: Call common role
  384. include_role:
  385. name: ../roles/common
  386. tasks_from: "{{ password_config_file }}"
  387. vars:
  388. input_config_filename: "{{ new_input_config_filename }}"
  389. rescue:
  390. - name: Validate error
  391. assert:
  392. that: input_config_failure_msg in input_config_check.msg
  393. success_msg: "{{ input_config_check_success_msg }}"
  394. fail_msg: "{{ input_config_check_fail_msg }}"
  395. tags: TC_009
  396. - name: Delete "{{ new_input_config_filename }}"
  397. file:
  398. path: "{{ new_input_config_filename }}"
  399. state: absent
  400. tags: TC_009
  401. # Testcase OMNIA_DIO_US_DVC_TC_010
  402. # Execute common role in management station with iso_file_path as empty
  403. - name: OMNIA_DIO_US_DVC_TC_010
  404. hosts: localhost
  405. connection: local
  406. gather_subset:
  407. - 'min'
  408. vars_files:
  409. - test_vars/test_common_vars.yml
  410. - ../roles/common/vars/main.yml
  411. tasks:
  412. - name: Delete "{{ new_input_config_filename }}"
  413. file:
  414. path: "{{ new_input_config_filename }}"
  415. state: absent
  416. tags: TC_010
  417. - name: Copy "{{ empty_input_config_filename }}" to new file
  418. copy:
  419. src: "{{ empty_input_config_filename }}"
  420. dest: "{{ new_input_config_filename }}"
  421. tags: TC_010
  422. - name: Edit "{{ new_input_config_filename }}"
  423. replace:
  424. path: "{{ new_input_config_filename }}"
  425. regexp: "{{ item.regexp }}"
  426. replace: "{{ item.replace }}"
  427. with_items:
  428. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  429. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  430. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  431. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  432. tags: TC_010
  433. - block:
  434. - name: Call common role
  435. include_role:
  436. name: ../roles/common
  437. tasks_from: "{{ password_config_file }}"
  438. vars:
  439. input_config_filename: "{{ new_input_config_filename }}"
  440. rescue:
  441. - name: Validate error
  442. assert:
  443. that: input_config_failure_msg in input_config_check.msg
  444. success_msg: "{{ input_config_check_success_msg }}"
  445. fail_msg: "{{ input_config_check_fail_msg }}"
  446. tags: TC_010
  447. - name: Delete "{{ new_input_config_filename }}"
  448. file:
  449. path: "{{ new_input_config_filename }}"
  450. state: absent
  451. tags: TC_010
  452. # Testcase OMNIA_DIO_US_DVC_TC_011
  453. # Execute common role in management station with provision_password of more than 31 characters
  454. - name: OMNIA_DIO_US_DVC_TC_011
  455. hosts: localhost
  456. connection: local
  457. gather_subset:
  458. - 'min'
  459. vars_files:
  460. - test_vars/test_common_vars.yml
  461. - ../roles/common/vars/main.yml
  462. tasks:
  463. - name: Delete "{{ new_input_config_filename }}"
  464. file:
  465. path: "{{ new_input_config_filename }}"
  466. state: absent
  467. tags: TC_011
  468. - name: Copy "{{ empty_input_config_filename }}" to new file
  469. copy:
  470. src: "{{ empty_input_config_filename }}"
  471. dest: "{{ new_input_config_filename }}"
  472. tags: TC_011
  473. - name: Edit "{{ new_input_config_filename }}"
  474. replace:
  475. path: "{{ new_input_config_filename }}"
  476. regexp: "{{ item.regexp }}"
  477. replace: "{{ item.replace }}"
  478. with_items:
  479. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ long_password }}\"" }
  480. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  481. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  482. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  483. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  484. tags: TC_011
  485. - block:
  486. - name: Call common role
  487. include_role:
  488. name: ../roles/common
  489. tasks_from: "{{ password_config_file }}"
  490. vars:
  491. input_config_filename: "{{ new_input_config_filename }}"
  492. rescue:
  493. - name: Validate error
  494. assert:
  495. that: fail_msg_provision_password in cobbler_password_check.msg
  496. success_msg: "{{ input_config_check_success_msg }}"
  497. fail_msg: "{{ input_config_check_fail_msg }}"
  498. tags: TC_011
  499. - name: Delete "{{ new_input_config_filename }}"
  500. file:
  501. path: "{{ new_input_config_filename }}"
  502. state: absent
  503. tags: TC_011
  504. # Testcase OMNIA_DIO_US_DVC_TC_012
  505. # Execute common role in management station with provision_password as string contains white spaces
  506. - name: OMNIA_DIO_US_DVC_TC_012
  507. hosts: localhost
  508. connection: local
  509. gather_subset:
  510. - 'min'
  511. vars_files:
  512. - test_vars/test_common_vars.yml
  513. - ../roles/common/vars/main.yml
  514. tasks:
  515. - name: Delete "{{ new_input_config_filename }}"
  516. file:
  517. path: "{{ new_input_config_filename }}"
  518. state: absent
  519. tags: TC_012
  520. - name: Copy "{{ empty_input_config_filename }}" to new file
  521. copy:
  522. src: "{{ empty_input_config_filename }}"
  523. dest: "{{ new_input_config_filename }}"
  524. tags: TC_012
  525. - name: Edit "{{ new_input_config_filename }}"
  526. replace:
  527. path: "{{ new_input_config_filename }}"
  528. regexp: "{{ item.regexp }}"
  529. replace: "{{ item.replace }}"
  530. with_items:
  531. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ white_space_password }}\"" }
  532. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  533. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  534. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  535. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  536. tags: TC_012
  537. - block:
  538. - name: Call common role
  539. include_role:
  540. name: ../roles/common
  541. tasks_from: "{{ password_config_file }}"
  542. vars:
  543. input_config_filename: "{{ new_input_config_filename }}"
  544. always:
  545. - name: Validate success message
  546. assert:
  547. that: success_msg_provision_password in cobbler_password_check.msg
  548. success_msg: "{{ input_config_check_success_msg }}"
  549. fail_msg: "{{ input_config_check_fail_msg }}"
  550. tags: TC_012
  551. - name: Delete "{{ new_input_config_filename }}"
  552. file:
  553. path: "{{ new_input_config_filename }}"
  554. state: absent
  555. tags: TC_012
  556. # Testcase OMNIA_DIO_US_DVC_TC_013
  557. # Execute common role in management station with provision_password as string contains characters like '/' and '-'
  558. - name: OMNIA_DIO_US_DVC_TC_013
  559. hosts: localhost
  560. connection: local
  561. gather_subset:
  562. - 'min'
  563. vars_files:
  564. - test_vars/test_common_vars.yml
  565. - ../roles/common/vars/main.yml
  566. tasks:
  567. - name: Delete "{{ new_input_config_filename }}"
  568. file:
  569. path: "{{ new_input_config_filename }}"
  570. state: absent
  571. tags: TC_013
  572. - name: Copy "{{ empty_input_config_filename }}" to new file
  573. copy:
  574. src: "{{ empty_input_config_filename }}"
  575. dest: "{{ new_input_config_filename }}"
  576. tags: TC_013
  577. - name: Edit "{{ new_input_config_filename }}"
  578. replace:
  579. path: "{{ new_input_config_filename }}"
  580. regexp: "{{ item.regexp }}"
  581. replace: "{{ item.replace }}"
  582. with_items:
  583. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ special_character_password1 }}\"" }
  584. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  585. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  586. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  587. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  588. tags: TC_013
  589. - block:
  590. - name: Call common role
  591. include_role:
  592. name: ../roles/common
  593. tasks_from: "{{ password_config_file }}"
  594. vars:
  595. input_config_filename: "{{ new_input_config_filename }}"
  596. rescue:
  597. - name: Validate error
  598. assert:
  599. that: fail_msg_provision_password in cobbler_password_check.msg
  600. success_msg: "{{ input_config_check_success_msg }}"
  601. fail_msg: "{{ input_config_check_fail_msg }}"
  602. tags: TC_013
  603. - name: Delete "{{ new_input_config_filename }}"
  604. file:
  605. path: "{{ new_input_config_filename }}"
  606. state: absent
  607. tags: TC_013
  608. # Testcase OMNIA_DIO_US_DVC_TC_014
  609. # Execute common role in management station with provision_password as string contains special characters other than '-', '/'
  610. - name: OMNIA_DIO_US_DVC_TC_014
  611. hosts: localhost
  612. connection: local
  613. gather_subset:
  614. - 'min'
  615. vars_files:
  616. - test_vars/test_common_vars.yml
  617. - ../roles/common/vars/main.yml
  618. tasks:
  619. - name: Delete "{{ new_input_config_filename }}"
  620. file:
  621. path: "{{ new_input_config_filename }}"
  622. state: absent
  623. tags: TC_014
  624. - name: Copy "{{ empty_input_config_filename }}" to new file
  625. copy:
  626. src: "{{ empty_input_config_filename }}"
  627. dest: "{{ new_input_config_filename }}"
  628. tags: TC_014
  629. - name: Edit "{{ new_input_config_filename }}"
  630. replace:
  631. path: "{{ new_input_config_filename }}"
  632. regexp: "{{ item.regexp }}"
  633. replace: "{{ item.replace }}"
  634. with_items:
  635. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ special_character_password2 }}\"" }
  636. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  637. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  638. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  639. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  640. tags: TC_014
  641. - block:
  642. - name: Call common role
  643. include_role:
  644. name: ../roles/common
  645. tasks_from: "{{ password_config_file }}"
  646. vars:
  647. input_config_filename: "{{ new_input_config_filename }}"
  648. always:
  649. - name: Validate success message
  650. assert:
  651. that: success_msg_provision_password in cobbler_password_check.msg
  652. success_msg: "{{ input_config_check_success_msg }}"
  653. fail_msg: "{{ input_config_check_fail_msg }}"
  654. tags: TC_014
  655. - name: Delete "{{ new_input_config_filename }}"
  656. file:
  657. path: "{{ new_input_config_filename }}"
  658. state: absent
  659. tags: TC_014
  660. # Testcase OMNIA_DIO_US_DVC_TC_015
  661. # Execute common role in management station with awx_password of more than 31 characters
  662. - name: OMNIA_DIO_US_DVC_TC_015
  663. hosts: localhost
  664. connection: local
  665. gather_subset:
  666. - 'min'
  667. vars_files:
  668. - test_vars/test_common_vars.yml
  669. - ../roles/common/vars/main.yml
  670. tasks:
  671. - name: Delete "{{ new_input_config_filename }}"
  672. file:
  673. path: "{{ new_input_config_filename }}"
  674. state: absent
  675. tags: TC_015
  676. - name: Copy "{{ empty_input_config_filename }}" to new file
  677. copy:
  678. src: "{{ empty_input_config_filename }}"
  679. dest: "{{ new_input_config_filename }}"
  680. tags: TC_015
  681. - name: Edit "{{ new_input_config_filename }}"
  682. replace:
  683. path: "{{ new_input_config_filename }}"
  684. regexp: "{{ item.regexp }}"
  685. replace: "{{ item.replace }}"
  686. with_items:
  687. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ long_password }}\"" }
  688. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  689. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  690. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  691. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  692. tags: TC_015
  693. - block:
  694. - name: Call common role
  695. include_role:
  696. name: ../roles/common
  697. tasks_from: "{{ password_config_file }}"
  698. vars:
  699. input_config_filename: "{{ new_input_config_filename }}"
  700. rescue:
  701. - name: Validate error
  702. assert:
  703. that: fail_msg_awx_password in awx_password_check.msg
  704. success_msg: "{{ input_config_check_success_msg }}"
  705. fail_msg: "{{ input_config_check_fail_msg }}"
  706. tags: TC_015
  707. - name: Delete "{{ new_input_config_filename }}"
  708. file:
  709. path: "{{ new_input_config_filename }}"
  710. state: absent
  711. tags: TC_015
  712. # Testcase OMNIA_DIO_US_DVC_TC_016
  713. # Execute common role in management station with awx_password as string contains white spaces
  714. - name: OMNIA_DIO_US_DVC_TC_016
  715. hosts: localhost
  716. connection: local
  717. gather_subset:
  718. - 'min'
  719. vars_files:
  720. - test_vars/test_common_vars.yml
  721. - ../roles/common/vars/main.yml
  722. tasks:
  723. - name: Delete "{{ new_input_config_filename }}"
  724. file:
  725. path: "{{ new_input_config_filename }}"
  726. state: absent
  727. tags: TC_016
  728. - name: Copy "{{ empty_input_config_filename }}" to new file
  729. copy:
  730. src: "{{ empty_input_config_filename }}"
  731. dest: "{{ new_input_config_filename }}"
  732. tags: TC_016
  733. - name: Edit "{{ new_input_config_filename }}"
  734. replace:
  735. path: "{{ new_input_config_filename }}"
  736. regexp: "{{ item.regexp }}"
  737. replace: "{{ item.replace }}"
  738. with_items:
  739. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ white_space_password }}\"" }
  740. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  741. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  742. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  743. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  744. tags: TC_016
  745. - block:
  746. - name: Call common role
  747. include_role:
  748. name: ../roles/common
  749. tasks_from: "{{ password_config_file }}"
  750. vars:
  751. input_config_filename: "{{ new_input_config_filename }}"
  752. always:
  753. - name: Validate success message
  754. assert:
  755. that: success_msg_awx_password in awx_password_check.msg
  756. success_msg: "{{ input_config_check_success_msg }}"
  757. fail_msg: "{{ input_config_check_fail_msg }}"
  758. tags: TC_016
  759. - name: Delete "{{ new_input_config_filename }}"
  760. file:
  761. path: "{{ new_input_config_filename }}"
  762. state: absent
  763. tags: TC_016
  764. # Testcase OMNIA_DIO_US_DVC_TC_017
  765. # Execute common role in management station with awx_password as string contains characters like '/' and '-'
  766. - name: OMNIA_DIO_US_DVC_TC_017
  767. hosts: localhost
  768. connection: local
  769. gather_subset:
  770. - 'min'
  771. vars_files:
  772. - test_vars/test_common_vars.yml
  773. - ../roles/common/vars/main.yml
  774. tasks:
  775. - name: Delete "{{ new_input_config_filename }}"
  776. file:
  777. path: "{{ new_input_config_filename }}"
  778. state: absent
  779. tags: TC_017
  780. - name: Copy "{{ empty_input_config_filename }}" to new file
  781. copy:
  782. src: "{{ empty_input_config_filename }}"
  783. dest: "{{ new_input_config_filename }}"
  784. tags: TC_017
  785. - name: Edit "{{ new_input_config_filename }}"
  786. replace:
  787. path: "{{ new_input_config_filename }}"
  788. regexp: "{{ item.regexp }}"
  789. replace: "{{ item.replace }}"
  790. with_items:
  791. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ special_character_password1 }}\"" }
  792. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  793. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  794. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  795. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  796. tags: TC_017
  797. - block:
  798. - name: Call common role
  799. include_role:
  800. name: ../roles/common
  801. tasks_from: "{{ password_config_file }}"
  802. vars:
  803. input_config_filename: "{{ new_input_config_filename }}"
  804. rescue:
  805. - name: Validate error
  806. assert:
  807. that: fail_msg_awx_password in awx_password_check.msg
  808. success_msg: "{{ input_config_check_success_msg }}"
  809. fail_msg: "{{ input_config_check_fail_msg }}"
  810. tags: TC_017
  811. - name: Delete "{{ new_input_config_filename }}"
  812. file:
  813. path: "{{ new_input_config_filename }}"
  814. state: absent
  815. tags: TC_017
  816. # Testcase OMNIA_DIO_US_DVC_TC_018
  817. # Execute common role in management station with awx_password as string contains special characters other than '-', '/'
  818. - name: OMNIA_DIO_US_DVC_TC_018
  819. hosts: localhost
  820. connection: local
  821. gather_subset:
  822. - 'min'
  823. vars_files:
  824. - test_vars/test_common_vars.yml
  825. - ../roles/common/vars/main.yml
  826. tasks:
  827. - name: Delete "{{ new_input_config_filename }}"
  828. file:
  829. path: "{{ new_input_config_filename }}"
  830. state: absent
  831. tags: TC_018
  832. - name: Copy "{{ empty_input_config_filename }}" to new file
  833. copy:
  834. src: "{{ empty_input_config_filename }}"
  835. dest: "{{ new_input_config_filename }}"
  836. tags: TC_018
  837. - name: Edit "{{ new_input_config_filename }}"
  838. replace:
  839. path: "{{ new_input_config_filename }}"
  840. regexp: "{{ item.regexp }}"
  841. replace: "{{ item.replace }}"
  842. with_items:
  843. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ special_character_password2 }}\"" }
  844. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  845. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  846. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  847. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  848. tags: TC_018
  849. - block:
  850. - name: Call common role
  851. include_role:
  852. name: ../roles/common
  853. tasks_from: "{{ password_config_file }}"
  854. vars:
  855. input_config_filename: "{{ new_input_config_filename }}"
  856. always:
  857. - name: Validate success message
  858. assert:
  859. that: success_msg_awx_password in awx_password_check.msg
  860. success_msg: "{{ input_config_check_success_msg }}"
  861. fail_msg: "{{ input_config_check_fail_msg }}"
  862. tags: TC_018
  863. - name: Delete "{{ new_input_config_filename }}"
  864. file:
  865. path: "{{ new_input_config_filename }}"
  866. state: absent
  867. tags: TC_018
  868. # Testcase OMNIA_DIO_US_DVC_TC_019
  869. # Execute common role in management station with valid iso_file_path
  870. - name: OMNIA_DIO_US_DVC_TC_019
  871. hosts: localhost
  872. connection: local
  873. gather_subset:
  874. - 'min'
  875. vars_files:
  876. - test_vars/test_common_vars.yml
  877. - ../roles/common/vars/main.yml
  878. tasks:
  879. - name: Delete "{{ new_input_config_filename }}"
  880. file:
  881. path: "{{ new_input_config_filename }}"
  882. state: absent
  883. tags: TC_019
  884. - name: Copy "{{ empty_input_config_filename }}" to new file
  885. copy:
  886. src: "{{ empty_input_config_filename }}"
  887. dest: "{{ new_input_config_filename }}"
  888. tags: TC_019
  889. - name: Edit "{{ new_input_config_filename }}"
  890. replace:
  891. path: "{{ new_input_config_filename }}"
  892. regexp: "{{ item.regexp }}"
  893. replace: "{{ item.replace }}"
  894. with_items:
  895. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  896. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  897. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  898. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  899. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  900. tags: TC_019
  901. - block:
  902. - name: Call common role
  903. include_role:
  904. name: ../roles/common
  905. tasks_from: "{{ password_config_file }}"
  906. vars:
  907. input_config_filename: "{{ new_input_config_filename }}"
  908. always:
  909. - name: Validate success message
  910. assert:
  911. that: result_path_iso_file.stat.exists == true
  912. success_msg: "{{ input_config_check_success_msg }}"
  913. fail_msg: "{{ input_config_check_fail_msg }}"
  914. tags: TC_019
  915. - name: Delete "{{ new_input_config_filename }}"
  916. file:
  917. path: "{{ new_input_config_filename }}"
  918. state: absent
  919. tags: TC_019
  920. # Testcase OMNIA_DIO_US_DVC_TC_020
  921. # Execute common role in management station with wrong iso_file_path
  922. - name: OMNIA_DIO_US_DVC_TC_020
  923. hosts: localhost
  924. connection: local
  925. gather_subset:
  926. - 'min'
  927. vars_files:
  928. - test_vars/test_common_vars.yml
  929. - ../roles/common/vars/main.yml
  930. tasks:
  931. - name: Delete "{{ new_input_config_filename }}"
  932. file:
  933. path: "{{ new_input_config_filename }}"
  934. state: absent
  935. tags: TC_020
  936. - name: Copy "{{ empty_input_config_filename }}" to new file
  937. copy:
  938. src: "{{ empty_input_config_filename }}"
  939. dest: "{{ new_input_config_filename }}"
  940. tags: TC_020
  941. - name: Edit "{{ new_input_config_filename }}"
  942. replace:
  943. path: "{{ new_input_config_filename }}"
  944. regexp: "{{ item.regexp }}"
  945. replace: "{{ item.replace }}"
  946. with_items:
  947. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  948. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  949. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ wrong_iso_path }}\"" }
  950. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  951. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  952. tags: TC_020
  953. - block:
  954. - name: Call common role
  955. include_role:
  956. name: ../roles/common
  957. tasks_from: "{{ password_config_file }}"
  958. vars:
  959. input_config_filename: "{{ new_input_config_filename }}"
  960. rescue:
  961. - name: Check log file
  962. command: tail /var/log/omnia.log
  963. register: iso_fail_log_check
  964. changed_when: false
  965. - name: Validate error
  966. assert:
  967. that: invalid_iso_file_path in iso_fail_log_check.stdout
  968. success_msg: "{{ input_config_check_success_msg }}"
  969. fail_msg: "{{ input_config_check_fail_msg }}"
  970. tags: TC_020
  971. - name: Delete "{{ new_input_config_filename }}"
  972. file:
  973. path: "{{ new_input_config_filename }}"
  974. state: absent
  975. tags: TC_020
  976. # Testcase OMNIA_DIO_US_DVC_TC_021
  977. # Execute common role in management station with dhcp_start_ip_range as empty
  978. - name: OMNIA_DIO_US_DVC_TC_021
  979. hosts: localhost
  980. connection: local
  981. gather_subset:
  982. - 'min'
  983. vars_files:
  984. - test_vars/test_common_vars.yml
  985. - ../roles/common/vars/main.yml
  986. tasks:
  987. - name: Delete "{{ new_input_config_filename }}"
  988. file:
  989. path: "{{ new_input_config_filename }}"
  990. state: absent
  991. tags: TC_021
  992. - name: Copy "{{ empty_input_config_filename }}" to new file
  993. copy:
  994. src: "{{ empty_input_config_filename }}"
  995. dest: "{{ new_input_config_filename }}"
  996. tags: TC_021
  997. - name: Edit "{{ new_input_config_filename }}"
  998. replace:
  999. path: "{{ new_input_config_filename }}"
  1000. regexp: "{{ item.regexp }}"
  1001. replace: "{{ item.replace }}"
  1002. with_items:
  1003. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  1004. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  1005. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  1006. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  1007. tags: TC_021
  1008. - block:
  1009. - name: Call common role
  1010. include_role:
  1011. name: ../roles/common
  1012. tasks_from: "{{ password_config_file }}"
  1013. vars:
  1014. input_config_filename: "{{ new_input_config_filename }}"
  1015. rescue:
  1016. - name: Validate error
  1017. assert:
  1018. that: input_config_failure_msg in input_config_check.msg
  1019. success_msg: "{{ input_config_check_success_msg }}"
  1020. fail_msg: "{{ input_config_check_fail_msg }}"
  1021. tags: TC_021
  1022. - name: Delete "{{ new_input_config_filename }}"
  1023. file:
  1024. path: "{{ new_input_config_filename }}"
  1025. state: absent
  1026. tags: TC_021
  1027. # Testcase OMNIA_DIO_US_DVC_TC_022
  1028. # Execute common role in management station with dhcp_end_ip_range as empty
  1029. - name: OMNIA_DIO_US_DVC_TC_022
  1030. hosts: localhost
  1031. connection: local
  1032. gather_subset:
  1033. - 'min'
  1034. vars_files:
  1035. - test_vars/test_common_vars.yml
  1036. - ../roles/common/vars/main.yml
  1037. tasks:
  1038. - name: Delete "{{ new_input_config_filename }}"
  1039. file:
  1040. path: "{{ new_input_config_filename }}"
  1041. state: absent
  1042. tags: TC_022
  1043. - name: Copy "{{ empty_input_config_filename }}" to new file
  1044. copy:
  1045. src: "{{ empty_input_config_filename }}"
  1046. dest: "{{ new_input_config_filename }}"
  1047. tags: TC_022
  1048. - name: Edit "{{ new_input_config_filename }}"
  1049. replace:
  1050. path: "{{ new_input_config_filename }}"
  1051. regexp: "{{ item.regexp }}"
  1052. replace: "{{ item.replace }}"
  1053. with_items:
  1054. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  1055. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  1056. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  1057. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  1058. tags: TC_022
  1059. - block:
  1060. - name: Call common role
  1061. include_role:
  1062. name: ../roles/common
  1063. tasks_from: "{{ password_config_file }}"
  1064. vars:
  1065. input_config_filename: "{{ new_input_config_filename }}"
  1066. rescue:
  1067. - name: Validate error
  1068. assert:
  1069. that: input_config_failure_msg in input_config_check.msg
  1070. success_msg: "{{ input_config_check_success_msg }}"
  1071. fail_msg: "{{ input_config_check_fail_msg }}"
  1072. tags: TC_022
  1073. - name: Delete "{{ new_input_config_filename }}"
  1074. file:
  1075. path: "{{ new_input_config_filename }}"
  1076. state: absent
  1077. tags: TC_022
  1078. # Testcase OMNIA_DIO_US_DVC_TC_023
  1079. # Execute common role in management station with mapping_file_path provided
  1080. - name: OMNIA_DIO_US_DVC_TC_023
  1081. hosts: localhost
  1082. connection: local
  1083. gather_subset:
  1084. - 'min'
  1085. vars_files:
  1086. - test_vars/test_common_vars.yml
  1087. - ../roles/common/vars/main.yml
  1088. tasks:
  1089. - name: Delete "{{ new_input_config_filename }}"
  1090. file:
  1091. path: "{{ new_input_config_filename }}"
  1092. state: absent
  1093. tags: TC_023
  1094. - name: Copy "{{ empty_input_config_filename }}" to new file
  1095. copy:
  1096. src: "{{ empty_input_config_filename }}"
  1097. dest: "{{ new_input_config_filename }}"
  1098. tags: TC_023
  1099. - name: Edit "{{ new_input_config_filename }}"
  1100. replace:
  1101. path: "{{ new_input_config_filename }}"
  1102. regexp: "{{ item.regexp }}"
  1103. replace: "{{ item.replace }}"
  1104. with_items:
  1105. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  1106. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  1107. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  1108. - { regexp: "mapping_file_path: \"\"", replace: "mapping_file_path: \"{{ valid_mapping_file_path }}\"" }
  1109. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  1110. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  1111. tags: TC_023
  1112. - block:
  1113. - name: Call common role
  1114. include_role:
  1115. name: ../roles/common
  1116. tasks_from: "{{ password_config_file }}"
  1117. vars:
  1118. input_config_filename: "{{ new_input_config_filename }}"
  1119. always:
  1120. - name: Check log file
  1121. command: tail -100 /var/log/omnia.log
  1122. register: mapping_success_log_check
  1123. changed_when: false
  1124. - name: Validate success message
  1125. assert:
  1126. that: success_mapping_file in mapping_success_log_check.stdout
  1127. success_msg: "{{ input_config_check_success_msg }}"
  1128. fail_msg: "{{ input_config_check_fail_msg }}"
  1129. tags: TC_023
  1130. - name: Delete "{{ new_input_config_filename }}"
  1131. file:
  1132. path: "{{ new_input_config_filename }}"
  1133. state: absent
  1134. tags: TC_023
  1135. # Testcase OMNIA_DIO_US_DVC_TC_024
  1136. # Execute common role in management station with awx_password of 30 characters
  1137. - name: OMNIA_DIO_US_DVC_TC_024
  1138. hosts: localhost
  1139. connection: local
  1140. gather_subset:
  1141. - 'min'
  1142. vars_files:
  1143. - test_vars/test_common_vars.yml
  1144. - ../roles/common/vars/main.yml
  1145. tasks:
  1146. - name: Delete "{{ new_input_config_filename }}"
  1147. file:
  1148. path: "{{ new_input_config_filename }}"
  1149. state: absent
  1150. tags: TC_024
  1151. - name: Copy "{{ empty_input_config_filename }}" to new file
  1152. copy:
  1153. src: "{{ empty_input_config_filename }}"
  1154. dest: "{{ new_input_config_filename }}"
  1155. tags: TC_024
  1156. - name: Edit "{{ new_input_config_filename }}"
  1157. replace:
  1158. path: "{{ new_input_config_filename }}"
  1159. regexp: "{{ item.regexp }}"
  1160. replace: "{{ item.replace }}"
  1161. with_items:
  1162. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ max_length_password }}\"" }
  1163. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  1164. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  1165. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  1166. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  1167. tags: TC_024
  1168. - block:
  1169. - name: Call common role
  1170. include_role:
  1171. name: ../roles/common
  1172. tasks_from: "{{ password_config_file }}"
  1173. vars:
  1174. input_config_filename: "{{ new_input_config_filename }}"
  1175. always:
  1176. - name: Validate success message
  1177. assert:
  1178. that: success_msg_awx_password in awx_password_check.msg
  1179. success_msg: "{{ input_config_check_success_msg }}"
  1180. fail_msg: "{{ input_config_check_fail_msg }}"
  1181. tags: TC_024
  1182. - name: Delete "{{ new_input_config_filename }}"
  1183. file:
  1184. path: "{{ new_input_config_filename }}"
  1185. state: absent
  1186. tags: TC_024
  1187. # Testcase OMNIA_DIO_US_DVC_TC_025
  1188. # Execute common role in management station with provision_password of 30 characters
  1189. - name: OMNIA_DIO_US_DVC_TC_025
  1190. hosts: localhost
  1191. connection: local
  1192. gather_subset:
  1193. - 'min'
  1194. vars_files:
  1195. - test_vars/test_common_vars.yml
  1196. - ../roles/common/vars/main.yml
  1197. tasks:
  1198. - name: Delete "{{ new_input_config_filename }}"
  1199. file:
  1200. path: "{{ new_input_config_filename }}"
  1201. state: absent
  1202. tags: TC_025
  1203. - name: Copy "{{ empty_input_config_filename }}" to new file
  1204. copy:
  1205. src: "{{ empty_input_config_filename }}"
  1206. dest: "{{ new_input_config_filename }}"
  1207. tags: TC_025
  1208. - name: Edit "{{ new_input_config_filename }}"
  1209. replace:
  1210. path: "{{ new_input_config_filename }}"
  1211. regexp: "{{ item.regexp }}"
  1212. replace: "{{ item.replace }}"
  1213. with_items:
  1214. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ max_length_password }}\"" }
  1215. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  1216. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  1217. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  1218. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  1219. tags: TC_025
  1220. - block:
  1221. - name: Call common role
  1222. include_role:
  1223. name: ../roles/common
  1224. tasks_from: "{{ password_config_file }}"
  1225. vars:
  1226. input_config_filename: "{{ new_input_config_filename }}"
  1227. always:
  1228. - name: Validate success message
  1229. assert:
  1230. that: success_msg_provision_password in cobbler_password_check.msg
  1231. success_msg: "{{ input_config_check_success_msg }}"
  1232. fail_msg: "{{ input_config_check_fail_msg }}"
  1233. tags: TC_025
  1234. - name: Delete "{{ new_input_config_filename }}"
  1235. file:
  1236. path: "{{ new_input_config_filename }}"
  1237. state: absent
  1238. tags: TC_025
  1239. # Testcase OMNIA_DIO_US_DVC_TC_026
  1240. # Execute common role in management station with hpc_nic and public_nic as same value
  1241. - name: OMNIA_DIO_US_DVC_TC_026
  1242. hosts: localhost
  1243. connection: local
  1244. gather_subset:
  1245. - 'min'
  1246. vars_files:
  1247. - test_vars/test_common_vars.yml
  1248. - ../roles/common/vars/main.yml
  1249. tasks:
  1250. - name: Delete "{{ new_input_config_filename }}"
  1251. file:
  1252. path: "{{ new_input_config_filename }}"
  1253. state: absent
  1254. tags: TC_026
  1255. - name: Copy "{{ empty_input_config_filename }}" to new file
  1256. copy:
  1257. src: "{{ empty_input_config_filename }}"
  1258. dest: "{{ new_input_config_filename }}"
  1259. tags: TC_026
  1260. - name: Edit "{{ new_input_config_filename }}"
  1261. replace:
  1262. path: "{{ new_input_config_filename }}"
  1263. regexp: "{{ item.regexp }}"
  1264. replace: "{{ item.replace }}"
  1265. with_items:
  1266. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  1267. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  1268. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  1269. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  1270. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  1271. - { regexp: "hpc_nic: \"em1\"", replace: "hpc_nic: \"em2\"" }
  1272. tags: TC_026
  1273. - block:
  1274. - name: Call common role
  1275. include_role:
  1276. name: ../roles/common
  1277. tasks_from: "{{ password_config_file }}"
  1278. vars:
  1279. input_config_filename: "{{ new_input_config_filename }}"
  1280. rescue:
  1281. - name: Validate error
  1282. assert:
  1283. that: fail_msg_hpc_nic in hpc_nic_check.msg
  1284. success_msg: "{{ input_config_check_success_msg }}"
  1285. fail_msg: "{{ input_config_check_fail_msg }}"
  1286. tags: TC_026
  1287. - name: Delete "{{ new_input_config_filename }}"
  1288. file:
  1289. path: "{{ new_input_config_filename }}"
  1290. state: absent
  1291. tags: TC_026
  1292. # Testcase OMNIA_DIO_US_DVC_TC_027
  1293. # Execute common role in management station with hpc_nic as empty
  1294. - name: OMNIA_DIO_US_DVC_TC_027
  1295. hosts: localhost
  1296. connection: local
  1297. gather_subset:
  1298. - 'min'
  1299. vars_files:
  1300. - test_vars/test_common_vars.yml
  1301. - ../roles/common/vars/main.yml
  1302. tasks:
  1303. - name: Delete "{{ new_input_config_filename }}"
  1304. file:
  1305. path: "{{ new_input_config_filename }}"
  1306. state: absent
  1307. tags: TC_027
  1308. - name: Copy "{{ empty_input_config_filename }}" to new file
  1309. copy:
  1310. src: "{{ empty_input_config_filename }}"
  1311. dest: "{{ new_input_config_filename }}"
  1312. tags: TC_027
  1313. - name: Edit "{{ new_input_config_filename }}"
  1314. replace:
  1315. path: "{{ new_input_config_filename }}"
  1316. regexp: "{{ item.regexp }}"
  1317. replace: "{{ item.replace }}"
  1318. with_items:
  1319. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  1320. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  1321. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  1322. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  1323. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  1324. - { regexp: "hpc_nic: \"em1\"", replace: "hpc_nic: \"\"" }
  1325. tags: TC_027
  1326. - block:
  1327. - name: Call common role
  1328. include_role:
  1329. name: ../roles/common
  1330. tasks_from: "{{ password_config_file }}"
  1331. vars:
  1332. input_config_filename: "{{ new_input_config_filename }}"
  1333. rescue:
  1334. - name: Validate error
  1335. assert:
  1336. that: input_config_failure_msg in input_config_check.msg
  1337. success_msg: "{{ input_config_check_success_msg }}"
  1338. fail_msg: "{{ input_config_check_fail_msg }}"
  1339. tags: TC_027
  1340. - name: Delete "{{ new_input_config_filename }}"
  1341. file:
  1342. path: "{{ new_input_config_filename }}"
  1343. state: absent
  1344. tags: TC_027
  1345. # Testcase OMNIA_DIO_US_DVC_TC_028
  1346. # Execute common role in management station with public_nic as empty
  1347. - name: OMNIA_DIO_US_DVC_TC_028
  1348. hosts: localhost
  1349. connection: local
  1350. gather_subset:
  1351. - 'min'
  1352. vars_files:
  1353. - test_vars/test_common_vars.yml
  1354. - ../roles/common/vars/main.yml
  1355. tasks:
  1356. - name: Delete "{{ new_input_config_filename }}"
  1357. file:
  1358. path: "{{ new_input_config_filename }}"
  1359. state: absent
  1360. tags: TC_028
  1361. - name: Copy "{{ empty_input_config_filename }}" to new file
  1362. copy:
  1363. src: "{{ empty_input_config_filename }}"
  1364. dest: "{{ new_input_config_filename }}"
  1365. tags: TC_028
  1366. - name: Edit "{{ new_input_config_filename }}"
  1367. replace:
  1368. path: "{{ new_input_config_filename }}"
  1369. regexp: "{{ item.regexp }}"
  1370. replace: "{{ item.replace }}"
  1371. with_items:
  1372. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  1373. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  1374. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  1375. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  1376. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  1377. - { regexp: "public_nic: \"em2\"", replace: "public_nic: \"\"" }
  1378. tags: TC_028
  1379. - block:
  1380. - name: Call common role
  1381. include_role:
  1382. name: ../roles/common
  1383. tasks_from: "{{ password_config_file }}"
  1384. vars:
  1385. input_config_filename: "{{ new_input_config_filename }}"
  1386. rescue:
  1387. - name: Validate error
  1388. assert:
  1389. that: input_config_failure_msg in input_config_check.msg
  1390. success_msg: "{{ input_config_check_success_msg }}"
  1391. fail_msg: "{{ input_config_check_fail_msg }}"
  1392. tags: TC_028
  1393. - name: Delete "{{ new_input_config_filename }}"
  1394. file:
  1395. path: "{{ new_input_config_filename }}"
  1396. state: absent
  1397. tags: TC_028
  1398. # Testcase OMNIA_DIO_US_DVC_TC_029
  1399. # Execute common role in management station with public_nic not present in device
  1400. - name: OMNIA_DIO_US_DVC_TC_029
  1401. hosts: localhost
  1402. connection: local
  1403. gather_subset:
  1404. - 'min'
  1405. vars_files:
  1406. - test_vars/test_common_vars.yml
  1407. - ../roles/common/vars/main.yml
  1408. tasks:
  1409. - name: Delete "{{ new_input_config_filename }}"
  1410. file:
  1411. path: "{{ new_input_config_filename }}"
  1412. state: absent
  1413. tags: TC_029
  1414. - name: Copy "{{ empty_input_config_filename }}" to new file
  1415. copy:
  1416. src: "{{ empty_input_config_filename }}"
  1417. dest: "{{ new_input_config_filename }}"
  1418. tags: TC_029
  1419. - name: Edit "{{ new_input_config_filename }}"
  1420. replace:
  1421. path: "{{ new_input_config_filename }}"
  1422. regexp: "{{ item.regexp }}"
  1423. replace: "{{ item.replace }}"
  1424. with_items:
  1425. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  1426. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  1427. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  1428. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  1429. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  1430. - { regexp: "public_nic: \"em2\"", replace: "public_nic: \"em5\"" }
  1431. tags: TC_029
  1432. - block:
  1433. - name: Call common role
  1434. include_role:
  1435. name: ../roles/common
  1436. tasks_from: "{{ password_config_file }}"
  1437. vars:
  1438. input_config_filename: "{{ new_input_config_filename }}"
  1439. rescue:
  1440. - name: Validate error
  1441. assert:
  1442. that: fail_hpc_ip in public_ip_check.msg
  1443. success_msg: "{{ input_config_check_success_msg }}"
  1444. fail_msg: "{{ input_config_check_fail_msg }}"
  1445. tags: TC_029
  1446. - name: Delete "{{ new_input_config_filename }}"
  1447. file:
  1448. path: "{{ new_input_config_filename }}"
  1449. state: absent
  1450. tags: TC_029
  1451. # Testcase OMNIA_DIO_US_DVC_TC_030
  1452. # Execute common role in management station with hpc_nic not present in device
  1453. - name: OMNIA_DIO_US_DVC_TC_030
  1454. hosts: localhost
  1455. connection: local
  1456. gather_subset:
  1457. - 'min'
  1458. vars_files:
  1459. - test_vars/test_common_vars.yml
  1460. - ../roles/common/vars/main.yml
  1461. tasks:
  1462. - name: Delete "{{ new_input_config_filename }}"
  1463. file:
  1464. path: "{{ new_input_config_filename }}"
  1465. state: absent
  1466. tags: TC_030
  1467. - name: Copy "{{ empty_input_config_filename }}" to new file
  1468. copy:
  1469. src: "{{ empty_input_config_filename }}"
  1470. dest: "{{ new_input_config_filename }}"
  1471. tags: TC_030
  1472. - name: Edit "{{ new_input_config_filename }}"
  1473. replace:
  1474. path: "{{ new_input_config_filename }}"
  1475. regexp: "{{ item.regexp }}"
  1476. replace: "{{ item.replace }}"
  1477. with_items:
  1478. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  1479. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  1480. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  1481. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  1482. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  1483. - { regexp: "hpc_nic: \"em1\"", replace: "hpc_nic: \"em5\"" }
  1484. tags: TC_030
  1485. - block:
  1486. - name: Call common role
  1487. include_role:
  1488. name: ../roles/common
  1489. tasks_from: "{{ password_config_file }}"
  1490. vars:
  1491. input_config_filename: "{{ new_input_config_filename }}"
  1492. rescue:
  1493. - name: Validate error
  1494. assert:
  1495. that: fail_hpc_ip in hpc_ip_check.msg
  1496. success_msg: "{{ input_config_check_success_msg }}"
  1497. fail_msg: "{{ input_config_check_fail_msg }}"
  1498. tags: TC_030
  1499. - name: Delete "{{ new_input_config_filename }}"
  1500. file:
  1501. path: "{{ new_input_config_filename }}"
  1502. state: absent
  1503. tags: TC_030
  1504. # Testcase OMNIA_DIO_US_DVC_TC_031
  1505. # Execute common role with dhcp_start_ip_range in wrong ip range
  1506. - name: OMNIA_DIO_US_DVC_TC_031
  1507. hosts: localhost
  1508. connection: local
  1509. gather_subset:
  1510. - 'min'
  1511. vars_files:
  1512. - test_vars/test_common_vars.yml
  1513. - ../roles/common/vars/main.yml
  1514. tasks:
  1515. - name: Delete "{{ new_input_config_filename }}"
  1516. file:
  1517. path: "{{ new_input_config_filename }}"
  1518. state: absent
  1519. tags: TC_031
  1520. - name: Copy "{{ empty_input_config_filename }}" to new file
  1521. copy:
  1522. src: "{{ empty_input_config_filename }}"
  1523. dest: "{{ new_input_config_filename }}"
  1524. tags: TC_031
  1525. - name: Edit "{{ new_input_config_filename }}"
  1526. replace:
  1527. path: "{{ new_input_config_filename }}"
  1528. regexp: "{{ item.regexp }}"
  1529. replace: "{{ item.replace }}"
  1530. with_items:
  1531. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  1532. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  1533. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  1534. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ invalid_dhcp_ip }}\"" }
  1535. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  1536. tags: TC_031
  1537. - block:
  1538. - name: Call common role
  1539. include_role:
  1540. name: ../roles/common
  1541. tasks_from: "{{ password_config_file }}"
  1542. vars:
  1543. input_config_filename: "{{ new_input_config_filename }}"
  1544. rescue:
  1545. - name: Validate error
  1546. assert:
  1547. that: fail_dhcp_range in dhcp_start_ip_check.msg
  1548. success_msg: "{{ input_config_check_success_msg }}"
  1549. fail_msg: "{{ input_config_check_fail_msg }}"
  1550. tags: TC_031
  1551. - name: Delete "{{ new_input_config_filename }}"
  1552. file:
  1553. path: "{{ new_input_config_filename }}"
  1554. state: absent
  1555. tags: TC_031
  1556. # Testcase OMNIA_DIO_US_DVC_TC_032
  1557. # Execute common role with dhcp_start_ip_range in wrong format
  1558. - name: OMNIA_DIO_US_DVC_TC_032
  1559. hosts: localhost
  1560. connection: local
  1561. gather_subset:
  1562. - 'min'
  1563. vars_files:
  1564. - test_vars/test_common_vars.yml
  1565. - ../roles/common/vars/main.yml
  1566. tasks:
  1567. - name: Delete "{{ new_input_config_filename }}"
  1568. file:
  1569. path: "{{ new_input_config_filename }}"
  1570. state: absent
  1571. tags: TC_032
  1572. - name: Copy "{{ empty_input_config_filename }}" to new file
  1573. copy:
  1574. src: "{{ empty_input_config_filename }}"
  1575. dest: "{{ new_input_config_filename }}"
  1576. tags: TC_032
  1577. - name: Edit "{{ new_input_config_filename }}"
  1578. replace:
  1579. path: "{{ new_input_config_filename }}"
  1580. regexp: "{{ item.regexp }}"
  1581. replace: "{{ item.replace }}"
  1582. with_items:
  1583. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  1584. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  1585. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  1586. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ wrong_dhcp_ip }}\"" }
  1587. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
  1588. tags: TC_032
  1589. - block:
  1590. - name: Call common role
  1591. include_role:
  1592. name: ../roles/common
  1593. tasks_from: "{{ password_config_file }}"
  1594. vars:
  1595. input_config_filename: "{{ new_input_config_filename }}"
  1596. rescue:
  1597. - name: Validate error
  1598. assert:
  1599. that: fail_dhcp_range in dhcp_start_ip_check.msg
  1600. success_msg: "{{ input_config_check_success_msg }}"
  1601. fail_msg: "{{ input_config_check_fail_msg }}"
  1602. tags: TC_032
  1603. - name: Delete "{{ new_input_config_filename }}"
  1604. file:
  1605. path: "{{ new_input_config_filename }}"
  1606. state: absent
  1607. tags: TC_032
  1608. # Testcase OMNIA_DIO_US_DVC_TC_033
  1609. #Execute common role with dhcp_end_ip_range in wrong format
  1610. - name: OMNIA_DIO_US_DVC_TC_033
  1611. hosts: localhost
  1612. connection: local
  1613. gather_subset:
  1614. - 'min'
  1615. vars_files:
  1616. - test_vars/test_common_vars.yml
  1617. - ../roles/common/vars/main.yml
  1618. tasks:
  1619. - name: Delete "{{ new_input_config_filename }}"
  1620. file:
  1621. path: "{{ new_input_config_filename }}"
  1622. state: absent
  1623. tags: TC_033
  1624. - name: Copy "{{ empty_input_config_filename }}" to new file
  1625. copy:
  1626. src: "{{ empty_input_config_filename }}"
  1627. dest: "{{ new_input_config_filename }}"
  1628. tags: TC_033
  1629. - name: Edit "{{ new_input_config_filename }}"
  1630. replace:
  1631. path: "{{ new_input_config_filename }}"
  1632. regexp: "{{ item.regexp }}"
  1633. replace: "{{ item.replace }}"
  1634. with_items:
  1635. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  1636. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  1637. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  1638. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  1639. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ wrong_dhcp_ip }}\"" }
  1640. tags: TC_033
  1641. - block:
  1642. - name: Call common role
  1643. include_role:
  1644. name: ../roles/common
  1645. tasks_from: "{{ password_config_file }}"
  1646. vars:
  1647. input_config_filename: "{{ new_input_config_filename }}"
  1648. rescue:
  1649. - name: Validate error
  1650. assert:
  1651. that: fail_dhcp_range in dhcp_start_ip_check.msg
  1652. success_msg: "{{ input_config_check_success_msg }}"
  1653. fail_msg: "{{ input_config_check_fail_msg }}"
  1654. tags: TC_033
  1655. - name: Delete "{{ new_input_config_filename }}"
  1656. file:
  1657. path: "{{ new_input_config_filename }}"
  1658. state: absent
  1659. tags: TC_033
  1660. # Testcase OMNIA_DIO_US_DVC_TC_034
  1661. #Execute common role with dhcp_end_ip_range in wrong ip range
  1662. - name: OMNIA_DIO_US_DVC_TC_034
  1663. hosts: localhost
  1664. connection: local
  1665. gather_subset:
  1666. - 'min'
  1667. vars_files:
  1668. - test_vars/test_common_vars.yml
  1669. - ../roles/common/vars/main.yml
  1670. tasks:
  1671. - name: Delete "{{ new_input_config_filename }}"
  1672. file:
  1673. path: "{{ new_input_config_filename }}"
  1674. state: absent
  1675. tags: TC_034
  1676. - name: Copy "{{ empty_input_config_filename }}" to new file
  1677. copy:
  1678. src: "{{ empty_input_config_filename }}"
  1679. dest: "{{ new_input_config_filename }}"
  1680. tags: TC_034
  1681. - name: Edit "{{ new_input_config_filename }}"
  1682. replace:
  1683. path: "{{ new_input_config_filename }}"
  1684. regexp: "{{ item.regexp }}"
  1685. replace: "{{ item.replace }}"
  1686. with_items:
  1687. - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
  1688. - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
  1689. - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
  1690. - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
  1691. - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ invalid_dhcp_ip }}\"" }
  1692. tags: TC_034
  1693. - block:
  1694. - name: Call common role
  1695. include_role:
  1696. name: ../roles/common
  1697. tasks_from: "{{ password_config_file }}"
  1698. vars:
  1699. input_config_filename: "{{ new_input_config_filename }}"
  1700. rescue:
  1701. - name: Validate error
  1702. assert:
  1703. that: fail_dhcp_range in dhcp_start_ip_check.msg
  1704. success_msg: "{{ input_config_check_success_msg }}"
  1705. fail_msg: "{{ input_config_check_fail_msg }}"
  1706. tags: TC_034
  1707. - name: Delete "{{ new_input_config_filename }}"
  1708. file:
  1709. path: "{{ new_input_config_filename }}"
  1710. state: absent
  1711. tags: TC_034