Skip to content

Commit

Permalink
Merge branch 'master' into mgirgis_crd_test
Browse files Browse the repository at this point in the history
  • Loading branch information
mgirgisf authored Oct 28, 2024
2 parents 6ee9616 + f929332 commit 170a32a
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ci/logging_tests_computes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
- ceilometer_agent_compute
- nova_compute
tasks:
- name: "Verify journalctl logging identifiers"
- name: "Run Telemetry Logging tests"
ansible.builtin.import_role:
name: telemetry_logging
22 changes: 16 additions & 6 deletions roles/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,26 @@ can be set at the play level.
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
vars:
common_pod_test_id: "RHOSO-12752"
common_pod_status_str: "Running"
common_pod_nspace: openstack
common_pod_list:
- openstackclient
tasks:
- name: "Verify Running Pods"
ansible.builtin.import_role:
name: common
vars:
common_pod_test_id: "RHOSO-12752"
common_pod_status_str: "Running"
common_pod_nspace: openstack
common_pod_list:
- openstackclient

- name: "Verify status of multiple containers"
ansible.builtin.include_role:
name: common
vars:
common_container_test_id: "RHOSO-12753"
common_container_list:
- ceilometer_agent_compute
- ceilometer_agent_ipmi
- node_exporter

- name: "Verify projects"
ansible.builtin.import_role:
Expand Down
15 changes: 15 additions & 0 deletions roles/common/tasks/container_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- name: Get container status
ansible.builtin.shell:
cmd: |
podman ps -a --format "{{ '{{.Names}} {{.Status}}' }}" | grep {{ item }}
changed_when: false
register: container_status


- name: Verify container status {{ common_container_test_id }}
ansible.builtin.assert:
that:
- "'Up' in container_status.stdout"
success_msg: "Container '{{ item }}' is in 'Up' status."
fail_msg: "Container '{{ item }}' is not in 'Up' status. Current status: {{ container_status.stdout }}"
8 changes: 8 additions & 0 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@
- common_crd_list is defined
ansible.builtin.include_tasks: "crd_tests.yml"
loop: "{{ common_crd_list }}"

- name: "Verify container tests"
when:
- common_container_list is defined
- common_container_test_id is defined
ansible.builtin.include_tasks: "container_test.yml"
loop: "{{ common_container_list }}"

0 comments on commit 170a32a

Please sign in to comment.