Skip to content

Commit

Permalink
tempest: add support for include & exclude lists (#202)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berendt <berendt@osism.tech>
  • Loading branch information
berendt authored Dec 17, 2024
1 parent 846958b commit 7b2130f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
5 changes: 5 additions & 0 deletions roles/tempest/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
operator_user: dragon
operator_group: "{{ operator_user }}"

configuration_directory: /opt/configuration

docker_registry_tempest: quay.io

tempest_manager: testbed-manager
Expand All @@ -17,6 +19,9 @@ tempest_container_name: "{{ tempest_workspace_name }}"
tempest_include_regex: ""
tempest_exclude_regex: ""

tempest_exclude_list: /opt/configuration/environments/openstack/files/tempest/exclude.lst
tempest_include_list: /opt/configuration/environments/openstack/files/tempest/include.lst

tempest_concurrency: 1

# auth
Expand Down
32 changes: 32 additions & 0 deletions roles/tempest/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,34 @@
that:
- _flavors_resolved.results | map(attribute='flavors') | flatten | map(attribute='id') | list | unique | length == 2

- name: Get stats of exclude list
ansible.builtin.stat:
path: "{{ tempest_exclude_list }}"
register: result_exclude_list

- name: Copy exclude list
ansible.builtin.copy:
src: "{{ tempest_exclude_list }}"
dest: "{{ tempest_workdir }}/exclude.lst"
mode: 0644
owner: "{{ operator_user }}"
group: "{{ operator_group }}"
when: result_exclude_list.stat.exists

- name: Get stats of include list
ansible.builtin.stat:
path: "{{ tempest_include_list }}"
register: result_include_list

- name: Copy include list
ansible.builtin.copy:
src: "{{ tempest_include_list }}"
dest: "{{ tempest_workdir }}/include.lst"
mode: 0644
owner: "{{ operator_user }}"
group: "{{ operator_group }}"
when: result_include_list.stat.exists

- name: Prepare and run tempest
block: # noqa: osism-fqcn
- name: Create tempest flavors
Expand Down Expand Up @@ -253,6 +281,10 @@
(['--regex', tempest_include_regex] if tempest_include_regex is defined and tempest_include_regex | length > 0 else [])
+
(['--exclude-regex', tempest_exclude_regex] if tempest_exclude_regex is defined and tempest_exclude_regex | length > 0 else [])
+
(['--exclude-list', '/opt/tempest/exclude.lst'] if result_include_list.stat.exists else [])
+
(['--include-list', '/opt/tempest/include.lst'] if result_include_list.stat.exists else [])
}}
tags: run-tempest
block: # noqa: osism-fqcn
Expand Down

0 comments on commit 7b2130f

Please sign in to comment.