diff --git a/ci/logging_tests_computes.yml b/ci/logging_tests_computes.yml index 9d229e7c2..bb2d34aec 100644 --- a/ci/logging_tests_computes.yml +++ b/ci/logging_tests_computes.yml @@ -7,13 +7,14 @@ KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" PATH: "{{ cifmw_path }}" vars: - journal_test_id: "RHOSO-12681" - journal_list: - - ceilometer_agent_compute - - nova_compute + telemetry_logging_journal_test_id: "RHOSO-12681" + telemetry_logging_journal_list: + - { name: ceilometer_agent_compute, test_id: "{{ telemetry_logging_journal_test_id }}" } + - { name: nova_compute, test_id: "{{ telemetry_logging_journal_test_id }}" } + common_file_test_id: "RHOSO-12754" common_file_list: - - /etc/rsyslog.d/10-telemetry.conf + - { name: "/etc/rsyslog.d/10-telemetry.conf", test_id: "{{ common_file_test_id }}"} tasks: - name: "Run Telemetry Logging tests" ansible.builtin.import_role: diff --git a/ci/logging_tests_controller.yml b/ci/logging_tests_controller.yml index a76f890e1..94bd9ef32 100644 --- a/ci/logging_tests_controller.yml +++ b/ci/logging_tests_controller.yml @@ -10,21 +10,21 @@ - vars/osp18_env.yml vars: common_pod_test_id: "RHOSO-12672" - common_pod_status_str: "Running" - common_pod_nspace: openstack-operators + # common_pod_status_str: "Running" + # common_pod_nspace: openstack-operators common_pod_list: - - telemetry-operator-controller-manager - - openstack-operator-controller-manager + - { name: telemetry-operator-controller-manager, nspace: openstack-operators, status_str: "Running", test_id: "RHOSO-13761" } + - { name: openstack-operator-controller-manager, nspace: openstack-operators, status_str: "Running", test_id: "RHOSO-13762" } common_subscription_test_id: "RHOSO-12678" - common_subscription_nspace: openshift-operators-redhat + # common_subscription_nspace: openshift-operators-redhat common_subscription_list: - - loki-operator - common_project_test_id: "RHOSO-12668" + - { name: loki-operator, nspace: openshift-operators-redhat, test_id: "RHOSO-12678"} + #common_project_test_id: "RHOSO-12668" common_project_list: - - openshift-openstack-infra - - openshift - - openstack-operators - - openshift-logging + - { name: openshift-openstack-infra, test_id: "RHOSO-13764" } + - { name: openshift, test_id: "RHOSO-13763"} + - { name: openstack-operators, test_id: "RHOSO-13732" } + - { name: openshift-logging, test_id: "RHOSO-13731"} common_endpoint_test_id: "RHOSO-12682" common_endpoint_list: - [nova,compute,public] @@ -43,31 +43,29 @@ - [glance,image,internal] - [neutron,network,public] - [neutron,network,internal] - common_manifest_test_id: "RHOSO-12677" common_manifest_list: - "loki-operator 2" - "loki-helm-operator 1" - common_service_test_id: "RHOSO-12675" - common_service_nspace: openshift-logging + # common_service_nspace: openshift-logging common_service_list: - - cluster-logging-operator-metrics - - logging-loki-compactor-grpc - - logging-loki-compactor-http - - logging-loki-distributor-grpc - - logging-loki-distributor-http - - logging-loki-gateway-http - - logging-loki-gossip-ring - - logging-loki-index-gateway-grpc - - logging-loki-index-gateway-http - - logging-loki-ingester-grpc - - logging-loki-ingester-http - - logging-loki-querier-grpc - - logging-loki-querier-http - - logging-loki-query-frontend-grpc - - logging-loki-query-frontend-http - - openstack-logging + - { name: cluster-logging-operator-metrics, nspace: openshift-logging,test_id: "RHOSO-13744"} + - { name: logging-loki-compactor-grpc, nspace: openshift-logging, test_id: "RHOSO-13746"} + - { name: logging-loki-compactor-http, nspace: openshift-logging, test_id: "RHOSO-13747"} + - { name: logging-loki-distributor-grpc, nspace: openshift-logging, test_id: "RHOSO-13748"} + - { name: logging-loki-distributor-http, nspace: openshift-logging, test_id: "RHOSO-13749"} + - { name: logging-loki-gateway-http, nspace: openshift-logging, test_id: "RHOSO-13750"} + - { name: logging-loki-gossip-ring, nspace: openshift-logging, test_id: "RHOSO-13751"} + - { name: logging-loki-index-gateway-grpc, nspace: openshift-logging, test_id: "RHOSO-13752"} + - { name: logging-loki-index-gateway-http, nspace: openshift-logging, test_id: "RHOSO-13753"} + - { name: logging-loki-ingester-grpc, nspace: openshift-logging, test_id: "RHOSO-13754"} + - { name: logging-loki-ingester-http, nspace: openshift-logging, test_id: "RHOSO-13755"} + - { name: logging-loki-querier-grpc, nspace: openshift-logging, test_id: "RHOSO-13756"} + - { name: logging-loki-querier-http, nspace: openshift-logging, test_id: "RHOSO-13757"} + - { name: logging-loki-query-frontend-grpc, nspace: openshift-logging, test_id: "RHOSO-13758"} + - { name: logging-loki-query-frontend-http, nspace: openshift-logging, test_id: "RHOSO-13759"} + - { name: openstack-logging, nspace: openshift-logging, test_id: "RHOSO-13760"} tasks: - name: "Verify logging infrastructure components" ansible.builtin.import_role: @@ -82,10 +80,10 @@ PATH: "{{ cifmw_path }}" vars: common_pod_test_id: "RHOSO-12752" - common_pod_status_str: "Running" - common_pod_nspace: openstack + # common_pod_status_str: "Running" + # common_pod_nspace: openstack common_pod_list: - - openstackclient + - { name: openstackclient, status_str: "Running", nspace: "openstack", test_id: "RHOSO-12752"} tasks: - name: "Verify Running Pods" ansible.builtin.import_role: @@ -101,10 +99,10 @@ PATH: "{{ cifmw_path }}" vars: common_pod_test_id: "RHOSO-12673" - common_pod_status_str: "Running" - common_pod_nspace: openshift-operators-redhat + #common_pod_status_str: "Running" + #common_pod_nspace: openshift-operators-redhat common_pod_list: - - loki-operator-controller-manager + - { name: loki-operator-controller-manager, nspace: openshift-operators-redhat, status_str: "Running", test_id: "RHOSO-12673"} tasks: - name: "Verify Pods running" ansible.builtin.import_role: @@ -119,18 +117,19 @@ PATH: "{{ cifmw_path }}" vars: common_pod_test_id: "RHOSO-12676" - common_pod_status_str: "Running" - common_pod_nspace: openshift-logging + # common_pod_status_str: "Running" + # common_pod_nspace: openshift-logging common_pod_list: - - cluster-logging-operator - - logging-loki-compactor - - logging-loki-distributor - #- logging-loki-gateway - - logging-loki-index-gateway - - logging-loki-ingester - - logging-loki-querier - - logging-loki-query-frontend - - collector + - { name: cluster-logging-operator, nspace: openshift-logging, status_str: "Running", test_id: "{{ common_pod_test_id }}" } + - { name: logging-loki-compactor, nspace: openshift-logging, status_str: "Running", test_id: "RHOSO-13778" } + - { name: logging-loki-distributor, nspace: openshift-logging, status_str: "Running", test_id: "RHOSO-13780" } + #- { name: logging-loki-gateway, nspace: openshift-logging, status_str: "Running", test_id: "{{ common_pod_test_id }}" } + - { name: logging-loki-index-gateway, nspace: openshift-logging, status_str: "Running", test_id: "RHOSO-13781" } + - { name: logging-loki-ingester, nspace: openshift-logging, status_str: "Running", test_id: "RHOSO-13782" } + - { name: logging-loki-querier, nspace: openshift-logging, status_str: "Running", test_id: "RHOSO-13783" } + - { name: logging-loki-query-frontend, nspace: openshift-logging, status_str: "Running", test_id: "RHOSO-13784" } + - { name: collector, nspace: openshift-logging, status_str: "Running", test_id: "RHOSO-13745"} + ### see JIRA LOG-5431 if pods not running tasks: @@ -147,10 +146,10 @@ PATH: "{{ cifmw_path }}" vars: common_pod_test_id: "RHOSO-12674" - common_pod_status_str: "Running" - common_pod_nspace: minio-dev + # common_pod_status_str: "Running" + # common_pod_nspace: minio-dev common_pod_list: - - minio + - { name: minio, nspace: minio-dev, status_str: "Running", test_id: "RHOSO-12674" } tasks: - name: "Run pod running tests" ansible.builtin.import_role: @@ -165,26 +164,27 @@ 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_test_id: "RHOSO-12679" + #common_pod_nspace: openstack + #common_pod_status_str: "Completed" common_pod_list: - - bootstrap-edpm-deployment-openstack-edpm-ipam - - configure-network-edpm-deployment-openstack-edpm-ipam - - configure-os-edpm-deployment-openstack-edpm-ipam - - download-cache-edpm-deployment-openstack-edpm-ipam - - install-certs-edpm-deployment-openstack-edpm-ipam - - install-os-edpm-deployment-openstack-edpm-ipam - - libvirt-edpm-deployment-openstack-edpm-ipam - - logging-edpm-deployment-openstack-edpm-ipam - - neutron-metadata-edpm-deployment-openstack-edpm-ipam - - nova-edpm-deployment-openstack-edpm-ipam - - ovn-edpm-deployment-openstack-edpm-ipam - - reboot-os-edpm-deployment-openstack-edpm-ipam - - run-os-edpm-deployment-openstack-edpm-ipam - - ssh-known-hosts-edpm-deployment - - telemetry-edpm-deployment-openstack-edpm-ipam - - validate-network-edpm-deployment-openstack-edpm-ipam + # - bootstrap-edpm-deployment-openstack-edpm-ipam + # - configure-network-edpm-deployment-openstack-edpm-ipam + # - configure-os-edpm-deployment-openstack-edpm-ipam + # - download-cache-edpm-deployment-openstack-edpm-ipam + # - install-certs-edpm-deployment-openstack-edpm-ipam + # - install-os-edpm-deployment-openstack-edpm-ipam + # - libvirt-edpm-deployment-openstack-edpm-ipam + # - logging-edpm-deployment-openstack-edpm-ipam + # - neutron-metadata-edpm-deployment-openstack-edpm-ipam + # - nova-edpm-deployment-openstack-edpm-ipam + # - ovn-edpm-deployment-openstack-edpm-ipam + # - reboot-os-edpm-deployment-openstack-edpm-ipam + # - run-os-edpm-deployment-openstack-edpm-ipam + # - ssh-known-hosts-edpm-deployment + # - telemetry-edpm-deployment-openstack-edpm-ipam + # - validate-network-edpm-deployment-openstack-edpm-ipam + - { name: logging-edpm-deployment-openstack-edpm-ipam, nspace: openstack, status_str: "Completed", test_id: "RHOSO-12679"} tasks: - name: "Run pods completed tests" ansible.builtin.import_role: @@ -205,12 +205,12 @@ - nova-metadata-internal - nova-novncproxy-cell1-public - nova-public - common_crd_test_id: "RHOSO-12670" + #common_crd_test_id: "RHOSO-12670" common_crd_list: - - alertingrules.loki.grafana.com - - lokistacks.loki.grafana.com - - recordingrules.loki.grafana.com - - rulerconfigs.loki.grafana.com + - { name: alertingrules.loki.grafana.com, test_id: "RHOSO-12670"} + - { name: lokistacks.loki.grafana.com, test_id: "RHOSO-13787"} + - { name: recordingrules.loki.grafana.com, test_id: "RHOSO-13788"} + - { name: rulerconfigs.loki.grafana.com, test_id: "RHOSO-13789"} tasks: - name: "Run Services and CRD tests" ansible.builtin.import_role: diff --git a/roles/common/tasks/container_test.yml b/roles/common/tasks/container_test.yml index 1854e2007..092b28e26 100644 --- a/roles/common/tasks/container_test.yml +++ b/roles/common/tasks/container_test.yml @@ -2,7 +2,7 @@ - name: Get container status ansible.builtin.shell: cmd: | - podman ps -a --format "{{ '{{.Names}} {{.Status}}' }}" | grep {{ container_name }} + podman ps -a --format "{{ '{{.Names}} {{.Status}}' }}" | grep {{ container.name }} changed_when: false register: container_status @@ -24,14 +24,14 @@ var: debug_output.stdout_lines - name: | - TEST Verify {{ container_name }} container status - {{ common_container_test_id }} + TEST Verify {{ container.name }} container status + {{ container.test_id if container.test_id is defined }} ansible.builtin.assert: that: - "container_status.stdout | length != 0" - "'unhealthy' not in container_status.stdout" - success_msg: "Container '{{ container_name }}' is in 'healthy' status." + success_msg: "Container '{{ container.name }}' is in 'healthy' status." fail_msg: | Container does not meet the required conditions: - {%- if container_status.stdout | length == 0 %}Container name did not match any existing containers;{% endif %} + {%- if container_status.stdout | length == 0 %}Container name ({{ container.name }}) did not match any existing containers;{% endif %} {%- if "unhealthy" in container_status.stdout %}Container status is unhealthy;{% endif %} diff --git a/roles/common/tasks/cr_tests.yml b/roles/common/tasks/cr_tests.yml index 03d054238..fbc5e7046 100644 --- a/roles/common/tasks/cr_tests.yml +++ b/roles/common/tasks/cr_tests.yml @@ -1,23 +1,25 @@ --- - name: | - TEST Verify that the {{ item.kind }} {{ item.name }} CR exists + TEST Verify that the {{ cr.kind }} {{ cr.name }} CR exists {{ common_cr_test_id }} ansible.builtin.command: cmd: | - oc get {{ item.kind }} {{ item.name }} + oc get {{ cr.kind }} {{ cr.name }} register: result changed_when: false failed_when: - result.rc != 0 -- name: Verify that a CR is ready {{ common_cr_ready_test_id }} +- name: | + TEST Verify that the {{ cr.kind }} {{ cr.name }} CR is {{ cr.condition_type }} + {{ common_cr_ready_test_id }} ansible.builtin.command: cmd: | - oc get {{ item.kind }} {{ item.name }} -o jsonpath='{.status.conditions[?(@.type=="{{ item.condition_type }}")].status}{"\n"}' + oc get {{ cr.kind }} {{ cr.name }} -o jsonpath='{.status.conditions[?(@.type=="{{ cr.condition_type }}")].status}{"\n"}' register: result changed_when: false failed_when: - result.stdout != "True" when: - common_cr_ready_test_id is defined - - item.condition_type is defined + - cr.condition_type is defined diff --git a/roles/common/tasks/crd_tests.yml b/roles/common/tasks/crd_tests.yml index afbe89306..25165a41e 100644 --- a/roles/common/tasks/crd_tests.yml +++ b/roles/common/tasks/crd_tests.yml @@ -1,16 +1,16 @@ --- -- name: Verify CRD "{{ item }}" +- name: Verify CRD "{{ crd.name }}" ansible.builtin.shell: cmd: | - oc get crd "{{ item }}" + oc get crd "{{ crd.name }}" changed_when: false register: output - name: | - TEST Verify CRD {{ item }} is found - {{ common_crd_test_id }} + TEST Verify CRD {{ crd.name }} is found + {{ crd.test_id if crd.test_id is defined }} ansible.builtin.assert: that: - "'NotFound' not in output.stderr" - success_msg: "CRD {{ item }} is found." - fail_msg: "CRD {{ item }} not found. Error: {{ output.stderr }}" \ No newline at end of file + success_msg: "CRD {{ crd.name }} is found." + fail_msg: "CRD {{ crd.name }} not found. Error: {{ output.stderr }}" diff --git a/roles/common/tasks/endpoint_tests.yml b/roles/common/tasks/endpoint_tests.yml index b04b937ae..b682b7f7d 100644 --- a/roles/common/tasks/endpoint_tests.yml +++ b/roles/common/tasks/endpoint_tests.yml @@ -1,16 +1,16 @@ --- -- name: Verify endpoint "{{ item }}" +- name: Verify endpoint "{{ endpoint }}" ansible.builtin.shell: cmd: | - {{ openstack_cmd }} endpoint list --service {{ item[0] }} --interface {{ item[2] }} + {{ openstack_cmd }} endpoint list --service {{ endpoint[0] }} --interface {{ endpoint[2] }} changed_when: false register: output - name: | - TEST Check that {{ item[0] }} {{ item[2] }} endpoint exists + TEST Check that {{ endpoint[0] }} {{ endpoint[2] }} endpoint exists {{ common_endpoint_test_id }} ansible.builtin.assert: that: - output.stdout != "" - success_msg: "The endpoint {{ item[0] }} is found." - fail_msg: "The endpoint for service {{ item[0] }} on the {{ item[2] }} interface was not found" + success_msg: "The endpoint {{ endpoint[0] }} is found." + fail_msg: "The endpoint for service {{ endpoint[0] }} on the {{ endpoint[2] }} interface was not found" diff --git a/roles/common/tasks/file_tests.yml b/roles/common/tasks/file_tests.yml index c56d86341..b0917c902 100644 --- a/roles/common/tasks/file_tests.yml +++ b/roles/common/tasks/file_tests.yml @@ -1,12 +1,12 @@ --- -- name: Get stats for file - "{{ item }}" +- name: Get stats for file - "{{ file.name }}" ansible.builtin.stat: - path: "{{ item }}" + path: "{{ file.name }}" register: fstats - name: | - TEST Verify the file {{ item }} exists - {{ common_file_test_id }} + TEST Verify the file {{ file.name }} exists + {{ file.test_id }} ansible.builtin.assert: that: - fstats.stat.exists diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 1993bc9d0..cfa28fba6 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -1,74 +1,80 @@ --- - name: "Run pod tests" when: - - common_pod_test_id is defined - common_pod_list is defined - - common_pod_nspace is defined - - common_pod_status_str is defined ansible.builtin.include_tasks: "pod_tests.yml" loop: "{{ common_pod_list }}" + loop_control: + loop_var: pod - name: "Run subscription tests" when: - - common_subscription_nspace is defined - common_subscription_list is defined ansible.builtin.include_tasks: "subscription_tests.yml" loop: "{{ common_subscription_list }}" + loop_control: + loop_var: subscription - name: "Run endpoint tests" when: - common_endpoint_list is defined ansible.builtin.include_tasks: "endpoint_tests.yml" loop: "{{ common_endpoint_list }}" + loop_control: + loop_var: endpoint - name: "Run project tests" when: - - common_project_test_id is defined - common_project_list is defined ansible.builtin.include_tasks: "project_tests.yml" loop: "{{ common_project_list }}" + loop_control: + loop_var: project - name: "Run service tests" when: - - common_service_test_id is defined - - common_service_nspace is defined - common_service_list is defined ansible.builtin.include_tasks: "service_tests.yml" loop: "{{ common_service_list }}" + loop_control: + loop_var: service - name: "Run file tests" when: - - common_file_test_id is defined - common_file_list is defined ansible.builtin.include_tasks: "file_tests.yml" loop: "{{ common_file_list }}" - + loop_control: + loop_var: file + - name: "Run manifest tests" when: - - common_manifest_test_id is defined - common_manifest_list is defined ansible.builtin.include_tasks: "manifest_tests.yml" loop: "{{ common_manifest_list }}" + loop_control: + loop_var: manifest - name: "Run crd tests" when: - - common_crd_test_id is defined - common_crd_list is defined ansible.builtin.include_tasks: "crd_tests.yml" loop: "{{ common_crd_list }}" + loop_control: + loop_var: crd - name: "Run CR tests" when: - - common_cr_test_id is defined - common_cr_list is defined ansible.builtin.include_tasks: "cr_tests.yml" loop: "{{ common_cr_list }}" + loop_control: + loop_var: cr - 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 }}" loop_control: - loop_var: container_name + loop_var: container diff --git a/roles/common/tasks/manifest_tests.yml b/roles/common/tasks/manifest_tests.yml index 48c4ab869..9f3f68c62 100644 --- a/roles/common/tasks/manifest_tests.yml +++ b/roles/common/tasks/manifest_tests.yml @@ -2,20 +2,20 @@ - name: Get number of packages ansible.builtin.shell: cmd: | - echo "{{ item }}" | awk '{print $2;}' + echo "{{ manifest.name }}" | awk '{print $2;}' register: num_expected changed_when: false - name: Get package name ansible.builtin.shell: cmd: | - echo "{{ item }}" | awk '{print $1;}' + echo "{{ manifest.name }}" | awk '{print $1;}' register: pack_name changed_when: false - name: | - TEST Get {{ item }} packagemanifest - {{ common_manifest_test_id }} + TEST Get {{ manifest.name }} packagemanifest + {{ manifest.test_id if manifest.test_id is defined }} ansible.builtin.shell: cmd: | oc get packagemanifests | grep "{{ pack_name.stdout }}" | wc -l diff --git a/roles/common/tasks/pod_tests.yml b/roles/common/tasks/pod_tests.yml index e688c9fcd..2966973a4 100644 --- a/roles/common/tasks/pod_tests.yml +++ b/roles/common/tasks/pod_tests.yml @@ -2,31 +2,31 @@ - block: # expects that one line will be returned # todo: define what happens when there are multiple pods returned - - name: Get Pod Instance name "{{ common_pod_status_str }}" + - name: Get Pod Instance name "{{ pod.status_str }}" ansible.builtin.shell: cmd: | - oc get pods -n "{{ common_pod_nspace }}" | grep "{{ item }}" | grep "{{ common_pod_status_str }}" | awk '{print $1;}' + oc get pods -n "{{ pod.nspace }}" | grep "{{ pod.name }}" | grep "{{ pod.status_str }}" | awk '{print $1;}' register: podinstance failed_when: - podinstance.stdout_lines | length != 1 changed_when: false - name: | - TEST Check {{ item }} pod is {{ common_pod_status_str }} in {{ common_pod_nspace }} namespace - {{ common_pod_test_id }} + TEST Check {{ pod.name }} pod is {{ pod.status_str }} in {{ pod.nspace }} namespace + {{ pod.test_id if pod.test_id is defined }} ansible.builtin.command: cmd: | - oc get pod -n "{{ common_pod_nspace }}" "{{ podinstance.stdout }}" + oc get pod -n "{{ pod.nspace }}" "{{ podinstance.stdout }}" register: output changed_when: false failed_when: - output.rc != 0 - podinstance.stdout == "" rescue: - - name: Get Pod Instance "{{ item }}" + - name: Get Pod Instance "{{ pod.name }}" ansible.builtin.shell: cmd: | - oc get pods -n "{{ common_pod_nspace }}" | grep "{{ item }}" + oc get pods -n "{{ pod.nspace }}" | grep "{{ pod.name }}" register: podinstance failed_when: - podinstance.stdout_lines | length == 0 diff --git a/roles/common/tasks/project_tests.yml b/roles/common/tasks/project_tests.yml index 487961a7b..87244caf6 100644 --- a/roles/common/tasks/project_tests.yml +++ b/roles/common/tasks/project_tests.yml @@ -1,16 +1,16 @@ --- -- name: Get the {{ item }} project +- name: Get the {{ project.name }} project ansible.builtin.shell: cmd: | - oc get project "{{ item }}" + oc get project "{{ project.name }}" changed_when: false register: output - name: | - TEST Verify {{ item }} project exists - {{ common_project_test_id }} + TEST Verify {{ project.name }} project exists + {{ project.test_id if project.test_id is defined }} ansible.builtin.assert: that: - "'NotFound' not in output.stderr" - success_msg: "project {{ item }} is found." - fail_msg: "project {{ item }} not found. Error: {{ output.stderr }}" \ No newline at end of file + success_msg: "project {{ project.name }} is found." + fail_msg: "project {{ project.name }} not found. Error: {{ output.stderr }}" diff --git a/roles/common/tasks/service_tests.yml b/roles/common/tasks/service_tests.yml index 1a1fcf7e3..98ebedbe5 100644 --- a/roles/common/tasks/service_tests.yml +++ b/roles/common/tasks/service_tests.yml @@ -1,16 +1,16 @@ --- -- name: Verify Service - "{{ item }}" +- name: Verify Service - "{{ service.name }}" ansible.builtin.shell: cmd: | - oc get service -n "{{ common_service_nspace }}" "{{ item }}" + oc get service -n "{{ service.nspace }}" "{{ service.name }}" changed_when: false register: output - name: | - TEST Verify {{ item }} service is running in {{ common_service_nspace }} namespace - {{ common_service_test_id }} + TEST Verify {{ service.name }} service is running in {{ service.nspace }} namespace + {{ service.test_id if service.test_id is defined }} ansible.builtin.assert: that: - "'NotFound' not in output.stderr" - success_msg: "service {{ item }} is running." - fail_msg: "service {{ item }} not running. Error: {{ output.stderr }}" \ No newline at end of file + success_msg: "service {{ service.name }} is running." + fail_msg: "service {{ service.name }} not running. Error: {{ output.stderr }}" diff --git a/roles/common/tasks/subscription_tests.yml b/roles/common/tasks/subscription_tests.yml index 4b27530cd..69b1cc12f 100644 --- a/roles/common/tasks/subscription_tests.yml +++ b/roles/common/tasks/subscription_tests.yml @@ -1,16 +1,16 @@ --- -- name: Verify subscription "{{ item }}" +- name: Verify subscription "{{ subscription.name }}" ansible.builtin.shell: cmd: | - oc get subscriptions -n "{{ common_subscription_nspace }}" "{{ item }}" + oc get subscriptions -n "{{ subscription.nspace }}" "{{ subscription.name }}" changed_when: false register: output - name: | - TEST Check that {{ item }} subscription exists in {{ common_subscription_nspace }} namespace - {{ common_subscription_test_id }} + TEST Check that {{ subscription.name }} subscription exists in {{ subscription.nspace }} namespace + {{ subscription.test_id if subscription.test_id is defined }} ansible.builtin.assert: that: - "'NotFound' not in output.stderr" - success_msg: "subscription {{ item }} is found." - fail_msg: "subscription {{ item }} not found. Error: {{ output.stderr }}" \ No newline at end of file + success_msg: "subscription {{ subscription.name }} is found." + fail_msg: "subscription {{ subscription.name }} not found. Error: {{ output.stderr }}" diff --git a/roles/telemetry_logging/tasks/journal_tests.yml b/roles/telemetry_logging/tasks/journal_tests.yml index 4849d0666..fccce261c 100644 --- a/roles/telemetry_logging/tasks/journal_tests.yml +++ b/roles/telemetry_logging/tasks/journal_tests.yml @@ -1,18 +1,17 @@ --- - name: | - TEST Get journals {{ item }} - {{ journal_test_id }} + Get journals {{ journal.name }} become: true ansible.builtin.shell: cmd: | tstamp=$(date -d '30 minute ago' "+%Y-%m-%d %H:%M:%S") - journalctl -t "{{ item }}" --no-pager -S "${tstamp}" + journalctl -t "{{ journal.name }}" --no-pager -S "${tstamp}" register: journalctl changed_when: false - name: | - TEST Get journals {{ item }} - {{ journal_test_id }} + TEST Get journals {{ journal.name }} + {{ journal.test_id id journal.test_id is defined }} ansible.builtin.assert: that: - 'journalctl.stdout_lines | length > 1' diff --git a/roles/telemetry_logging/tasks/main.yml b/roles/telemetry_logging/tasks/main.yml index 38222f686..78264810f 100644 --- a/roles/telemetry_logging/tasks/main.yml +++ b/roles/telemetry_logging/tasks/main.yml @@ -1,5 +1,7 @@ --- - name: "Verify journal entries" - when: journal_list is defined + when: telemetry_logging_journal_list is defined ansible.builtin.include_tasks: "journal_tests.yml" - loop: "{{ journal_list }}" + loop: "{{ telemetry_logging_journal_list }}" + loop_control: + loop_var: journal diff --git a/roles/telemetry_verify_metrics/tasks/verify_ceilometer_central_metrics.yml b/roles/telemetry_verify_metrics/tasks/verify_ceilometer_central_metrics.yml index 83f992879..86192a459 100644 --- a/roles/telemetry_verify_metrics/tasks/verify_ceilometer_central_metrics.yml +++ b/roles/telemetry_verify_metrics/tasks/verify_ceilometer_central_metrics.yml @@ -15,7 +15,9 @@ common_pod_status_str: "Running" common_pod_nspace: openstack common_pod_list: - - ceilometer-0 + - name: ceilometer-0 + status_str: "Running" + nspace: openstack - block: - name: Create an image diff --git a/roles/telemetry_verify_metrics/tasks/verify_ceilometer_compute_metrics.yml b/roles/telemetry_verify_metrics/tasks/verify_ceilometer_compute_metrics.yml index 17a33fa6f..23fee5bc7 100644 --- a/roles/telemetry_verify_metrics/tasks/verify_ceilometer_compute_metrics.yml +++ b/roles/telemetry_verify_metrics/tasks/verify_ceilometer_compute_metrics.yml @@ -26,7 +26,9 @@ common_pod_status_str: "Running" common_pod_nspace: openstack common_pod_list: - - ceilometer-0 + - name: ceilometer-0 + status_str: "Running" + nspace: "openstack" - block: - name: Create an image diff --git a/roles/telemetry_verify_metrics/tasks/verify_ceilometer_ipmi_metrics.yml b/roles/telemetry_verify_metrics/tasks/verify_ceilometer_ipmi_metrics.yml index 2bba5e219..8628a2f3b 100644 --- a/roles/telemetry_verify_metrics/tasks/verify_ceilometer_ipmi_metrics.yml +++ b/roles/telemetry_verify_metrics/tasks/verify_ceilometer_ipmi_metrics.yml @@ -22,11 +22,14 @@ ansible.builtin.include_role: name: common vars: - common_pod_test_id: RHOSO-1242 - common_pod_status_str: "Running" - common_pod_nspace: openstack + # common_pod_test_id: RHOSO-1242 + # common_pod_status_str: "Running" + # common_pod_nspace: openstack common_pod_list: - - ceilometer-0 + - name: "ceilometer-0" + nspace: "openstack" + status_str: "Running" + test_id: "RHOSO-1242" - name: | TEST Use openstack observabilityclient to verify ceilometer ipmi metrics are stored in prometheus diff --git a/roles/telemetry_verify_metrics/tasks/verify_ksm_metrics.yml b/roles/telemetry_verify_metrics/tasks/verify_ksm_metrics.yml index f3dd0475b..892239c77 100644 --- a/roles/telemetry_verify_metrics/tasks/verify_ksm_metrics.yml +++ b/roles/telemetry_verify_metrics/tasks/verify_ksm_metrics.yml @@ -13,7 +13,9 @@ common_pod_status_str: "Running" common_pod_nspace: openstack common_pod_list: - - kube-state-metrics-0 + - name: "kube-state-metrics-0" + nspace: "openstack" + status_str: "Running" - name: | TEST Use openstack observabilityclient to verify to verify health reporting related metrics from kube-state-metrics are stored in Prometheus diff --git a/roles/telemetry_verify_metrics/tasks/verify_mariadb_metrics.yml b/roles/telemetry_verify_metrics/tasks/verify_mariadb_metrics.yml index c2e4345bf..cce7be603 100644 --- a/roles/telemetry_verify_metrics/tasks/verify_mariadb_metrics.yml +++ b/roles/telemetry_verify_metrics/tasks/verify_mariadb_metrics.yml @@ -16,12 +16,12 @@ - name: Create galera pod list ansible.builtin.set_fact: - galera_pod_list: "{{ galera_pod_list | default([]) + [item + '-galera-0'] }}" + galera_pod_list: "{{ galera_pod_list | default([]) + ['name': item + '-galera-0', 'nspace': 'openstack', test_id: 'RHOSO-xxx'] }}" loop: "{{ cr_names.stdout_lines }}" - + - name: List galera pod names ansible.builtin.debug: - msg: "galara pod name ... {{ item }}" + msg: "galara pod name ... {{ item.name }}" loop: "{{ galera_pod_list }}" - name: Verify galera and mysqld-exporter pods are running @@ -31,7 +31,7 @@ common_pod_test_id: RHOSO-xxxx common_pod_status_str: "Running" common_pod_nspace: openstack - common_pod_list: "{{ galera_pod_list + ['mysqld-exporter-0'] }}" + common_pod_list: "{{ galera_pod_list + ['name': 'mysqld-exporter-0', 'nspace': common_pod_nspace, 'test_id': common_pod_test_id, 'status_str': common_pod_status_str ] }}" - name: | TEST Check mariadb metric endpoints diff --git a/roles/telemetry_verify_metrics/tasks/verify_rabbitmq_metrics.yml b/roles/telemetry_verify_metrics/tasks/verify_rabbitmq_metrics.yml index ad16fd07b..fe028b518 100644 --- a/roles/telemetry_verify_metrics/tasks/verify_rabbitmq_metrics.yml +++ b/roles/telemetry_verify_metrics/tasks/verify_rabbitmq_metrics.yml @@ -16,7 +16,7 @@ - name: Create rabbitmq pod list ansible.builtin.set_fact: - common_pod_list: "{{ common_pod_list | default([]) + [item + '-server-0'] }}" + common_pod_list: "{{ common_pod_list | default([]) + [{ 'name': item + '-server-0', 'status_str': 'Running', 'napace': 'openstack', 'test_id': 'RHOSO-1241' ] }}" loop: "{{ cr_names.stdout_lines }}" - name: Verify rabbitmq pods are running