Skip to content

Commit

Permalink
refstack: run more tests & update versions (#126)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berendt <berendt@osism.tech>
  • Loading branch information
berendt authored Jan 24, 2024
1 parent b83d4c3 commit 6524a59
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 41 deletions.
5 changes: 2 additions & 3 deletions roles/refstack/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
refstack_bootstrap: true
refstack_install: true

# This is the version used in setup_env of refstack-client
refstack_tempest_version: "31.1.0"
refstack_tempest_version: "36.0.0"

refstack_target: compute
refstack_target: platform
refstack_guideline: "2022.11"

refstack_keystone_endpoint: https://api.testbed.osism.xyz:5000/v3
Expand Down
34 changes: 17 additions & 17 deletions roles/refstack/tasks/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Create refstack projects
- name: Create refstack projects for users
openstack.cloud.project:
cloud: "{{ refstack_cloud }}"
state: present
Expand Down Expand Up @@ -27,7 +27,7 @@
project: "{{ refstack_project }}"
loop: "{{ refstack_admin_users }}"

- name: Add member roles to refstack users
- name: Add member role to refstack users
openstack.cloud.role_assignment:
cloud: "{{ refstack_cloud }}"
state: present
Expand Down Expand Up @@ -176,18 +176,18 @@
mode: 0644
delegate_to: "{{ refstack_manager }}"

# - name: Check swift endpoint
# ansible.builtin.command: "openstack --os-cloud {{ refstack_cloud }} endpoint list --service swift"
# register: result
# changed_when: false
# delegate_to: "{{ refstack_manager }}"

# - name: Set swift in tempest.conf
# community.general.ini_file:
# path: "{{ refstack_workdir }}/tempest.conf"
# section: service_available
# option: swift
# value: "true"
# mode: 0644
# delegate_to: "{{ refstack_manager }}"
# when: "'object-store' in result.stdout"
- name: Check swift endpoint
ansible.builtin.command: "openstack --os-cloud {{ refstack_cloud }} endpoint list --service swift"
register: result
changed_when: false
delegate_to: "{{ refstack_manager }}"

- name: Set swift in tempest.conf
community.general.ini_file:
path: "{{ refstack_workdir }}/tempest.conf"
section: service_available
option: swift
value: "true"
mode: 0644
delegate_to: "{{ refstack_manager }}"
when: "'object-store' in result.stdout"
6 changes: 6 additions & 0 deletions roles/refstack/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
---
- name: Include prepare tasks
ansible.builtin.include_tasks: prepare.yml
tags:
- prepare

- name: Include bootstrap tasks
ansible.builtin.include_tasks: bootstrap.yml
run_once: true
when: refstack_bootstrap|bool
tags:
- bootstrap

- name: Include install tasks
ansible.builtin.include_tasks: install.yml
when: refstack_install|bool
tags:
- install

- name: Run refstack
ansible.builtin.debug:
Expand Down
36 changes: 17 additions & 19 deletions roles/refstack/templates/prepare.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ INSTALL_LOG={{ refstack_workdir }}/refstack-install-$(date +%Y-%m-%d-%H-%M).log
GUIDELINE=${1:-{{ refstack_guideline }}}
TARGET=${2:-{{ refstack_target }}}

# NOTE: create RGW user accounts
# for username in refstack-0 refstack-1 refstack-2 refstack-3 refstack-4; do
# openstack --os-cloud $username container list 2>&1 | tee -a $INSTALL_LOG
# done
# create RGW user accounts
for username in refstack-0 refstack-1 refstack-2 refstack-3 refstack-4; do
openstack --os-cloud $username container list 2>&1 | tee -a $INSTALL_LOG
done

# NOTE: enable quota management on RGW user accounts
# for username in $(radosgw-admin user list | grep \\$ | awk -F\" '{ print $2 }'); do
# radosgw-admin quota enable --uid "$username" --quota-scope=user 2>&1 | tee -a $INSTALL_LOG
# done
# enable quota management on RGW user accounts
for username in $(radosgw-admin user list | grep \\$ | awk -F\" '{ print $2 }'); do
radosgw-admin quota enable --uid "$username" --quota-scope=user 2>&1 | tee -a $INSTALL_LOG
done

if [[ ! -e {{ refstack_workdir }}/client ]]; then
git clone https://opendev.org/openinfra/refstack-client {{ refstack_workdir }}/client 2>&1 | tee -a $INSTALL_LOG
Expand All @@ -27,22 +27,20 @@ if [[ ! -e {{ refstack_workdir }}/client/.venv ]]; then
{{ refstack_workdir }}/client//setup_env -t $TEMPEST_VERSION 2>&1 | tee -a $INSTALL_LOG

source /opt/refstack/client/.venv/bin/activate
pip3 install barbican-tempest-plugin==2.0.0 2>&1 | tee -a $INSTALL_LOG
pip3 install designate-tempest-plugin==0.16.0 2>&1 | tee -a $INSTALL_LOG
pip3 install heat-tempest-plugin==1.7.0 2>&1 | tee -a $INSTALL_LOG
pip3 install octavia-tempest-plugin==2.2.0 2>&1 | tee -a $INSTALL_LOG
pip3 install barbican-tempest-plugin==3.0.0 2>&1 | tee -a $INSTALL_LOG
pip3 install designate-tempest-plugin==0.20.0 2>&1 | tee -a $INSTALL_LOG
pip3 install heat-tempest-plugin==2.0.0 2>&1 | tee -a $INSTALL_LOG
pip3 install octavia-tempest-plugin==2.4.1 2>&1 | tee -a $INSTALL_LOG
fi

# platform or compute

# tempest.api.network.test_extensions.ExtensionsTestJSON.test_list_show_extensions
#
# Among other things, this test checks whether the l3_agent_scheduler extension is activated.
# This is not available because we use OVN as SDN. The test is tagged as advisory and
# will be removed accordingly.

curl -s "https://refstack.openstack.org/api/v1/guidelines/$GUIDELINE/tests?target=$TARGET&type=required,advisory&alias=true&flag=true" | \
grep -v tempest.api.network.test_extensions.ExtensionsTestJSON.test_list_show_extensions \
# requires l3_agent_scheduler, not available when working with OVN
grep -v tempest.api.network.test_extensions.ExtensionsTestJSON.test_list_show_extensions | \
grep -v tempest.api.object_storage.test_account_quotas_negative.AccountQuotasNegativeTest.test_user_modify_quota | \
grep -v tempest.api.object_storage.test_object_temp_url.ObjectTempUrlTest.test_put_object_using_temp_url | \
grep -v tempest.api.object_storage.test_object_temp_url.ObjectTempUrlTest.test_get_object_using_temp_url \
> {{ refstack_workdir }}/test-list.txt

# dns
Expand Down
2 changes: 1 addition & 1 deletion roles/refstack/templates/single.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
RUN_LOG=/opt/refstack/refstack-run-$(date +%Y-%m-%d-%H-%M).log

source {{ refstack_workdir }}/client/.venv/bin/activate
{{ refstack_workdir }}/client/refstack-client test -c {{ refstack_workdir }}/tempest.conf -v -r osism -- --regex $1 | tee -a $RUN_LOG
{{ refstack_workdir }}/client/refstack-client test -c {{ refstack_workdir }}/tempest.conf -v -r osism -- --regex $1 | tee -a $RUN_LOG
5 changes: 4 additions & 1 deletion roles/refstack/templates/tempest.conf.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[auth]
test_accounts_file = {{ refstack_workdir }}/accounts.yaml
use_dynamic_credentials = false
use_dynamic_credentials = true
admin_username = {{ refstack_admin }}
admin_project_name = {{ refstack_admin_project }}
admin_password = {{ refstack_admin_password }}

[oslo_concurrency]
lock_path = /tmp/tempest
Expand Down

0 comments on commit 6524a59

Please sign in to comment.