test_slurm_exporter_inst_k8s.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. # OMNIA_PSE_TC_001
  16. # Successful installation of slurm exporter on the host when both slurm and kubernetes is installed
  17. - name: OMNIA_PSE_TC_001
  18. hosts: manager
  19. vars_files:
  20. - test_vars/test_slurmexporter_vars.yml
  21. tasks:
  22. - block:
  23. - name: Call install slurm exporter role
  24. include_role:
  25. name: ../roles/slurm_exporter
  26. tags: TC_001
  27. - name: Verify slurm exporter status
  28. systemd:
  29. name: prometheus-slurm-exporter
  30. register: slurm_exporter_status
  31. tags: TC_001, VERIFY_001
  32. - name: Validate slurm exporter service status
  33. assert:
  34. that:
  35. - slurm_exporter_status.status.ActiveState == 'active'
  36. fail_msg: "{{ slurm_exporter_service_fail_msg }}"
  37. success_msg: "{{ slurm_exporter_service_success_msg }}"
  38. tags: TC_001, VERIFY_001
  39. - name: Verify slurm exporter job in k8s services
  40. command: kubectl get service prometheus-slurmexporter-metrics-1
  41. register: slurm_exporter_service_status
  42. tags: TC_001, VERIFY_001
  43. changed_when: False
  44. - name: Validate slurm exporter job in k8s services
  45. assert:
  46. that:
  47. - "'Error from server' not in slurm_exporter_service_status.stdout"
  48. fail_msg: "{{ slurm_exporter_job_fail_msg }}"
  49. success_msg: "{{ slurm_exporter_job_success_msg }}"
  50. tags: TC_001, VERIFY_001