1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882 |
- # Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ---
- # Testcase OMNIA_DIO_US_DVC_TC_001
- # Execute common role in management station with os installed centos 7.9
- - name: OMNIA_DIO_US_DVC_TC_001
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Check OS support
- fail:
- msg: "{{ os_status }}"
- when: not(ansible_distribution == os_name and ansible_distribution_version >= os_version)
- tags: TC_001
- - name: Delete docker volume
- docker_volume:
- name: "{{ docker_volume_name }}"
- state: absent
- tags: TC_001
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- vars:
- input_config_filename: "{{ test_input_config_filename }}"
- tags: TC_001
- - name: Fetch package installed
- package_facts:
- manager: auto
- tags: TC_001,VERIFY_001
- - name: Verify all required packages is installed
- assert:
- that: "'{{ item }}' in ansible_facts.packages"
- success_msg: "{{ install_package_success_msg }}"
- fail_msg: "{{ install_package_fail_msg }}"
- when: "'python-docker' not in item"
- with_items: "{{ common_packages }}"
- tags: TC_001,VERIFY_001
- - name: Verify python-docker-py package is installed
- assert:
- that: "'python-docker-py' in ansible_facts.packages"
- success_msg: "{{ install_package_success_msg }}"
- fail_msg: "{{ install_package_fail_msg }}"
- tags: TC_001,VERIFY_001
- - name: Fetching docker volume info
- docker_volume_info:
- name: "{{ docker_volume_name }}"
- register: docker_volume_status
- tags: TC_001,VERIFY_001
- - name: Validate docker volume
- assert:
- that: docker_volume_status.exists
- fail_msg: "{{ docker_volume_fail_msg }}"
- success_msg: "{{ docker_volume_success_msg }}"
- tags: TC_001,VERIFY_001
- - name: Check input config file is encrypted
- command: cat {{ test_input_config_filename }}
- changed_when: false
- register: config_content
- tags: TC_001,VERIFY_001
- - name: Validate input config file is encypted or not
- assert:
- that: "'$ANSIBLE_VAULT;' in config_content.stdout"
- fail_msg: "{{ input_config_fail_msg }}"
- success_msg: "{{ input_config_success_msg }}"
- tags: TC_001,VERIFY_001
- # Testcase OMNIA_DIO_US_DVC_TC_002
- # Execute common role in management station with docker volume omnia-storage already present
- - name: OMNIA_DIO_US_DVC_TC_002
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- vars:
- input_config_filename: "{{ test_input_config_filename }}"
- tags: TC_002
- - name: Fetch package installed
- package_facts:
- manager: auto
- tags: TC_002,VERIFY_002
- - name: Verify all required packages is installed
- assert:
- that: "'{{ item }}' in ansible_facts.packages"
- success_msg: "{{ install_package_success_msg }}"
- fail_msg: "{{ install_package_fail_msg }}"
- when: "'python-docker' not in item"
- with_items: "{{ common_packages }}"
- tags: TC_002,VERIFY_002
- - name: Verify python-docker-py package is installed
- assert:
- that: "'python-docker-py' in ansible_facts.packages"
- success_msg: "{{ install_package_success_msg }}"
- fail_msg: "{{ install_package_fail_msg }}"
- tags: TC_002,VERIFY_002
- - name: Fetching docker volume info
- docker_volume_info:
- name: "{{ docker_volume_name }}"
- register: docker_volume_status
- tags: TC_002,VERIFY_002
- - name: Validate docker volume
- assert:
- that: docker_volume_status.exists
- fail_msg: "{{ docker_volume_fail_msg }}"
- success_msg: "{{ docker_volume_success_msg }}"
- tags: TC_002,VERIFY_002
- - name: Check input config file is encrypted
- command: cat {{ test_input_config_filename }}
- changed_when: false
- register: config_content
- tags: TC_002,VERIFY_002
- - name: Validate input config file is encypted or not
- assert:
- that: "'$ANSIBLE_VAULT;' in config_content.stdout"
- fail_msg: "{{ input_config_fail_msg }}"
- success_msg: "{{ input_config_success_msg }}"
- tags: TC_002,VERIFY_002
- # Testcase OMNIA_DIO_US_DVC_TC_003
- # Execute common role in management station with os installed different than centos 7.9
- - name: OMNIA_DIO_US_DVC_TC_003
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- vars:
- input_config_filename: "{{ test_input_config_filename }}"
- ansible_distribution_version: "{{ centos_version }}"
- rescue:
- - name: Validate OS check failure message
- assert:
- that: os_status in os_value.msg
- success_msg: "{{ os_check_success_msg }}"
- fail_msg: "{{ os_check_fail_msg }}"
- tags: TC_003
- # Testcase OMNIA_DIO_US_DVC_TC_004
- # Execute common role in management station without internet connectivity
- - name: OMNIA_DIO_US_DVC_TC_004
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Down internet connectivity
- lineinfile:
- path: /etc/hosts
- line: "172.16.0.5 github.com"
- state: present
- backup: yes
- tags: TC_004
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- vars:
- input_config_filename: "{{ test_input_config_filename }}"
- rescue:
- - name: Validate internet connectivity failure message
- assert:
- that: internet_status in internet_value.msg
- success_msg: "{{ internet_check_success_msg }}"
- fail_msg: "{{ internet_check_fail_msg }}"
- tags: TC_004
- - name: Up internet connectivity
- lineinfile:
- path: /etc/hosts
- line: "172.16.0.5 github.com"
- state: absent
- tags: TC_004
- # Testcase OMNIA_DIO_US_DVC_TC_005
- # Execute common role in management station with different user than root
- - name: OMNIA_DIO_US_DVC_TC_005
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- tasks:
- - name: Create temp user
- user:
- name: temp
- tags: TC_005
- - block:
- - name: Execute playbook with different user
- command: ansible-playbook ../appliance.yml --become-user=temp -e "input_config_filename=test/input_config_test.yml"
- register: temp_user_output
- rescue:
- - name: Validate the different user execution failure message
- assert:
- that:
- - '"FAILED" in temp_user_output.stdout'
- - '"This command has to be run under the root user" in temp_user_output.stdout'
- success_msg: "{{ different_user_check_success_msg }}"
- fail_msg: "{{ different_user_check_fail_msg }}"
- tags: TC_005
- - name: Remove temp user
- user:
- name: temp
- state: absent
- remove: yes
- tags: TC_005
- # Testcase OMNIA_DIO_US_DVC_TC_006
- # Execute common role in management station with selinux enabled.
- - name: OMNIA_DIO_US_DVC_TC_006
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Enable selinux
- selinux:
- policy: targeted
- state: enforcing
- when: ansible_selinux.status == "disabled"
- tags: TC_006
- - name: Reboot localhost
- command: reboot
- when: ansible_selinux.status == "disabled"
- tags: TC_006
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- vars:
- input_config_filename: "{{ test_input_config_filename }}"
- rescue:
- - name: Validate selinux failure message
- assert:
- that: selinux_status in selinux_value.msg
- success_msg: "{{ selinux_check_success_msg }}"
- fail_msg: "{{ selinux_check_fail_msg }}"
- tags: TC_006
- - name: Disable selinux
- selinux:
- state: disabled
- tags: TC_006
- # Testcase OMNIA_DIO_US_DVC_TC_007
- # Execute common role in management station with all input paramter as empty
- - name: OMNIA_DIO_US_DVC_TC_007
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ empty_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: input_config_failure_msg in input_config_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_007
- # Testcase OMNIA_DIO_US_DVC_TC_008
- # Execute common role in management station with provision_password as empty
- - name: OMNIA_DIO_US_DVC_TC_008
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_008
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_008
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_008
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: input_config_failure_msg in input_config_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_008
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_008
- # Testcase OMNIA_DIO_US_DVC_TC_009
- # Execute common role in management station with awx_password as empty
- - name: OMNIA_DIO_US_DVC_TC_009
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_009
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_009
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_009
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: input_config_failure_msg in input_config_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_009
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_009
- # Testcase OMNIA_DIO_US_DVC_TC_010
- # Execute common role in management station with iso_file_path as empty
- - name: OMNIA_DIO_US_DVC_TC_010
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_010
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_010
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_010
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: input_config_failure_msg in input_config_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_010
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_010
- # Testcase OMNIA_DIO_US_DVC_TC_011
- # Execute common role in management station with provision_password of more than 31 characters
- - name: OMNIA_DIO_US_DVC_TC_011
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_011
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_011
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ long_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_011
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: fail_msg_provision_password in cobbler_password_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_011
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_011
- # Testcase OMNIA_DIO_US_DVC_TC_012
- # Execute common role in management station with provision_password as string contains white spaces
- - name: OMNIA_DIO_US_DVC_TC_012
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_012
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_012
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ white_space_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_012
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- always:
- - name: Validate success message
- assert:
- that: success_msg_provision_password in cobbler_password_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_012
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_012
- # Testcase OMNIA_DIO_US_DVC_TC_013
- # Execute common role in management station with provision_password as string contains characters like '/' and '-'
- - name: OMNIA_DIO_US_DVC_TC_013
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_013
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_013
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ special_character_password1 }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_013
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: fail_msg_provision_password in cobbler_password_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_013
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_013
- # Testcase OMNIA_DIO_US_DVC_TC_014
- # Execute common role in management station with provision_password as string contains special characters other than '-', '/'
- - name: OMNIA_DIO_US_DVC_TC_014
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_014
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_014
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ special_character_password2 }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_014
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- always:
- - name: Validate success message
- assert:
- that: success_msg_provision_password in cobbler_password_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_014
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_014
- # Testcase OMNIA_DIO_US_DVC_TC_015
- # Execute common role in management station with awx_password of more than 31 characters
- - name: OMNIA_DIO_US_DVC_TC_015
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_015
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_015
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ long_password }}\"" }
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_015
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: fail_msg_awx_password in awx_password_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_015
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_015
- # Testcase OMNIA_DIO_US_DVC_TC_016
- # Execute common role in management station with awx_password as string contains white spaces
- - name: OMNIA_DIO_US_DVC_TC_016
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_016
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_016
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ white_space_password }}\"" }
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_016
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- always:
- - name: Validate success message
- assert:
- that: success_msg_awx_password in awx_password_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_016
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_016
- # Testcase OMNIA_DIO_US_DVC_TC_017
- # Execute common role in management station with awx_password as string contains characters like '/' and '-'
- - name: OMNIA_DIO_US_DVC_TC_017
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_017
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_017
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ special_character_password1 }}\"" }
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_017
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: fail_msg_awx_password in awx_password_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_017
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_017
- # Testcase OMNIA_DIO_US_DVC_TC_018
- # Execute common role in management station with awx_password as string contains special characters other than '-', '/'
- - name: OMNIA_DIO_US_DVC_TC_018
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_018
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_018
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ special_character_password2 }}\"" }
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_018
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- always:
- - name: Validate success message
- assert:
- that: success_msg_awx_password in awx_password_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_018
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_018
- # Testcase OMNIA_DIO_US_DVC_TC_019
- # Execute common role in management station with valid iso_file_path
- - name: OMNIA_DIO_US_DVC_TC_019
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_019
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_019
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_019
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- always:
- - name: Validate success message
- assert:
- that: result_path_iso_file.stat.exists == true
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_019
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_019
- # Testcase OMNIA_DIO_US_DVC_TC_020
- # Execute common role in management station with wrong iso_file_path
- - name: OMNIA_DIO_US_DVC_TC_020
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_020
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_020
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ wrong_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_020
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Check log file
- command: tail /var/log/omnia.log
- register: iso_fail_log_check
- changed_when: false
-
- - name: Validate error
- assert:
- that: invalid_iso_file_path in iso_fail_log_check.stdout
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_020
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_020
- # Testcase OMNIA_DIO_US_DVC_TC_021
- # Execute common role in management station with dhcp_start_ip_range as empty
- - name: OMNIA_DIO_US_DVC_TC_021
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_021
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_021
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_021
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: input_config_failure_msg in input_config_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_021
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_021
- # Testcase OMNIA_DIO_US_DVC_TC_022
- # Execute common role in management station with dhcp_end_ip_range as empty
- - name: OMNIA_DIO_US_DVC_TC_022
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_022
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_022
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- tags: TC_022
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: input_config_failure_msg in input_config_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_022
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_022
- # Testcase OMNIA_DIO_US_DVC_TC_023
- # Execute common role in management station with mapping_file_path provided
- - name: OMNIA_DIO_US_DVC_TC_023
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_023
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_023
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "mapping_file_path: \"\"", replace: "mapping_file_path: \"{{ valid_mapping_file_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_023
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- always:
- - name: Check log file
- command: tail -100 /var/log/omnia.log
- register: mapping_success_log_check
- changed_when: false
-
- - name: Validate success message
- assert:
- that: success_mapping_file in mapping_success_log_check.stdout
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_023
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_023
- # Testcase OMNIA_DIO_US_DVC_TC_024
- # Execute common role in management station with awx_password of 30 characters
- - name: OMNIA_DIO_US_DVC_TC_024
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_024
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_024
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ max_length_password }}\"" }
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_024
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- always:
- - name: Validate success message
- assert:
- that: success_msg_awx_password in awx_password_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_024
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_024
- # Testcase OMNIA_DIO_US_DVC_TC_025
- # Execute common role in management station with provision_password of 30 characters
- - name: OMNIA_DIO_US_DVC_TC_025
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_025
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_025
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ max_length_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_025
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- always:
- - name: Validate success message
- assert:
- that: success_msg_provision_password in cobbler_password_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_025
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_025
- # Testcase OMNIA_DIO_US_DVC_TC_026
- # Execute common role in management station with hpc_nic and public_nic as same value
- - name: OMNIA_DIO_US_DVC_TC_026
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_026
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_026
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- - { regexp: "hpc_nic: \"em1\"", replace: "hpc_nic: \"em2\"" }
- tags: TC_026
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: fail_msg_hpc_nic in hpc_nic_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_026
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_026
- # Testcase OMNIA_DIO_US_DVC_TC_027
- # Execute common role in management station with hpc_nic as empty
- - name: OMNIA_DIO_US_DVC_TC_027
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_027
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_027
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- - { regexp: "hpc_nic: \"em1\"", replace: "hpc_nic: \"\"" }
- tags: TC_027
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: input_config_failure_msg in input_config_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_027
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_027
- # Testcase OMNIA_DIO_US_DVC_TC_028
- # Execute common role in management station with public_nic as empty
- - name: OMNIA_DIO_US_DVC_TC_028
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_028
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_028
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- - { regexp: "public_nic: \"em2\"", replace: "public_nic: \"\"" }
- tags: TC_028
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: input_config_failure_msg in input_config_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_028
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_028
- # Testcase OMNIA_DIO_US_DVC_TC_029
- # Execute common role in management station with public_nic not present in device
- - name: OMNIA_DIO_US_DVC_TC_029
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_029
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_029
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- - { regexp: "public_nic: \"em2\"", replace: "public_nic: \"em5\"" }
- tags: TC_029
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: fail_hpc_ip in public_ip_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_029
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_029
- # Testcase OMNIA_DIO_US_DVC_TC_030
- # Execute common role in management station with hpc_nic not present in device
- - name: OMNIA_DIO_US_DVC_TC_030
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_030
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_030
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- - { regexp: "hpc_nic: \"em1\"", replace: "hpc_nic: \"em5\"" }
- tags: TC_030
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: fail_hpc_ip in hpc_ip_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_030
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_030
- # Testcase OMNIA_DIO_US_DVC_TC_031
- # Execute common role with dhcp_start_ip_range in wrong ip range
- - name: OMNIA_DIO_US_DVC_TC_031
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_031
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_031
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ invalid_dhcp_ip }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_031
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: fail_dhcp_range in dhcp_start_ip_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_031
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_031
- # Testcase OMNIA_DIO_US_DVC_TC_032
- # Execute common role with dhcp_start_ip_range in wrong format
- - name: OMNIA_DIO_US_DVC_TC_032
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_032
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_032
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ wrong_dhcp_ip }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ valid_dhcp_end_range }}\"" }
- tags: TC_032
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: fail_dhcp_range in dhcp_start_ip_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_032
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_032
- # Testcase OMNIA_DIO_US_DVC_TC_033
- #Execute common role with dhcp_end_ip_range in wrong format
- - name: OMNIA_DIO_US_DVC_TC_033
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_033
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_033
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ wrong_dhcp_ip }}\"" }
- tags: TC_033
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: fail_dhcp_range in dhcp_start_ip_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_033
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_033
- # Testcase OMNIA_DIO_US_DVC_TC_034
- #Execute common role with dhcp_end_ip_range in wrong ip range
- - name: OMNIA_DIO_US_DVC_TC_034
- hosts: localhost
- connection: local
- gather_subset:
- - 'min'
- vars_files:
- - test_vars/test_common_vars.yml
- - ../roles/common/vars/main.yml
- tasks:
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_034
- - name: Copy "{{ empty_input_config_filename }}" to new file
- copy:
- src: "{{ empty_input_config_filename }}"
- dest: "{{ new_input_config_filename }}"
- tags: TC_034
- - name: Edit "{{ new_input_config_filename }}"
- replace:
- path: "{{ new_input_config_filename }}"
- regexp: "{{ item.regexp }}"
- replace: "{{ item.replace }}"
- with_items:
- - { regexp: "provision_password: \"\"", replace: "provision_password: \"{{ min_length_password }}\"" }
- - { regexp: "awx_password: \"\"", replace: "awx_password: \"{{ min_length_password }}\"" }
- - { regexp: "iso_file_path: \"\"", replace: "iso_file_path: \"{{ valid_iso_path }}\"" }
- - { regexp: "dhcp_start_ip_range: \"\"", replace: "dhcp_start_ip_range: \"{{ valid_dhcp_start_range }}\"" }
- - { regexp: "dhcp_end_ip_range: \"\"", replace: "dhcp_end_ip_range: \"{{ invalid_dhcp_ip }}\"" }
- tags: TC_034
- - block:
- - name: Call common role
- include_role:
- name: ../roles/common
- tasks_from: "{{ password_config_file }}"
- vars:
- input_config_filename: "{{ new_input_config_filename }}"
- rescue:
- - name: Validate error
- assert:
- that: fail_dhcp_range in dhcp_start_ip_check.msg
- success_msg: "{{ input_config_check_success_msg }}"
- fail_msg: "{{ input_config_check_fail_msg }}"
- tags: TC_034
- - name: Delete "{{ new_input_config_filename }}"
- file:
- path: "{{ new_input_config_filename }}"
- state: absent
- tags: TC_034
|