test_slurm_common.yml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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_USP_US_VFSP_TC_001
  16. # Execute slurm_common role in manager & compute nodes with os installed centos 7.9
  17. - name: OMNIA_USP_US_VFSP_TC_001
  18. hosts: manager, compute
  19. vars_files:
  20. - test_vars/test_slurm_common_vars.yml
  21. tasks:
  22. - block:
  23. - name: Call slurm common role
  24. include_role:
  25. name: ../roles/slurm_common
  26. tags: TC_001
  27. - name: Fetch common packages installed
  28. package_facts:
  29. manager: auto
  30. tags: TC_001,VERIFY_001
  31. - name: Checking munge service status
  32. systemd:
  33. name: munge
  34. register: munge_service
  35. tags: TC_001, VERIFY_001
  36. - name: Verify all required packages are installed
  37. assert:
  38. that: "'{{ item }}' in ansible_facts.packages"
  39. success_msg: "{{ packages_status_success_msg }}"
  40. fail_msg: "{{ packages_status_fail_msg }}"
  41. with_items: "{{ common_packages }}"
  42. tags: TC_001,VERIFY_001
  43. - name: Validating munge service status
  44. assert:
  45. that:
  46. - munge_service.status.ActiveState == 'active'
  47. fail_msg: "{{ munge_service_fail_msg }}"
  48. success_msg: "{{ munge_service_success_msg }}"
  49. tags: TC_001, VERIFY_001
  50. # Testcase OMNIA_USP_US_VFSP_TC_002
  51. # Execute slurm_common role in manager & compute nodes with common packages already installed
  52. - name: OMNIA_USP_US_VFSP_TC_002
  53. hosts: manager, compute
  54. vars_files:
  55. - test_vars/test_slurm_common_vars.yml
  56. tasks:
  57. - block:
  58. - name: Call slurm common role
  59. include_role:
  60. name: ../roles/slurm_common
  61. tags: TC_002, VERIFY_002
  62. - name: Fetch common packages installed
  63. package_facts:
  64. manager: auto
  65. tags: TC_002,VERIFY_002
  66. - name: Checking munge service status
  67. systemd:
  68. name: munge
  69. register: munge_service
  70. tags: TC_002, VERIFY_002
  71. - name: Verify all required packages are installed
  72. assert:
  73. that: "'{{ item }}' in ansible_facts.packages"
  74. success_msg: "{{ packages_status_success_msg }}"
  75. fail_msg: "{{ packages_status_fail_msg }}"
  76. with_items: "{{ common_packages }}"
  77. tags: TC_002,VERIFY_002
  78. - name: Validating munge service status
  79. assert:
  80. that:
  81. - munge_service.status.ActiveState == 'active'
  82. fail_msg: "{{ munge_service_fail_msg }}"
  83. success_msg: "{{ munge_service_success_msg }}"
  84. tags: TC_002, VERIFY_002