test_slurm_manager.yml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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_003
  16. # Execute slurm_manager role in manager node with os installed centos 7.9
  17. - name: OMNIA_USP_US_VFSP_TC_003
  18. hosts: manager
  19. vars_files:
  20. - test_vars/test_slurm_manager_vars.yml
  21. - ../appliance/roles/common/vars/main.yml
  22. tasks:
  23. - block:
  24. - name: Call cluster_validation role
  25. include_role:
  26. name: ../roles/cluster_validation
  27. tasks_from: fetch_password
  28. tags: TC_003
  29. - name: Call slurm manager role
  30. include_role:
  31. name: ../roles/slurm_manager
  32. tags: TC_003
  33. - name: Fetch slurm packages installed
  34. package_facts:
  35. manager: auto
  36. tags: TC_003,VERIFY_003
  37. - name: Start and enable firewalld
  38. service:
  39. name: firewalld
  40. state: started
  41. enabled: yes
  42. tags: TC_003, VERIFY_003
  43. - name: Checking firewalld tcp/udp ports on manager node
  44. command: firewall-cmd --list-ports
  45. register: manager_firewalld_ports
  46. when: "'manager' in group_names"
  47. tags: TC_003, VERIFY_003
  48. - name: Checking mariadb service status
  49. systemd:
  50. name: mariadb
  51. register: mariadb_service
  52. tags: TC_003, VERIFY_003
  53. - name: Validating tcp/udp ports on manager node
  54. assert:
  55. that:
  56. - "'6817/tcp' in manager_firewalld_ports.stdout"
  57. - "'6817/udp' in manager_firewalld_ports.stdout"
  58. - "'6818/tcp' in manager_firewalld_ports.stdout"
  59. - "'6818/udp' in manager_firewalld_ports.stdout"
  60. - "'6819/tcp' in manager_firewalld_ports.stdout"
  61. - "'6819/udp' in manager_firewalld_ports.stdout"
  62. fail_msg: "{{ manager_ports_status_fail_msg }}"
  63. success_msg: "{{ manager_ports_status_success_msg }}"
  64. when: "'manager' in group_names"
  65. tags: TC_003, VERIFY_003
  66. - name: Verify all slurm packages are installed
  67. assert:
  68. that: "'{{ item }}' in ansible_facts.packages"
  69. success_msg: "{{ slurm_packages_status_success_msg }}"
  70. fail_msg: "{{ slurm_packages_status_fail_msg }}"
  71. with_items:
  72. - "{{ slurm_packages }}"
  73. - "{{ dev_tools }}"
  74. tags: TC_003, VERIFY_003
  75. - name: Validating mariadb service status
  76. assert:
  77. that:
  78. - mariadb_service.status.ActiveState == 'active'
  79. fail_msg: "{{ mariadb_service_fail_msg }}"
  80. success_msg: "{{ mariadb_service_success_msg }}"
  81. tags: TC_003, VERIFY_003
  82. # Testcase OMNIA_USP_US_VFSP_TC_004
  83. # Execute slurm_manager role in manager node with slurm packages already installed
  84. - name: OMNIA_USP_US_VFSP_TC_004
  85. hosts: manager
  86. vars_files:
  87. - test_vars/test_slurm_manager_vars.yml
  88. - ../appliance/roles/common/vars/main.yml
  89. tasks:
  90. - block:
  91. - name: Call cluster_validation role
  92. include_role:
  93. name: ../roles/cluster_validation
  94. tasks_from: fetch_password
  95. tags: TC_004
  96. - name: Call slurm manager role
  97. include_role:
  98. name: ../roles/slurm_manager
  99. tags: TC_004
  100. - name: Fetch slurm packages installed
  101. package_facts:
  102. manager: auto
  103. tags: TC_004,VERIFY_004
  104. - name: Start and enable firewalld
  105. service:
  106. name: firewalld
  107. state: started
  108. enabled: yes
  109. tags: TC_004, VERIFY_004
  110. - name: Checking firewalld tcp/udp ports on manager node
  111. command: firewall-cmd --list-ports
  112. register: manager_firewalld_ports
  113. when: "'manager' in group_names"
  114. tags: TC_004, VERIFY_004
  115. - name: Checking mariadb service status
  116. systemd:
  117. name: mariadb
  118. register: mariadb_service
  119. tags: TC_004, VERIFY_004
  120. - name: Validating tcp/udp ports on manager node
  121. assert:
  122. that:
  123. - "'6817/tcp' in manager_firewalld_ports.stdout"
  124. - "'6817/udp' in manager_firewalld_ports.stdout"
  125. - "'6818/tcp' in manager_firewalld_ports.stdout"
  126. - "'6818/udp' in manager_firewalld_ports.stdout"
  127. - "'6819/tcp' in manager_firewalld_ports.stdout"
  128. - "'6819/udp' in manager_firewalld_ports.stdout"
  129. fail_msg: "{{ manager_ports_status_fail_msg }}"
  130. success_msg: "{{ manager_ports_status_success_msg }}"
  131. when: "'manager' in group_names"
  132. tags: TC_004, VERIFY_004
  133. - name: Verify all slurm packages are installed
  134. assert:
  135. that: "'{{ item }}' in ansible_facts.packages"
  136. success_msg: "{{ slurm_packages_status_success_msg }}"
  137. fail_msg: "{{ slurm_packages_status_fail_msg }}"
  138. with_items:
  139. - "{{ slurm_packages }}"
  140. - "{{ dev_tools }}"
  141. tags: TC_004, VERIFY_004
  142. - name: Validating mariadb service status
  143. assert:
  144. that:
  145. - mariadb_service.status.ActiveState == 'active'
  146. fail_msg: "{{ mariadb_service_fail_msg }}"
  147. success_msg: "{{ mariadb_service_success_msg }}"
  148. tags: TC_004, VERIFY_004