Skip to content

Commit 2becb76

Browse files
Run LB OTE tests serially with provider-specific allowlists
Pipe-all run-test parallelizes [lb][Serial] cases and causes Octavia timeouts. lb_tests now uses Amphora/OVN allowlists and openstack_test_ote_run_serial. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent cf394be commit 2becb76

6 files changed

Lines changed: 48 additions & 6 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
22
# defaults file for lb_tests
33
lb_allowlist_file: 'files/openstack-test-lb-allowlist.yaml'
4+
lb_amphora_allowlist_file: "{{ role_path }}/files/openstack-test-lb-amphora-allowlist.yaml"
5+
lb_ovn_allowlist_file: "{{ role_path }}/files/openstack-test-lb-ovn-allowlist.yaml"
46
lb_blocklist_file: "{{ role_path }}/files/openstack-test-lb-ingress-blocklist.yaml"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
".*Amphora.*":
3+
note: "Amphora Load Balancer tests (lb_tests stage only)"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
".*OVN.*":
3+
note: "OVN Load Balancer tests (lb_tests stage only)"

‎collection/stages/roles/lb_tests/tasks/main.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
---
22
# include_role(openstack_test) re-templates vars; role_path there is openstack_test, not lb_tests.
3-
- name: Materialize ingress blocklist path for nested openstack_test role
3+
- name: Materialize LB allow/block paths for nested openstack_test role
44
ansible.builtin.set_fact:
55
lb_ingress_blocklist_resolved: "{{ lb_blocklist_file }}"
6+
lb_amphora_allowlist_resolved: "{{ lb_amphora_allowlist_file }}"
7+
lb_ovn_allowlist_resolved: "{{ lb_ovn_allowlist_file }}"
68

79
- name: Get install-config content to obtain the 1st machineCIDR
810
ansible.builtin.include_role:
@@ -34,8 +36,9 @@
3436
name: shiftstack.stages.openstack_test
3537
vars:
3638
openstack_test_results_dir: "{{ artifacts_dir }}/lb_amphora_sourceip"
37-
openstack_tests_allowlist_file: "{{ lb_allowlist_file }}"
39+
openstack_tests_allowlist_file: "{{ lb_amphora_allowlist_resolved }}"
3840
openstack_tests_blocklist_file: "{{ lb_ingress_blocklist_resolved }}"
41+
openstack_test_ote_run_serial: true
3942
openstack_testsuite_name: openstack_tests_lb_amphora_sourceip
4043
openstack_reset_result_dir: no # As we want to keep the logs generated in the previous step
4144

@@ -53,7 +56,8 @@
5356
name: shiftstack.stages.openstack_test
5457
vars:
5558
openstack_test_results_dir: "{{ artifacts_dir }}/lb_ovn"
56-
openstack_tests_allowlist_file: "{{ lb_allowlist_file }}"
59+
openstack_tests_allowlist_file: "{{ lb_ovn_allowlist_resolved }}"
5760
openstack_tests_blocklist_file: "{{ lb_ingress_blocklist_resolved }}"
61+
openstack_test_ote_run_serial: true
5862
openstack_testsuite_name: openstack_tests_lb_ovn
5963
openstack_reset_result_dir: no # As we want to keep the logs generated in the previous step

‎collection/stages/roles/openstack_test/defaults/main.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ openstack_tests_go_version: "{{ tests.default_go_version_target }}"
1212
# OTE (OpenShift Tests Extension) — used when discovered_openshift_release >= 4.20
1313
openstack_test_suite: openstack-test/all
1414
openstack_test_ote_binary_relpath: bin/openstack-test-tests-ext
15+
# Run filtered OTE tests one-by-one (required for [lb][Serial] under Octavia limits).
16+
openstack_test_ote_run_serial: false

‎collection/stages/roles/openstack_test/tasks/run_openstack_test.yml‎

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,36 @@
169169
- "{{ openstack_test_junit_path }}"
170170
changed_when: true
171171

172-
# OTE run-test has no --junit-path; pipe filtered names via stdin and
173-
# synthesize junit from resolved log outcomes for post_openshift_tests.
174-
- name: Run OTE filtered tests via run-test and write junit
172+
# OTE run-test has no --junit-path; synthesize junit via ote_resolve_results.py.
173+
# lb_tests: run serially — piping the list runs many LBs in parallel and hits
174+
# Octavia/max-shared-lb timeouts despite [lb][Serial] in test names.
175+
- name: Run OTE filtered tests serially via run-test and write junit
176+
ansible.builtin.shell: |
177+
set -o pipefail
178+
: > {{ openstack_test_log_path }}
179+
run_exit=0
180+
while IFS= read -r test || [[ -n "$test" ]]; do
181+
[[ -z "${test// }" ]] && continue
182+
if ! {{ openstack_test_executable }} run-test --output=json "$test" \
183+
>> {{ openstack_test_log_path }} 2>&1; then
184+
run_exit=1
185+
fi
186+
done < {{ tests_to_run_path }}
187+
python3 "{{ openstack_test_ote_resolve_script }}" junit \
188+
"{{ openstack_test_log_path }}" "{{ openstack_test_junit_path }}" || py_exit=$?
189+
exit ${run_exit:-${py_exit:-0}}
190+
environment:
191+
OS_CLOUD: "{{ user_cloud }}"
192+
KUBECONFIG: "{{ kubeconfig }}"
193+
RHOSO_KUBECONFIG: "{{ rhoso_kubeconfig }}"
194+
SHIFTSTACK_PASS_FILE: "{{ kubeadmin_password }}"
195+
changed_when: true
196+
when:
197+
- openstack_test_use_ote | bool
198+
- openstack_test_filtering | bool
199+
- openstack_test_ote_run_serial | bool
200+
201+
- name: Run OTE filtered tests via run-test (stdin batch) and write junit
175202
ansible.builtin.shell: |
176203
set -o pipefail
177204
cat {{ tests_to_run_path }} | {{ openstack_test_executable }} run-test \
@@ -188,6 +215,7 @@
188215
when:
189216
- openstack_test_use_ote | bool
190217
- openstack_test_filtering | bool
218+
- not (openstack_test_ote_run_serial | bool)
191219

192220
- name: Run legacy openstack tests
193221
ansible.builtin.shell: >

0 commit comments

Comments
 (0)