test_slurm_workers.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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_005
  16. # Execute slurm_worker role in compute node with os installed centos 7.9
  17. - name: OMNIA_USP_US_VFSP_TC_005
  18. hosts: compute
  19. vars_files:
  20. - test_vars/test_slurm_workers_vars.yml
  21. tasks:
  22. - block:
  23. - name: Call slurm worker role
  24. include_role:
  25. name: ../roles/slurm_workers
  26. tags: TC_005
  27. - name: Fetch slurm packages installed
  28. package_facts:
  29. manager: auto
  30. tags: TC_005,VERIFY_005
  31. - name: Check if slurm is installed
  32. command: sinfo -V
  33. register: slurm_version
  34. changed_when: false
  35. ignore_errors: True
  36. tags: TC_005,VERIFY_005
  37. - name: Checking slurmd service status
  38. service:
  39. name: slurmd.service
  40. register: slurmd_service
  41. tags: TC_005, VERIFY_005
  42. - name: Verify all slurm packages are installed
  43. assert:
  44. that: "'{{ item }}' in ansible_facts.packages"
  45. success_msg: "{{ slurm_packages_status_success_msg }}"
  46. fail_msg: "{{ slurm_packages_status_fail_msg }}"
  47. with_items:
  48. - "{{ slurm_packages }}"
  49. - "{{ dev_tools }}"
  50. tags: TC_005, VERIFY_005
  51. - name: Validate slurm installation
  52. assert:
  53. that: "'command not found' not in slurm_version.stdout"
  54. fail_msg: "{{ slurm_status_fail_msg }}"
  55. success_msg: "{{ slurm_status_success_msg }}"
  56. tags: TC_005, VERIFY_005
  57. - name: Validating slurmd service status
  58. assert:
  59. that:
  60. - slurmd_service.status.ActiveState == 'active'
  61. fail_msg: "{{ slurmd_service_fail_msg }}"
  62. success_msg: "{{ slurmd_service_success_msg }}"
  63. tags: TC_005, VERIFY_005
  64. # Testcase OMNIA_USP_US_VFSP_TC_006
  65. # Execute slurm_workers role in compute node with slurm packages already installed
  66. - name: OMNIA_USP_US_VFSP_TC_006
  67. hosts: compute
  68. vars_files:
  69. - test_vars/test_slurm_workers_vars.yml
  70. tasks:
  71. - block:
  72. - name: Call slurm worker role
  73. include_role:
  74. name: ../roles/slurm_workers
  75. tags: TC_006
  76. - name: Fetch slurm packages installed
  77. package_facts:
  78. manager: auto
  79. tags: TC_006,VERIFY_006
  80. - name: Checking slurmd service status
  81. service:
  82. name: slurmd.service
  83. register: slurmd_service
  84. tags: TC_006, VERIFY_006
  85. - name: Check if slurm is installed
  86. command: sinfo -V
  87. register: slurm_version
  88. changed_when: false
  89. ignore_errors: True
  90. tags: TC_006,VERIFY_006
  91. - name: Verify all slurm packages are installed
  92. assert:
  93. that: "'{{ item }}' in ansible_facts.packages"
  94. success_msg: "{{ slurm_packages_status_success_msg }}"
  95. fail_msg: "{{ slurm_packages_status_fail_msg }}"
  96. with_items:
  97. - "{{ slurm_packages }}"
  98. - "{{ dev_tools }}"
  99. tags: TC_006, VERIFY_006
  100. - name: Validate slurm installation
  101. assert:
  102. that: "'command not found' not in slurm_version.stdout"
  103. fail_msg: "{{ slurm_status_fail_msg }}"
  104. success_msg: "{{ slurm_status_success_msg }}"
  105. tags: TC_006, VERIFY_006
  106. - name: Validating slurmd service status
  107. assert:
  108. that:
  109. - slurmd_service.status.ActiveState == 'active'
  110. fail_msg: "{{ slurmd_service_fail_msg }}"
  111. success_msg: "{{ slurmd_service_success_msg }}"
  112. tags: TC_006, VERIFY_006