Skip to content

Commit b302395

Browse files
ayefimov-1elfiesmelfie
authored andcommitted
[zuul] Add logging test job
Add a job that runs the telemetry_logging and common roles against the openstack cloud. Separate plays target compute and control nodes
1 parent 11dc0d0 commit b302395

File tree

5 files changed

+368
-2
lines changed

5 files changed

+368
-2
lines changed

.zuul.yaml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/vars-functional-test.yml"
1313
roles:
1414
- zuul: github.com/openstack-k8s-operators/ci-framework
15-
required-projects:
15+
required-projects: &required_projects
1616
- name: github.com/infrawatch/service-telemetry-operator
1717
- name: openstack-k8s-operators/ci-framework
1818
override-checkout: main
@@ -35,6 +35,21 @@
3535
- README*
3636
- .*/*.md
3737

38+
- job:
39+
name: functional-logging-tests-osp18
40+
parent: telemetry-operator-multinode-logging
41+
description: |
42+
Run the logging functional test on osp18+patched version
43+
vars:
44+
cifmw_extras:
45+
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/ci-framework'].src_dir }}/scenarios/centos-9/multinode-ci.yml"
46+
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/vars-logging.yml"
47+
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/vars-logging-test.yml"
48+
roles:
49+
- zuul: github.com/openstack-k8s-operators/ci-framework
50+
required-projects: *required_projects
51+
irrelevant-files: *irrelevant_files
52+
3853
- job:
3954
name: feature-verification-tests-noop
4055
parent: noop
@@ -45,7 +60,6 @@
4560
- ci/noop.yml
4661
files: *irrelevant_files
4762

48-
4963
- project:
5064
name: infrawatch/feature-verification-tests
5165
github-check:
@@ -54,3 +68,4 @@
5468
- openstack-k8s-operators-content-provider:
5569
override-checkout: main
5670
- functional-tests-on-osp18
71+
- functional-logging-tests-osp18

ci/logging_tests_computes.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
- name: Prepare Logging Tests
2+
hosts: computes
3+
gather_facts: false
4+
environment:
5+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
6+
PATH: "{{ cifmw_path }}"
7+
8+
9+
- name: "Verify ctlplane logging containers and files"
10+
hosts: computes
11+
gather_facts: no
12+
vars:
13+
container_test_id: "RHOSO-12753"
14+
container_list:
15+
- ceilometer_agent_compute
16+
- ceilometer_agent_ipmi
17+
- node_exporter
18+
19+
file_test_id: "RHOSO-12754"
20+
file_list:
21+
- /etc/rsyslog.d/10-telemetry.conf
22+
23+
tasks:
24+
- name: "Run file and container tests"
25+
ansible.builtin.import_role:
26+
name: common
27+
28+
29+
- name: "Verify logging journalctl identifiers"
30+
hosts: computes
31+
gather_facts: no
32+
vars:
33+
identifiers_test_id: "RHOSO-12681"
34+
identifiers_list:
35+
- ceilometer_agent_compute
36+
- nova_compute
37+
38+
tasks:
39+
- name: "Verify journalctl logging identifiers"
40+
ansible.builtin.import_role:
41+
name: telemetry_logging

ci/logging_tests_local.yml

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
- name: Prepare Logging Tests
2+
hosts: controller
3+
gather_facts: false
4+
vars:
5+
id_rsa_path: "{{ playbook_dir }}/id_rsa.ctlplane"
6+
environment:
7+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
8+
PATH: "{{ cifmw_path }}"
9+
10+
tasks:
11+
- name: "Log into OCP"
12+
ansible.builtin.shell:
13+
cmd: |
14+
oc login -u kubeadmin -p "12345678" https://api.crc.testing:6443
15+
failed_when: false
16+
changed_when: false
17+
18+
- name: "Create id rsa file for ctlplane access"
19+
ansible.builtin.shell:
20+
cmd: |
21+
oc extract -n openstack secrets/dataplane-ansible-ssh-private-key-secret --to=- | grep -v "ssh\-rsa" > "{{ id_rsa_path }}"
22+
register: rsa_results
23+
failed_when: rsa_results.rc != 0
24+
changed_when: false
25+
26+
- name: "Change files permissions"
27+
ansible.builtin.shell:
28+
cmd: |
29+
chmod 600 "{{ id_rsa_path }}"
30+
changed_when: false
31+
32+
- name: "Verify logging projects, endpoints, credentials, nodes, pods, services, manifests and subscriptions"
33+
hosts: controller
34+
gather_facts: no
35+
vars:
36+
proj_test_id: "RHOSO-12668"
37+
proj_list:
38+
- openshift-openstack-infra
39+
- openshift
40+
- openstack-operators
41+
- openshift-logging
42+
43+
44+
endpoint_test_id: "RHOSO-12682"
45+
endpoint_list:
46+
- [nova,compute,public]
47+
- [nova,compute,internal]
48+
- [placement,placement,public]
49+
- [placement,placement,internal]
50+
- [swift,object-store,public]
51+
- [swift,object-store,internal]
52+
- [cinderv3,volumev3,public]
53+
- [cinderv3,volumev3,internal]
54+
- [barbican,key-manager,public]
55+
- [barbican,key-manager,internal]
56+
- [keystone,identity,public]
57+
- [keystone,identity,internal]
58+
- [glance,image,public]
59+
- [glance,image,internal]
60+
- [neutron,network,public]
61+
- [neutron,network,internal]
62+
63+
64+
cred_test_id: "RHOSO-12670"
65+
cred_list:
66+
- alertingrules.loki.grafana.com
67+
- lokistacks.loki.grafana.com
68+
- recordingrules.loki.grafana.com
69+
- rulerconfigs.loki.grafana.com
70+
71+
72+
node_test_id: "RHOSO-12671"
73+
node_list:
74+
- edpm-compute-0
75+
- edpm-compute-1
76+
- crc
77+
78+
79+
pod_test_id: "RHOS0-12672"
80+
pod_status_str: "Running"
81+
pod_nspace: openstack-operators
82+
pod_list:
83+
- telemetry-operator-controller-manager
84+
- dataplane-operator-controller-manager
85+
86+
87+
service_test_id: "RHOSO-12675"
88+
service_nspace: openshift-logging
89+
service_list:
90+
- cluster-logging-operator-metrics
91+
- logging-loki-compactor-grpc
92+
- logging-loki-compactor-http
93+
- logging-loki-distributor-grpc
94+
- logging-loki-distributor-http
95+
- logging-loki-gateway-http
96+
- logging-loki-gossip-ring
97+
- logging-loki-index-gateway-grpc
98+
- logging-loki-index-gateway-http
99+
- logging-loki-ingester-grpc
100+
- logging-loki-ingester-http
101+
- logging-loki-querier-grpc
102+
- logging-loki-querier-http
103+
- logging-loki-query-frontend-grpc
104+
- logging-loki-query-frontend-http
105+
- logging-view-plugin
106+
- openstack-logging
107+
108+
109+
manifest_test_id: "RHOSO-12677"
110+
manifest_list:
111+
- "loki-operator 2"
112+
- "loki-helm-operator 1"
113+
114+
115+
subscription_test_id: "RHOSO-12678"
116+
subscription_nspace: openshift-operators-redhat
117+
subscription_list:
118+
- loki-operator
119+
120+
tasks:
121+
- name: "Run logging project, endpoint, credential, node, pod, service, manifest and subscription tests"
122+
ansible.builtin.import_role:
123+
name: common
124+
125+
126+
127+
- name: "Verify logging pods are running in openstack"
128+
hosts: controller
129+
gather_facts: no
130+
vars:
131+
pod_test_id: "RHOSO-12752"
132+
pod_status_str: "Running"
133+
pod_nspace: openstack
134+
pod_list:
135+
- openstackclient
136+
137+
tasks:
138+
- name: "Verify Running Pods"
139+
ansible.builtin.import_role:
140+
name: common
141+
142+
143+
- name: "Verify logging pods are running in openshift-operators-redhat"
144+
hosts: controller
145+
gather_facts: no
146+
vars:
147+
pod_test_id: "RHOSO-12673"
148+
pod_status_str: "Running"
149+
pod_nspace: openshift-operators-redhat
150+
pod_list:
151+
- loki-operator-controller-manager
152+
153+
tasks:
154+
- name: "Verify Pods running"
155+
ansible.builtin.import_role:
156+
name: common
157+
158+
159+
- name: "Verify logging pods are running in openshift-logging"
160+
hosts: controller
161+
gather_facts: no
162+
vars:
163+
pod_test_id: "RHOSO-12676"
164+
pod_status_str: "Running"
165+
pod_nspace: openshift-logging
166+
pod_list:
167+
- cluster-logging-operator
168+
- collector
169+
- logging-loki-compactor
170+
- logging-loki-distributor
171+
- logging-loki-gateway
172+
- logging-loki-index-gateway
173+
- logging-loki-ingester
174+
- logging-loki-querier
175+
- logging-loki-query-frontend
176+
- logging-view-plugin
177+
178+
### see JIRA LOG-5431 if pods not running
179+
tasks:
180+
- name: "Verify Pods running"
181+
ansible.builtin.import_role:
182+
name: common
183+
184+
185+
- name: "Verify logging pods are running in minio-dev"
186+
hosts: controller
187+
gather_facts: no
188+
vars:
189+
pod_test_id: "RHOSO-12674"
190+
pod_status_str: "Running"
191+
pod_nspace: minio-dev
192+
pod_list:
193+
- minio
194+
195+
tasks:
196+
- name: "Run pod running tests"
197+
ansible.builtin.import_role:
198+
name: common
199+
200+
201+
- name: "Verify logging pods have complete status in openstack"
202+
hosts: controller
203+
gather_facts: no
204+
vars:
205+
pod_test_id: "RHOSO-12679"
206+
pod_nspace: openstack
207+
pod_status_str: "Completed"
208+
pod_list:
209+
- bootstrap-edpm-deployment-logging
210+
- configure-network-edpm-deployment-logging
211+
- configure-os-edpm-deployment-logging
212+
- download-cache-edpm-deployment-logging
213+
- install-certs-edpm-deployment-logging
214+
- install-os-edpm-deployment-logging
215+
- libvirt-edpm-deployment-logging
216+
- logging-edpm-deployment-logging-openstack-edpm
217+
- neutron-metadata-edpm-deployment-logging
218+
- nova-custom-edpm-deployment
219+
- ovn-edpm-deployment-logging
220+
- reboot-os-edpm-deployment-logging
221+
- repo-setup-edpm-deployment-logging
222+
- run-os-edpm-deployment-logging
223+
- ssh-known-hosts-edpm-deployment-logging
224+
- telemetry-edpm-deployment-logging
225+
- validate-network-edpm-deployment-logging
226+
227+
tasks:
228+
- name: "Run pods completed tests"
229+
ansible.builtin.import_role:
230+
name: common
231+
232+
233+
- name: "Verify logging services are running in openstack"
234+
hosts: controller
235+
gather_facts: no
236+
vars:
237+
service_test_id: "RHOSO-12749"
238+
service_nspace: openstack
239+
service_list:
240+
- nova-internal
241+
- nova-metadata-internal
242+
- nova-novncproxy-cell1-public
243+
- nova-public
244+
245+
tasks:
246+
- name: "Run Services tests"
247+
ansible.builtin.import_role:
248+
name: common

ci/run_playbooks_logging.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
- name: "Run logging functional test playbooks"
3+
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
4+
gather_facts: true
5+
environment:
6+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
7+
PATH: "{{ cifmw_path }}"
8+
vars_files:
9+
- vars/common.yml
10+
tasks:
11+
- name: "Create log dir"
12+
ansible.builtin.file:
13+
path: "{{ logs_dir }}"
14+
state: directory
15+
mode: "0755"
16+
17+
- name: "Set dynamic KUBECONFIG and PATH vars"
18+
copy:
19+
content: |
20+
cifmw_openshift_kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
21+
cifmw_path: "{{ cifmw_path }}"
22+
vars_dir: "{{ fvt_dir }}/ci/vars"
23+
dest: "{{ env_vars_file }}"
24+
25+
- name: Include vars from the extra_vars files
26+
ansible.builtin.include_vars:
27+
dir: "{{ cifmw_basedir }}/artifacts/parameters"
28+
29+
- name: Run telemetry-logging tests on OSP18
30+
block:
31+
- name: "Run local logging tests"
32+
ansible.builtin.shell:
33+
cmd: |
34+
ANSIBLE_CONFIG=ci/ansible.cfg ansible-playbook -v -e @"{{ env_vars_file }}" ci/logging_tests_computes.yml
35+
chdir: "{{ fvt_dir }}"
36+
register: output
37+
38+
- name: Save ansible output to a file
39+
ansible.builtin.copy:
40+
content: "{{ output.stdout }}"
41+
dest: "{{ logs_dir }}/ansible_run.log"
42+
43+
- name: "Run cltplane logging tests"
44+
ansible.builtin.shell:
45+
cmd: |
46+
ANSIBLE_CONFIG=ci/ansible.cfg ansible-playbook -v -e @"{{ env_vars_file }}" ci/logging_tests_local.yml
47+
chdir: "{{ fvt_dir }}"
48+
register: output2
49+
50+
- name: Save ansible output to a file
51+
ansible.builtin.lineinfile:
52+
line: "{{ output2.stdout }}"
53+
path: "{{ logs_dir }}/ansible_run.log"
54+
55+
- name: Include report result
56+
ansible.builtin.include_tasks:
57+
file: report_result.yml

ci/vars-logging-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
# temp: skip os-net-setup
3+
post_deploy_run_logging_functional_test:
4+
source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/infrawatch/feature-verification-tests'].src_dir }}/ci/run_playbooks_logging.yml"
5+
type: playbook

0 commit comments

Comments
 (0)