123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902 |
- # Copyright 2021 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_1.1_US_CRD_TC_001
- # Execute omnia.yml with separate servers for manager,compute,login,nfs node with default parameters
- - name: OMNIA_1.1_US_CRD_TC_001
- hosts: localhost
- tasks:
- - name: Execute omnia.yml with default input parameters
- command: ansible-playbook omnia.yml -i inventory
- changed_when: false
- args:
- chdir: ../
- tags: TC_001
-
- - name: Validate omnia.yml
- command: ansible-playbook test_omnia_validation.yml -i ../inventory
- changed_when: false
- tags: TC_001
- #Testcase OMNIA_1.1_US_CRD_TC_005
- # Execute omnia.yml with addition of new compute node
- - name: OMNIA_1.1_US_CRD_TC_005
- hosts: localhost
- tasks:
-
- - name: Execute omnia.yml with default input parameters
- command: ansible-playbook omnia.yml -i inventory
- changed_when: false
- args:
- chdir: ../
- tags: TC_005
-
- - name: Validate omnia.yml
- command: ansible-playbook test_omnia_validation.yml -i ../inventory
- changed_when: false
- tags: TC_005
- - name: Include variable file
- include_vars: test_vars/test_omnia_1.1_vars.yml
- tags: TC_005
- - name: Creating test inventory file
- copy:
- dest: "test_inventory.yml"
- mode: '{{ file_permission }}'
- content: |
-
- [manager]
- {{ host1 }}
- [compute]
- {{ host2 }}
- {{ host5 }}
-
- [login_node]
- {{ host3 }}
- [nfs_node]
- - name: Verify if new compute node is added
- command: ansible --list-hosts compute -i test_inventory.yml
- changed_when: false
- register: compute_info
- tags: TC_005
- - name: Validate compute node
- assert:
- that:
- - "'{{ host5 }}' in compute_info.stdout"
- success_msg: "{{ compute_node_success_msg }}"
- fail_msg: "{{ compute_node_fail_msg }}"
- tags: TC_005
- #Testcase OMNIA_1.1_US_CRD_TC_006
- # Execute omnia.yml after removal of new compute node
- - name: OMNIA_1.1_US_CRD_TC_006
- hosts: localhost
- tasks:
- - name: Execute omnia.yml with default input parameters
- command: ansible-playbook omnia.yml -i test/test_inventory.yml
- changed_when: false
- args:
- chdir: ../
- tags: TC_006
-
- - name: Validate omnia.yml
- command: ansible-playbook test_omnia_validation.yml -i test_inventory.yml
- changed_when: false
- tags: TC_006
- - name: Delete one compute node
- copy:
- dest: "test_inventory.yml"
- mode: '{{ file_permission }}'
- content: |
-
- [manager]
- {{ host1 }}
- [compute]
- {{ host2 }}
-
- [login_node]
- {{ host3 }}
- [nfs_node]
- tags: TC_006
-
- - name: Execute omnia.yml with default input parameters
- command: ansible-playbook omnia.yml -i test/test_inventory.yml
- changed_when: false
- args:
- chdir: ../
- tags: TC_006
- - name: Verify if one compute node is deleted
- command: ansible --list-hosts compute -i test_inventory.yml
- register: compute_info
- changed_when: false
- tags: TC_006
- - name: Validate compute node
- assert:
- that:
- - "'{{ host5 }}' not in compute_info.stdout"
- success_msg: "{{ compute_node_del_success_msg }}"
- fail_msg: "{{ compute_node_del_fail_msg }}"
- tags: TC_006
- - name: Delete the inventory file
- file:
- state: absent
- path: test_inventory.yml
- tags: TC_006
- #Testcase OMNIA_1.1_US_CRD_TC_008
- # Execute Jupyterhub.yml and then Kubeflow.yml
- - name: OMNIA_1.1_US_CRD_TC_008
- hosts: localhost
- tasks:
- - name: Include variable file
- include_vars: test_vars/test_omnia_1.1_vars.yml
- tags: TC_008
- - name: Install Jupyterhub
- command: ansible-playbook platforms/jupyterhub.yml -i inventory
- changed_when: false
- args:
- chdir: ../
- tags: TC_008
- - name: Install Kubeflow
- command: ansible-playbook platforms/kubeflow.yml -i inventory
- changed_when: false
- args:
- chdir: ../
- tags: TC_008
- - name: OMNIA_1.1_US_CRD_TC_008
- hosts: manager
- vars_files:
- - test_vars/test_jupyterhub_vars.yml
- - test_vars/test_kubeflow_vars.yml
- tasks:
- - name: Waiting for the pods deployment
- pause:
- minutes: 5
- tags: TC_008
-
- - name: Checking K8s services
- command: kubectl get services
- register: k8s_services
- changed_when: false
- failed_when: True
- tags: TC_008
- - name: Validating JupyterHub services
- assert:
- that:
- - "'hub' in k8s_services.stdout"
- - "'proxy-public' in k8s_services.stdout"
- - "'proxy-api' in k8s_services.stdout"
- fail_msg: "{{ jupyterhub_services_fail_msg }}"
- success_msg: "{{ jupyterhub_services_success_msg }}"
- tags: TC_008
-
- - name: Checking all running pods under jupyterhub namespace
- command: kubectl get pods --namespace jupyterhub --field-selector=status.phase=Running
- register: jupyterhub_running_pods
- changed_when: false
- failed_when: True
- tags: TC_008
- - name: Validating JupyterHub pods
- assert:
- that:
- - "'hub' in default_jupyterhub_pods.stdout"
- - "'proxy' in default_jupyterhub_pods.stdout"
- fail_msg: "{{ jupyterhub_pods_fail_msg }}"
- success_msg: "{{ jupyterhub_pods_success_msg }}"
- tags: TC_008
- - name: Checking installed Kubeflow version
- command: kfctl version
- register: kfctl_version
- changed_when: false
- failed_when: True
- tags: TC_008
- - name: Checking pods under kubeflow namespace
- command: kubectl get pods --namespace kubeflow
- register: kubeflow_pods
- changed_when: false
- ignore_errors: True
- tags: TC_008
- - name: Checking pods under istio-system namespace
- command: kubectl get pods --namespace istio-system
- register: istio_system_pods
- changed_when: false
- ignore_errors: True
- tags: TC_008
- - name: Validating Kubeflow Installation
- assert:
- that:
- - "'command not found' not in kfctl_version.stdout"
- fail_msg: "{{ kubeflow_install_fail_msg }}"
- success_msg: "{{ kubeflow_install_success_msg }}"
- tags: TC_008
- - name: Validating Kubeflow pods deployment
- assert:
- that:
- - "'Running' in kubeflow_pods.stdout or 'ContainerCreating' in kubeflow_pods.stdout"
- - "'Running' in istio_system_pods.stdout or 'ContainerCreating' in istio_system_pods.stdout"
- fail_msg: "{{ kubeflow_pods_deployment_fail_msg }}"
- success_msg: "{{ kubeflow_pods_deployment_success_msg }}"
- tags: TC_008
- #Testcase OMNIA_1.1_US_CRD_TC_009
- # Execute omnia.yml and reboot all the nodes
- - name: OMNIA_1.1_US_CRD_TC_009
- hosts: localhost
- vars_files:
- - test_vars/test_k8s_common_vars.yml
- - test_vars/test_slurm_common_vars.yml
- tasks:
- - name: Include variable file
- include_vars: test_vars/test_omnia_1.1_vars.yml
- tags: TC_009
- - name: Execute omnia.yml with default input parameters
- command: ansible-playbook omnia.yml -i inventory
- changed_when: false
- args:
- chdir: ../
- tags: TC_009
- - name: Reboot the nodes
- command: ansible all -i ../inventory -b -B 1 -P 0 -m shell -a "sleep {{ sleep_time }} && reboot"
- changed_when: false
- tags: TC_009
- - name: Waiting for services to restart
- pause:
- minutes: "{{ pod_time }}"
- tags: TC_009
- - name: Validate omnia.yml
- command: ansible-playbook test_omnia_validation.yml -i ../inventory
- changed_when: false
- tags: TC_009
- # Testcase OMNIA_1.1_US_CRD_TC_002
- # Execute omnia.yml with single node scenario (manager, compute and login node on same server)
- - name: OMNIA_1.1_US_CRD_TC_002
- hosts: localhost
- tasks:
- - name: Include variable file
- include_vars: test_vars/test_omnia_1.1_vars.yml
- tags: TC_002
- - name: Creating test inventory file for single node scenario
- copy:
- dest: "test_inventory.yml"
- mode: '{{ file_permission }}'
- content: |
-
- [manager]
- {{ host1 }}
- [compute]
- {{ host1 }}
-
- [login_node]
- {{ host1 }}
-
- [nfs_node]
- tags: TC_002
- - name: Check if omnia config file is encrypted
- command: cat ../{{ config_filename }}
- changed_when: false
- register: config_content
- no_log: True
- tags: TC_002
- - name: Decrpyt omnia_config.yml
- command: >-
- ansible-vault decrypt ../{{ config_filename }}
- --vault-password-file ../{{ config_vaultname }}
- when: "'$ANSIBLE_VAULT;' in config_content.stdout"
- tags: TC_002
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'k8s_cni: ""'
- replace: 'k8s_cni: "{{ k8s_cni_one }}"'
- tags: TC_002
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'mariadb_password: ""'
- replace: 'mariadb_password: "{{ db_passwd_invalid }}"'
- tags: TC_002
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'login_node_required:'
- replace: 'login_node_required: true'
- tags: TC_002
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'k8s_pod_network_cidr: ""'
- replace: 'k8s_pod_network_cidr: "{{ k8s_pod_network_cidr_other }}"'
- tags: TC_002
-
- - name: Run omnia.yml
- command: ansible-playbook omnia.yml -i test/test_inventory.yml
- failed_when: true
- changed_when: false
- register: db_error
- args:
- chdir: ../
- tags: TC_002
-
- - name: Validate mariadb password error
- assert:
- that:
- - '" mariadb_password not given in correct format" not in db_error.stdout'
- fail_msg: "{{ mariadb_password_error_fail_msg }}"
- success_msg: "{{ mariadb_password_error_success_msg }}"
- tags: TC_002
- - name: Delete the inventory file
- file:
- state: absent
- path: test_inventory.yml
- tags: TC_002
- # Testcase OMNIA_1.1_US_CRD_TC_003
- # Execute omnia.yml with single node scenario (manager, compute,login,nfs node on same server)
- - name: OMNIA_1.1_US_CRD_TC_003
- hosts: localhost
- tasks:
- - name: Include variable file
- include_vars: test_vars/test_omnia_1.1_vars.yml
- tags: TC_003
- - name: Creating inventory file for single node scenario
- copy:
- dest: "test_inventory.yml"
- mode: '{{ file_permission }}'
- content: |
-
- [manager]
- {{ host1 }}
- [compute]
- {{ host1 }}
-
- [login_node]
- {{ host1 }}
- [nfs_node]
- tags: TC_003
- - name: Check if omnia config file is encrypted
- command: cat ../{{ config_filename }}
- changed_when: false
- register: config_content
- no_log: True
- tags: TC_003
- - name: Decrpyt omnia_config.yml
- command: >-
- ansible-vault decrypt ../{{ config_filename }}
- --vault-password-file ../{{ config_vaultname }}
- when: "'$ANSIBLE_VAULT;' in config_content.stdout"
- tags: TC_003
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'k8s_cni: ""'
- replace: 'k8s_cni: "{{ k8s_cni_one }}"'
- tags: TC_003
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'mariadb_password: ""'
- replace: 'mariadb_password: "{{ db_passwd_invalid }}"'
- tags: TC_003
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'login_node_required:'
- replace: 'login_node_required: true'
- tags: TC_003
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'k8s_pod_network_cidr: ""'
- replace: 'k8s_pod_network_cidr: "{{ k8s_pod_network_cidr_other }}"'
- tags: TC_003
-
- - name: Run omnia.yml
- command: ansible-playbook omnia.yml -i test/test_inventory.yml
- failed_when: true
- changed_when: false
- register: db_error
- args:
- chdir: ../
- tags: TC_003
-
- - name: Validate mariadb password error
- assert:
- that:
- - '" mariadb_password not given in correct format" not in db_error.stdout'
- fail_msg: "{{ mariadb_password_error_fail_msg }}"
- success_msg: "{{ mariadb_password_error_success_msg }}"
- tags: TC_003
- - name: Delete the inventory file
- changed_when: false
- file:
- state: absent
- path: test_inventory.yml
- tags: TC_003
- #Testcase OMNIA_1.1_US_CRD_TC_004
- # Execute omnia.yml with separate servers for manager,compute,login,nfs node on new kubernetes version
- - name: OMNIA_1.1_US_CRD_TC_004
- hosts: localhost
- tasks:
- - name: Include variable file
- include_vars: test_vars/test_omnia_1.1_vars.yml
- tags: TC_004
- - name: Creating test inventory
- copy:
- dest: "test_inventory.yml"
- mode: '{{ file_permission }}'
- content: |
-
- [manager]
- {{ host1 }}
- [compute]
- {{ host2 }}
-
- [login_node]
- {{ host3 }}
-
- [nfs_node]
- tags: TC_004
- - name: Check if omnia config file is encrypted
- command: cat ../{{ config_filename }}
- changed_when: false
- register: config_content
- no_log: True
- tags: TC_004
- - name: Decrpyt omnia_config.yml
- command: >-
- ansible-vault decrypt ../{{ config_filename }}
- --vault-password-file ../{{ config_vaultname }}
- when: "'$ANSIBLE_VAULT;' in config_content.stdout"
- tags: TC_004
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'k8s_cni: ""'
- replace: 'k8s_cni: "{{ k8s_cni_two }}"'
- tags: TC_004
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'mariadb_password: ""'
- replace: 'mariadb_password: "{{ db_passwd_complex }}"'
- tags: TC_004
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'login_node_required:'
- replace: 'login_node_required: true'
- tags: TC_004
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'k8s_pod_network_cidr: ""'
- replace: 'k8s_pod_network_cidr: "{{ k8s_pod_network_cidr_default }}"'
- tags: TC_004
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'k8s_version: ""'
- replace: 'k8s_version: "{{ k8s_new_version }}"'
- tags: TC_004
-
- - name: Execute omnia.yml
- command: ansible-playbook omnia.yml -i test/test_inventory.yml
- changed_when: false
- args:
- chdir: ../
- tags: TC_004
-
- - name: Validate omnia.yml
- command: ansible-playbook test_omnia_validation.yml -i test_inventory.yml
- changed_when: false
- tags: TC_004
- - name: Delete the inventory file
- file:
- state: absent
- path: test_inventory.yml
- tags: TC_004
- #Testcase OMNIA_1.1_US_CRD_TC_007
- # Execute omnia.yml after redeploying the cluster
- - name: OMNIA_1.1_US_CRD_TC_007
- hosts: localhost
- tasks:
- - name: Execute omnia.yml with default input parameters
- command: ansible-playbook omnia.yml -i inventory
- changed_when: false
- args:
- chdir: ../
- tags: TC_007
- - name: Re Execute omnia.yml
- command: ansible-playbook omnia.yml -i inventory
- changed_when: false
- args:
- chdir: ../
- tags: TC_007
-
- - name: Validate omnia.yml
- command: ansible-playbook test_omnia_validation.yml -i ../inventory
- changed_when: false
- tags: TC_007
- # Testcase OMNIA_1.1_US_CRD_TC_010
- # Execute omnia.yml with same server for manager and compute with slurm first and kubernetes later
- - name: OMNIA_1.1_US_CRD_TC_010
- hosts: localhost
- tasks:
- - name: Include variable file
- include_vars: test_vars/test_omnia_1.1_vars.yml
- tags: TC_010
- - name: Creating test inventory file
- copy:
- dest: "test_inventory.yml"
- mode: '{{ file_permission }}'
- content: |
-
- [manager]
- {{ host1 }}
- [compute]
- {{ host1 }}
-
- [login_node]
- {{ host3 }}
- [nfs_node]
- tags: TC_010
- - name: Check if omnia config file is encrypted
- command: cat ../{{ config_filename }}
- changed_when: false
- register: config_content
- no_log: True
- tags: TC_010
- - name: Decrpyt omnia_config.yml
- command: >-
- ansible-vault decrypt ../{{ config_filename }}
- --vault-password-file ../{{ config_vaultname }}
- when: "'$ANSIBLE_VAULT;' in config_content.stdout"
- tags: TC_010
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'k8s_cni: ""'
- replace: 'k8s_cni: "{{ k8s_cni_one }}"'
- tags: TC_010
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'mariadb_password: ""'
- replace: 'mariadb_password: "{{ db_passwd_default }}"'
- tags: TC_010
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'login_node_required:'
- replace: 'login_node_required: true'
- tags: TC_010
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'k8s_pod_network_cidr: ""'
- replace: 'k8s_pod_network_cidr: "{{ k8s_pod_network_cidr_other }}"'
- tags: TC_010
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'ipa_admin_password: ""'
- replace: 'ipa_admin_password: "{{ ipa_passwd_default }}"'
- tags: TC_010
-
- - name: Run omnia.yml
- command: ansible-playbook omnia.yml -i test/test_inventory.yml --skip-tags kubernetes
- failed_when: true
- changed_when: false
- args:
- chdir: ../
- tags: TC_010
- - name: Re Execute omnia.yml
- command: ansible-playbook omnia.yml -i test/test_inventory.yml --skip-tags slurm,freeipa
- changed_when: false
- args:
- chdir: ../
- tags: TC_010
-
- - name: Validate omnia.yml
- command: ansible-playbook test_omnia_validation.yml -i test_inventory.yml
- changed_when: false
- tags: TC_010
- # Testcase OMNIA_1.1_US_CRD_TC_011
- # Execute omnia.yml with separate servers for manager,compute,login,nfs node with slurm first and kubernetes later
- - name: OMNIA_1.1_US_CRD_TC_011
- hosts: localhost
- tasks:
- - name: Include variable file
- include_vars: test_vars/test_omnia_1.1_vars.yml
- tags: TC_011
- - name: Creating inventory file for
- copy:
- dest: "test_inventory.yml"
- mode: '{{ file_permission }}'
- content: |
-
- [manager]
- {{ host1 }}
- [compute]
- {{ host2 }}
-
- [login_node]
- {{ host3 }}
- [nfs_node]
- {{ host4 }}
- tags: TC_011
- - name: Check if omnia config file is encrypted
- command: cat ../{{ config_filename }}
- changed_when: false
- register: config_content
- no_log: True
- tags: TC_011
- - name: Decrpyt omnia_config.yml
- command: >-
- ansible-vault decrypt ../{{ config_filename }}
- --vault-password-file ../{{ config_vaultname }}
- when: "'$ANSIBLE_VAULT;' in config_content.stdout"
- tags: TC_011
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'k8s_cni: ""'
- replace: 'k8s_cni: "{{ k8s_cni_one }}"'
- tags: TC_011
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'mariadb_password: ""'
- replace: 'mariadb_password: "{{ db_passwd_default }}"'
- tags: TC_011
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'login_node_required: '
- replace: 'login_node_required: true'
- tags: TC_011
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'k8s_pod_network_cidr: ""'
- replace: 'k8s_pod_network_cidr: "{{ k8s_pod_network_cidr_other }}"'
- tags: TC_011
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'ipa_admin_password: ""'
- replace: 'ipa_admin_password: "{{ ipa_passwd_complex }}"'
- tags: TC_011
-
- - name: Run omnia.yml
- command: ansible-playbook omnia.yml -i test/test_inventory.yml --skip-tags kubernetes
- changed_when: false
- args:
- chdir: ../
- tags: TC_011
-
- - name: Run omnia.yml
- command: ansible-playbook omnia.yml -i test/test_inventory.yml --skip-tags slurm,freeipa
- changed_when: false
- args:
- chdir: ../
- tags: TC_011
- - name: Validate omnia.yml
- command: ansible-playbook test_omnia_validation.yml -i test_inventory.yml
- changed_when: false
- tags: TC_011
- - name: Delete the inventory file
- changed_when: false
- file:
- state: absent
- path: test_inventory.yml
- tags: TC_011
- # Testcase OMNIA_1.1_US_CRD_TC_012
- # Execute omnia.yml with separate servers for manager,compute,login,nfs node with slurm first and kubernetes later
- - name: OMNIA_1.1_US_CRD_TC_012
- hosts: localhost
- tasks:
- - name: Include variable file
- include_vars: test_vars/test_omnia_1.1_vars.yml
- tags: TC_012
- - name: Creating test inventory file
- copy:
- dest: "test_inventory.yml"
- mode: '{{ file_permission }}'
- content: |
-
- [manager]
- {{ host1 }}
- [compute]
- {{ host2 }}
-
- [login_node]
- {{ host3 }}
- [nfs_node]
- tags: TC_012
- - name: Check if omnia config file is encrypted
- command: cat ../{{ config_filename }}
- changed_when: false
- register: config_content
- no_log: True
- tags: TC_012
- - name: Decrpyt omnia_config.yml
- command: >-
- ansible-vault decrypt ../{{ config_filename }}
- --vault-password-file ../{{ config_vaultname }}
- when: "'$ANSIBLE_VAULT;' in config_content.stdout"
- tags: TC_012
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'k8s_cni: ""'
- replace: 'k8s_cni: "{{ k8s_cni_two }}"'
- tags: TC_012
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'mariadb_password: ""'
- replace: 'mariadb_password: "{{ db_passwd_default }}"'
- tags: TC_012
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'login_node_required:'
- replace: 'login_node_required: false'
- tags: TC_012
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'k8s_pod_network_cidr: ""'
- replace: 'k8s_pod_network_cidr: "{{ k8s_pod_network_cidr_other }}"'
- tags: TC_012
- - name: Edit input parameters in omnia_config.yml
- replace:
- path: ../omnia_config.yml
- regexp: 'ipa_admin_password: ""'
- replace: 'ipa_admin_password: "{{ ipa_passwd_invalid }}"'
- tags: TC_012
-
- - name: Run omnia.yml
- command: ansible-playbook omnia.yml -i test/test_inventory.yml --skip-tags kubernetes
- failed_when: true
- changed_when: false
- register: ipa_error
- args:
- chdir: ../
- tags: TC_012
-
- - name: Validate ipa admin password error
- assert:
- that:
- - '" Incorrect format provided for ipa_admin_password" not in ipa_error.stdout'
- fail_msg: "{{ ipa_password_error_fail_msg }}"
- success_msg: "{{ ipa_password_error_success_msg }}"
- tags: TC_012
- - name: Delete the inventory file
- file:
- state: absent
- path: test_inventory.yml
- tags: TC_012
|