Skip to content

Commit

Permalink
update the logging_tests_controller with a loop
Browse files Browse the repository at this point in the history
  • Loading branch information
mgirgisf committed Oct 14, 2024
1 parent ae94229 commit a6a9667
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 110 deletions.
126 changes: 16 additions & 110 deletions ci/logging_tests_controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,116 +6,22 @@
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
vars:
common_pod_test_id: "RHOS0-12672"
common_pod_status_str: "Running"
common_pod_nspace: openstack-operators
common_pod_list:
- telemetry-operator-controller-manager
- dataplane-operator-controller-manager

- name: "Verify logging pods are running in openstack"
hosts: controller
gather_facts: no
ignore_errors: true
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


- name: "Verify logging pods are running in openshift-operators-redhat"
hosts: controller
gather_facts: no
ignore_errors: true
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
vars:
common_pod_test_id: "RHOSO-12673"
common_pod_status_str: "Running"
common_pod_nspace: openshift-operators-redhat
common_pod_list:
- loki-operator-controller-manager

tasks:
- name: "Verify Pods running"
ansible.builtin.import_role:
name: common

- name: "Verify logging pods are running in openshift-logging"
hosts: controller
gather_facts: no
ignore_errors: true
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
vars:
common_pod_test_id: "RHOSO-12676"
common_pod_status_str: "Running"
common_pod_nspace: openshift-logging
common_pod_list:
- cluster-logging-operator
- collector
- logging-loki-compactor
- logging-loki-distributor
#- logging-loki-gateway
- logging-loki-index-gateway
- logging-loki-ingester
- logging-loki-querier
- logging-loki-query-frontend
- logging-view-plugin

### see JIRA LOG-5431 if pods not running
tasks:
- name: "Verify Pods running"
ansible.builtin.import_role:
name: common

- name: "Verify logging pods are running in minio-dev"
hosts: controller
gather_facts: no
ignore_errors: true
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
vars:
common_pod_test_id: "RHOSO-12674"
common_pod_status_str: "Running"
common_pod_nspace: minio-dev
common_pod_list:
- minio

tasks:
- name: "Run pod running tests"
ansible.builtin.import_role:
name: common


- name: "Verify logging pods have complete status in openstack"
hosts: controller
gather_facts: no
ignore_errors: true
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
vars:
common_pod_test_id: "RHOSO-12679"
common_pod_nspace: openstack
common_pod_status_str: "Completed"
common_pod_list:
- logging-edpm-deployment-openstack-edpm-ipam
vars_files:
- logging_test.yml
tasks:
- name: "Run pods completed tests"
- name: "Verify Pods Status in Loop"
block:
- name: "Run Pod Check"
ansible.builtin.import_role:
name: common

vars:
common_pod_test_id: "{{ item.test_id }}"
common_pod_status_str: "{{ item.status }}"
common_pod_nspace: "{{ item.namespace }}"
common_pod_list: "{{ item.pod_list }}"
rescue:
- name: "Log Failure for Pod Check {{ item.test_id }}"
ansible.builtin.debug:
msg: "Pod check failed for namespace: {{ item.namespace }}. Moving to next check."
when: item is defined
with_items: "{{ logging_pod_checks }}"
46 changes: 46 additions & 0 deletions ci/vars/logging_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
logging_pod_checks:
- test_id: "RHOS0-12672"
status: "Running"
namespace: "openstack-operators"
pod_list:
- telemetry-operator-controller-manager
- dataplane-operator-controller-manager

- test_id: "RHOSO-12752"
status: "Running"
namespace: "openstack"
pod_list:
- openstackclient

- test_id: "RHOSO-12673"
status: "Running"
namespace: "openshift-operators-redhat"
pod_list:
- loki-operator-controller-manager

- test_id: "RHOSO-12676"
status: "Running"
namespace: "openshift-logging"
pod_list:
- cluster-logging-operator
- collector
- logging-loki-compactor
- logging-loki-distributor
#- logging-loki-gateway
- logging-loki-index-gateway
- logging-loki-ingester
- logging-loki-querier
- logging-loki-query-frontend
- logging-view-plugin

- test_id: "RHOSO-12674"
status: "Running"
namespace: "minio-dev"
pod_list:
- minio

- test_id: "RHOSO-12679"
status: "Completed"
namespace: "openstack"
pod_list:
- logging-edpm-deployment-openstack-edpm-ipam
1 change: 1 addition & 0 deletions roles/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Variable required for all tasks to run
For pod_tests.yml tasks:

common_pod_test_id
- polarion ID number for each test.
common_pod_list
- list of pods to validate
common_pod_status_str
Expand Down

0 comments on commit a6a9667

Please sign in to comment.