# Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. --- # Testcase to verify count of AWX pods - name: OMNIA_1.2_AWX_TC_001 hosts: localhost vars_files: - vars/test_awx_vars.yml tasks: - name: Get AWX pods shell: "kubectl get pods -n awx" register: awx_pods - name: Set the count of fetched pods set_fact: count: "{{ awx_pods.stdout_lines|length - 1 }}" - name: Validate count of AWX pods with defined count assert: that: - "{{ awx_pod_count }} == {{ count }}" success_msg: "Pod count validated" fail_msg: "Some pods missing" tags: AWX_TC_001 # Testcase to verify AWX version - name: OMNIA_1.2_AWX_TC_002 hosts: localhost vars_files: - vars/test_awx_vars.yml tasks: - name: Get AWX image info shell: "buildah images | grep 'awx'" register: awx_image_info - name: Get awx image details set_fact: awx_images: "{{ item }}" with_items: - "{{ awx_image_info.stdout_lines }}" run_once: true ignore_errors: true when: item | regex_search(awx_latest_version) - name: Get version for awx assert: that: - awx_image_info.stdout_lines[{{ item }}] | regex_search( "{{ awx_latest_version }}") success_msg: "Version check successful" fail_msg: "Version check failed" ignore_errors: yes with_sequence: start=0 end={{ awx_image_info.stdout_lines |length - 1 }} tags: AWX_TC_002