-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into mgirgis-OSPRH-8378
- Loading branch information
Showing
8 changed files
with
250 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- name: Run the compute node tests | ||
ansible.builtin.import_playbook: logging_tests_computes.yml | ||
|
||
- name: Run the controller tests | ||
ansible.builtin.import_playbook: logging_tests_controller.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
--- | ||
- name: "Verify logging projects, endpoints, credentials, nodes, pods, services, manifests and subscriptions" | ||
hosts: controller | ||
gather_facts: no | ||
ignore_errors: true | ||
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 | ||
tasks: | ||
- name: "Run pods completed tests" | ||
ansible.builtin.import_role: | ||
name: common | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
common | ||
====== | ||
|
||
The tests in this role are not specific to any one functional area but are an | ||
aggregate of common tests that can be used in all OSP 18.0/OCP jobs. | ||
|
||
The available tasks tests are: | ||
|
||
* pod tests | ||
|
||
Requirements | ||
------------ | ||
|
||
The requirements vary according to the tests run. | ||
|
||
For the pod tests, access to a kubernetes cluster and the oc command is needed, | ||
this is done by passing the KUBECONFIG env var and PATH into the play. | ||
|
||
The following tools are also needed: | ||
* grep | ||
* awk | ||
|
||
Role Variables | ||
-------------- | ||
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 | ||
- status of pods to check | ||
common_pod_nspace | ||
- list of projects where pods exist | ||
|
||
|
||
Dependencies | ||
------------ | ||
|
||
None | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
The tasks run in this role are dependant on the vars that are configured | ||
As such, the role can be called multiple times within the same play, with the | ||
tests being configured at the task level (e.g. with import_role) or the vars | ||
can be set at the play level. | ||
|
||
- 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 | ||
|
||
|
||
License | ||
------- | ||
|
||
Apache 2 | ||
|
||
Author Information | ||
------------------ | ||
|
||
alexy@redhat.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: "Run pod tests" | ||
when: | ||
- 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 }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
- block: | ||
# expects that one line will be returned | ||
# todo: define what hapens when there are multiple pods returned | ||
- name: Get Pod Instance name "{{ common_pod_status_str }}" | ||
ansible.builtin.shell: | ||
cmd: | | ||
oc get pods -n "{{ common_pod_nspace }}" | grep "{{ item }}" | grep "{{ common_pod_status_str }}" | awk '{print $1;}' | ||
register: podinstance | ||
failed_when: | ||
- podinstance.stdout_lines | length != 1 | ||
changed_when: false | ||
|
||
- name: Check pod {{ common_pod_test_id }} | ||
ansible.builtin.command: | ||
cmd: | | ||
oc get pod -n "{{ common_pod_nspace }}" "{{ podinstance.stdout }}" | ||
register: output | ||
changed_when: false | ||
failed_when: | ||
- output.rc != 0 | ||
- podinstance.stdout == "" | ||
rescue: | ||
- name: Get Pod Instance "{{ item }}" | ||
ansible.builtin.shell: | ||
cmd: | | ||
oc get pods -n "{{ common_pod_nspace }}" | grep "{{ item }}" | ||
register: podinstance | ||
failed_when: | ||
- podinstance.stdout_lines | length == 0 | ||
changed_when: false |