Skip to content

Commit f9fd982

Browse files
committed
Use dicts to configure the tests
Add some polarion IDs
1 parent 63b9eb3 commit f9fd982

15 files changed

+135
-125
lines changed

ci/logging_tests_computes.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
88
PATH: "{{ cifmw_path }}"
99
vars:
10-
journal_test_id: "RHOSO-12681"
11-
journal_list:
12-
- ceilometer_agent_compute
13-
- nova_compute
10+
#telemetry_logging_journal_test_id: "RHOSO-12681"
11+
telemetry_logging_journal_list:
12+
- { name: ceilometer_agent_compute, test_id: "RHOSO-12681" }
13+
- { name: nova_compute, test_id: "RHOSO-12681" }
1414
tasks:
1515
- name: "Run Telemetry Logging tests"
1616
ansible.builtin.include_role:

ci/logging_tests_controller.yml

Lines changed: 52 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,44 @@
88
PATH: "{{ cifmw_path }}"
99
vars:
1010
common_pod_test_id: "RHOS0-12672"
11-
common_pod_status_str: "Running"
12-
common_pod_nspace: openstack-operators
11+
# common_pod_status_str: "Running"
12+
# common_pod_nspace: openstack-operators
1313
common_pod_list:
14-
- telemetry-operator-controller-manager
15-
- openstack-operator-controller-manager
14+
- { name: telemetry-operator-controller-manager, nspace: openstack-operators, status_str: "Running", test_id: "{{ common_pod_test_id }}" }
15+
- { name: openstack-operator-controller-manager, nspace: openstack-operators, status_str: "Running", test_id: "{{ common_pod_test_id }}" }
1616
common_subscription_test_id: "RHOSO-12678"
17-
common_subscription_nspace: openshift-operators-redhat
17+
# common_subscription_nspace: openshift-operators-redhat
1818
common_subscription_list:
19-
- loki-operator
19+
- { name: loki-operator, nspace: openshift-operators-redhat, test_id: "{{ common_subscription_test_id }}"}
2020
common_project_test_id: "RHOSO-12668"
2121
common_project_list:
22-
- openshift-openstack-infra
23-
- openshift
24-
- openstack-operators
25-
- openshift-logging
22+
- { name: openshift-openstack-infra, test_id: "{{ common_project_test_id }}" }
23+
- { name: openshift, test_id: "{{ common_project_test_id }}"}
24+
- { name: openstack-operators, test_id: "{{ common_project_test_id }}" }
25+
- { name: openshift-logging, test_id: "{{ common_project_test_id }}"}
2626
common_service_test_id: "RHOSO-12675"
27-
common_service_nspace: openshift-logging
27+
# common_service_nspace: openshift-logging
2828
common_service_list:
29-
- cluster-logging-operator-metrics
30-
- logging-loki-compactor-grpc
31-
- logging-loki-compactor-http
32-
- logging-loki-distributor-grpc
33-
- logging-loki-distributor-http
34-
- logging-loki-gateway-http
35-
- logging-loki-gossip-ring
36-
- logging-loki-index-gateway-grpc
37-
- logging-loki-index-gateway-http
38-
- logging-loki-ingester-grpc
39-
- logging-loki-ingester-http
40-
- logging-loki-querier-grpc
41-
- logging-loki-querier-http
42-
- logging-loki-query-frontend-grpc
43-
- logging-loki-query-frontend-http
44-
- openstack-logging
29+
- { name: cluster-logging-operator-metrics, nspace: openshift-logging,test_id: "RHOSO-13744"}
30+
- { name: logging-loki-compactor-grpc, nspace: openshift-logging, test_id: "RHOSO-13746"}
31+
- { name: logging-loki-compactor-http, nspace: openshift-logging, test_id: "RHOSO-13747"}
32+
- { name: logging-loki-distributor-grpc, nspace: openshift-logging, test_id: "RHOSO-13748"}
33+
- { name: logging-loki-distributor-http, nspace: openshift-logging, test_id: "RHOSO-13749"}
34+
- { name: logging-loki-gateway-http, nspace: openshift-logging, test_id: "RHOSO-13750"}
35+
- { name: logging-loki-gossip-ring, nspace: openshift-logging, test_id: "RHOSO-13751"}
36+
- { name: logging-loki-index-gateway-grpc, nspace: openshift-logging, test_id: "RHOSO-13752"}
37+
- { name: logging-loki-index-gateway-http, nspace: openshift-logging, test_id: "RHOSO-13753"}
38+
- { name: logging-loki-ingester-grpc, nspace: openshift-logging, test_id: "RHOSO-13754"}
39+
- { name: logging-loki-ingester-http, nspace: openshift-logging, test_id: "RHOSO-13755"}
40+
- { name: logging-loki-querier-grpc, nspace: openshift-logging, test_id: "RHOSO-13756"}
41+
- { name: logging-loki-querier-http, nspace: openshift-logging, test_id: "RHOSO-13757"}
42+
- { name: logging-loki-query-frontend-grpc, nspace: openshift-logging, test_id: "RHOSO-13758"}
43+
- { name: logging-loki-query-frontend-http, nspace: openshift-logging, test_id: "RHOSO-13759"}
44+
- { name: openstack-logging, nspace: openshift-logging, test_id: "RHOSO-13760"}
45+
4546
common_file_test_id: "RHOSO-12754"
4647
common_file_list:
47-
- /etc/rsyslog.d/10-telemetry.conf
48+
- { name: "/etc/rsyslog.d/10-telemetry.conf", test_id: "{{ common_file_test_id }}"}
4849
tasks:
4950
- name: "Verify logging infrastructure components"
5051
ansible.builtin.include_role:
@@ -59,10 +60,10 @@
5960
PATH: "{{ cifmw_path }}"
6061
vars:
6162
common_pod_test_id: "RHOSO-12752"
62-
common_pod_status_str: "Running"
63-
common_pod_nspace: openstack
63+
# common_pod_status_str: "Running"
64+
# common_pod_nspace: openstack
6465
common_pod_list:
65-
- openstackclient
66+
- { name: openstackclient, status_str: "Running", nspace: "openstack", test_id: "{{ common_pod_test_id }}"}
6667
tasks:
6768
- name: "Verify Running Pods"
6869
ansible.builtin.include_role:
@@ -78,10 +79,10 @@
7879
PATH: "{{ cifmw_path }}"
7980
vars:
8081
common_pod_test_id: "RHOSO-12673"
81-
common_pod_status_str: "Running"
82-
common_pod_nspace: openshift-operators-redhat
82+
#common_pod_status_str: "Running"
83+
#common_pod_nspace: openshift-operators-redhat
8384
common_pod_list:
84-
- loki-operator-controller-manager
85+
- { name: loki-operator-controller-manager, nspace: openshift-operators-redhat, status_str: "Running", test_id: "{{ common_pod_test_id }}"}
8586
tasks:
8687
- name: "Verify Pods running"
8788
ansible.builtin.include_role:
@@ -95,19 +96,20 @@
9596
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
9697
PATH: "{{ cifmw_path }}"
9798
vars:
98-
common_pod_test_id: "RHOSO-12676"
99-
common_pod_status_str: "Running"
100-
common_pod_nspace: openshift-logging
99+
# common_pod_test_id: "RHOSO-12676"
100+
# common_pod_status_str: "Running"
101+
# common_pod_nspace: openshift-logging
101102
common_pod_list:
102-
- cluster-logging-operator
103+
- cluster-logging-operator
103104
- logging-loki-compactor
104105
- logging-loki-distributor
105106
#- logging-loki-gateway
106107
- logging-loki-index-gateway
107108
- logging-loki-ingester
108109
- logging-loki-querier
109110
- logging-loki-query-frontend
110-
- collector
111+
- { name: collector, nspace: openshift-logging, status_str: "Running", test_id: "RHOSO-13745"}
112+
111113

112114
### see JIRA LOG-5431 if pods not running
113115
tasks:
@@ -124,10 +126,10 @@
124126
PATH: "{{ cifmw_path }}"
125127
vars:
126128
common_pod_test_id: "RHOSO-12674"
127-
common_pod_status_str: "Running"
128-
common_pod_nspace: minio-dev
129+
# common_pod_status_str: "Running"
130+
# common_pod_nspace: minio-dev
129131
common_pod_list:
130-
- minio
132+
- { name: minio, nspace: minio-dev, status_str: "Running", test_id: "{{ common_pod_test_id }}" }
131133
tasks:
132134
- name: "Run pod running tests"
133135
ansible.builtin.include_role:
@@ -143,10 +145,10 @@
143145
PATH: "{{ cifmw_path }}"
144146
vars:
145147
common_pod_test_id: "RHOSO-12679"
146-
common_pod_nspace: openstack
147-
common_pod_status_str: "Completed"
148+
#common_pod_nspace: openstack
149+
#common_pod_status_str: "Completed"
148150
common_pod_list:
149-
- logging-edpm-deployment-openstack-edpm-ipam
151+
- { name: logging-edpm-deployment-openstack-edpm-ipam, nspace: openstack, status_str: "Completed", test_id: "{{ common_pod_test_id }}"}
150152
tasks:
151153
- name: "Run pods completed tests"
152154
ansible.builtin.include_role:
@@ -160,12 +162,12 @@
160162
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
161163
PATH: "{{ cifmw_path }}"
162164
vars:
163-
common_crd_test_id: "RHOSO-12670"
165+
#common_crd_test_id: "RHOSO-12670"
164166
common_crd_list:
165-
- alertingrules.loki.grafana.com
166-
- lokistacks.loki.grafana.com
167-
- recordingrules.loki.grafana.com
168-
- rulerconfigs.loki.grafana.com
167+
- { name: alertingrules.loki.grafana.com, test_id: "RHOSO-12670"}
168+
- { name: lokistacks.loki.grafana.com, test_id: "RHOSO-12670"}
169+
- { name: recordingrules.loki.grafana.com, test_id: "RHOSO-12670"}
170+
- { name: rulerconfigs.loki.grafana.com, test_id: "RHOSO-12670"}
169171
tasks:
170172
- name: "Run the crds tests"
171173
ansible.builtin.include_role:

roles/common/tasks/container_test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
- name: Get container status
33
ansible.builtin.shell:
44
cmd: |
5-
podman ps -a --format "{{ '{{.Names}} {{.Status}}' }}" | grep {{ container_name }}
5+
podman ps -a --format "{{ '{{.Names}} {{.Status}}' }}" | grep {{ container.name }}
66
changed_when: false
77
register: container_status
88

99
- name: |
10-
Verify {{ container_name }} container status
11-
{{ common_container_test_id }}
10+
Verify {{ container.name }} container status
11+
{{ container.test_id if container.test_id is defined }}
1212
ansible.builtin.assert:
1313
that:
1414
- "'unhealthy' not in container_status.stdout"
15-
success_msg: "Container '{{ container_name }}' is in 'healthy' status."
16-
fail_msg: "Container '{{ container_name }}' is not in 'healthy' status. Current status: {{ container_status.stdout }}"
15+
success_msg: "Container '{{ container.name }}' is in 'healthy' status."
16+
fail_msg: "Container '{{ container.name }}' is not in 'healthy' status. Current status: {{ container_status.stdout }}"

roles/common/tasks/cr_tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
---
22
- name: |
3-
TEST Verify that the {{ item.kind }} {{ item.name }} CR exists
3+
TEST Verify that the {{ cr.kind }} {{ cr.name }} CR exists
44
{{ common_cr_test_id }}
55
ansible.builtin.command:
66
cmd: |
7-
oc get {{ item.kind }} {{ item.name }}
7+
oc get {{ cr.kind }} {{ cr.name }}
88
register: result
99
changed_when: false
1010
failed_when:
1111
- result.rc != 0
1212

1313
- name: |
14-
TEST Verify that the {{ item.kind }} {{ item.name }} CR is {{ item.condition_type }}
14+
TEST Verify that the {{ cr.kind }} {{ cr.name }} CR is {{ cr.condition_type }}
1515
{{ common_cr_ready_test_id }}
1616
ansible.builtin.command:
1717
cmd: |
18-
oc get {{ item.kind }} {{ item.name }} -o jsonpath='{.status.conditions[?(@.type=="{{ item.condition_type }}")].status}{"\n"}'
18+
oc get {{ cr.kind }} {{ cr.name }} -o jsonpath='{.status.conditions[?(@.type=="{{ cr.condition_type }}")].status}{"\n"}'
1919
register: result
2020
changed_when: false
2121
failed_when:
2222
- result.stdout != "True"
2323
when:
2424
- common_cr_ready_test_id is defined
25-
- item.condition_type is defined
25+
- cr.condition_type is defined

roles/common/tasks/crd_tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
2-
- name: Verify CRD "{{ item }}"
2+
- name: Verify CRD "{{ crd.name }}"
33
ansible.builtin.shell:
44
cmd: |
5-
oc get crd "{{ item }}"
5+
oc get crd "{{ crd.name }}"
66
changed_when: false
77
register: output
88

99
- name: |
10-
TEST Verify CRD {{ item }} is found
11-
{{ common_crd_test_id }}
10+
TEST Verify CRD {{ crd.name }} is found
11+
{{ crd.test_id if crd.test_id is defined }}
1212
ansible.builtin.assert:
1313
that:
1414
- "'NotFound' not in output.stderr"
15-
success_msg: "CRD {{ item }} is found."
16-
fail_msg: "CRD {{ item }} not found. Error: {{ output.stderr }}"
15+
success_msg: "CRD {{ crd.name }} is found."
16+
fail_msg: "CRD {{ crd.name }} not found. Error: {{ output.stderr }}"
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
2-
- name: Verify endpoint "{{ item }}"
2+
- name: Verify endpoint "{{ endpoint }}"
33
ansible.builtin.shell:
44
cmd: |
5-
{{ openstack_cmd }} endpoint list --service {{ item[0] }} --interface {{ item[2] }}
5+
{{ openstack_cmd }} endpoint list --service {{ endpoint[0] }} --interface {{ endpoint[2] }}
66
changed_when: false
77
register: output
88

99
- name: |
10-
TEST Check that {{ item[0] }} endpoint exists
10+
TEST Check that {{ endpoint[0] }} endpoint exists
1111
{{ common_endpoint_test_id }}
1212
ansible.builtin.assert:
1313
that:
1414
- output.stdout != ""
15-
success_msg: "The endpoint {{ item[0] }} is found."
16-
fail_msg: "The endpoint for service {{ item[0] }} "
15+
success_msg: "The endpoint {{ endpoint[0] }} is found."
16+
fail_msg: "The endpoint for service {{ endpoint[0] }} "

roles/common/tasks/file_tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
- name: Get stats for file - "{{ item }}"
2+
- name: Get stats for file - "{{ file.name }}"
33
ansible.builtin.stat:
4-
path: "{{ item }}"
4+
path: "{{ ifile.name }}"
55
register: fstats
66
failed_when:
77
- fstats.stat.pw_name != "root"
88
- fstats.stat.size | int < 300
99
- not fstats.stat.exists
10-
- not fstats.stat.isreg
10+
- not fstats.stat.isreg

roles/common/tasks/main.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,80 @@
11
---
22
- name: "Verify pod - {{ common_pod_test_id }}"
33
when:
4-
- common_pod_test_id is defined
54
- common_pod_list is defined
6-
- common_pod_nspace is defined
7-
- common_pod_status_str is defined
85
ansible.builtin.include_tasks: "pod_tests.yml"
96
loop: "{{ common_pod_list }}"
7+
loop_control:
8+
loop_var: pod
109

1110
- name: "Run subscription tests"
1211
when:
13-
- common_subscription_nspace is defined
1412
- common_subscription_list is defined
1513
ansible.builtin.include_tasks: "subscription_tests.yml"
1614
loop: "{{ common_subscription_list }}"
15+
loop_control:
16+
loop_var: subscription
1717

1818
- name: "Run endpoint tests"
1919
when:
2020
- common_endpoint_list is defined
2121
ansible.builtin.include_tasks: "endpoint_tests.yml"
2222
loop: "{{ common_endpoint_list }}"
23+
loop_control:
24+
loop_var: endpoint
2325

2426
- name: "Run project tests"
2527
when:
26-
- common_project_test_id is defined
2728
- common_project_list is defined
2829
ansible.builtin.include_tasks: "project_tests.yml"
2930
loop: "{{ common_project_list }}"
31+
loop_control:
32+
loop_var: project
3033

3134
- name: "Run service tests"
3235
when:
33-
- common_service_test_id is defined
34-
- common_service_nspace is defined
3536
- common_service_list is defined
3637
ansible.builtin.include_tasks: "service_tests.yml"
3738
loop: "{{ common_service_list }}"
39+
loop_control:
40+
loop_var: service
3841

3942
- name: "Run file tests"
4043
when:
41-
- common_file_test_id is defined
4244
- common_file_list is defined
4345
ansible.builtin.include_tasks: "file_tests.yml"
4446
loop: "{{ common_file_list }}"
45-
47+
loop_control:
48+
loop_var: file
49+
4650
- name: "Run manifest tests"
4751
when:
48-
- common_manifest_test_id is defined
4952
- common_manifest_list is defined
5053
ansible.builtin.include_tasks: "manifest_tests.yml"
5154
loop: "{{ common_manifest_list }}"
55+
loop_control:
56+
loop_var: manifest
5257

5358
- name: "Run crd tests"
5459
when:
55-
- common_crd_test_id is defined
5660
- common_crd_list is defined
5761
ansible.builtin.include_tasks: "crd_tests.yml"
5862
loop: "{{ common_crd_list }}"
63+
loop_control:
64+
loop_var: crd
5965

6066
- name: "Run CR tests"
6167
when:
62-
- common_cr_test_id is defined
6368
- common_cr_list is defined
6469
ansible.builtin.include_tasks: "cr_tests.yml"
6570
loop: "{{ common_cr_list }}"
71+
loop_control:
72+
loop_var: cr
6673

6774
- name: "Verify container tests"
6875
when:
69-
- common_container_list is defined
7076
- common_container_test_id is defined
7177
ansible.builtin.include_tasks: "container_test.yml"
7278
loop: "{{ common_container_list }}"
7379
loop_control:
74-
loop_var: container_name
80+
loop_var: container

0 commit comments

Comments
 (0)