test_awx.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Copyright 2022 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 to verify count of AWX pods
  16. - name: OMNIA_1.2_AWX_TC_001
  17. hosts: localhost
  18. vars_files:
  19. - vars/test_awx_vars.yml
  20. tasks:
  21. - name: Get AWX pods
  22. shell: "kubectl get pods -n awx"
  23. register: awx_pods
  24. - name: Set the count of fetched pods
  25. set_fact:
  26. count: "{{ awx_pods.stdout_lines|length - 1 }}"
  27. - name: Validate count of AWX pods with defined count
  28. assert:
  29. that:
  30. - "{{ awx_pod_count }} == {{ count }}"
  31. success_msg: "Pod count validated"
  32. fail_msg: "Some pods missing"
  33. tags: AWX_TC_001
  34. # Testcase to verify AWX version
  35. - name: OMNIA_1.2_AWX_TC_002
  36. hosts: localhost
  37. vars_files:
  38. - vars/test_awx_vars.yml
  39. tasks:
  40. - name: Get AWX image info
  41. shell: "buildah images | grep 'awx'"
  42. register: awx_image_info
  43. - name: Get awx image details
  44. set_fact:
  45. awx_images: "{{ item }}"
  46. with_items:
  47. - "{{ awx_image_info.stdout_lines }}"
  48. run_once: true
  49. ignore_errors: true
  50. when: item | regex_search(awx_latest_version)
  51. - name: Get version for awx
  52. assert:
  53. that:
  54. - awx_image_info.stdout_lines[{{ item }}] | regex_search( "{{ awx_latest_version }}")
  55. success_msg: "Version check successful"
  56. fail_msg: "Version check failed"
  57. ignore_errors: yes
  58. with_sequence: start=0 end={{ awx_image_info.stdout_lines |length - 1 }}
  59. tags: AWX_TC_002