From 6524a59da504e74dac5900645918dbcc095c225a Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Wed, 24 Jan 2024 22:46:38 +0100 Subject: [PATCH] refstack: run more tests & update versions (#126) Signed-off-by: Christian Berendt --- roles/refstack/defaults/main.yml | 5 ++-- roles/refstack/tasks/bootstrap.yml | 34 +++++++++++----------- roles/refstack/tasks/main.yml | 6 ++++ roles/refstack/templates/prepare.sh.j2 | 36 +++++++++++------------- roles/refstack/templates/single.sh.j2 | 2 +- roles/refstack/templates/tempest.conf.j2 | 5 +++- 6 files changed, 47 insertions(+), 41 deletions(-) diff --git a/roles/refstack/defaults/main.yml b/roles/refstack/defaults/main.yml index 941d242..82974d8 100644 --- a/roles/refstack/defaults/main.yml +++ b/roles/refstack/defaults/main.yml @@ -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 diff --git a/roles/refstack/tasks/bootstrap.yml b/roles/refstack/tasks/bootstrap.yml index f819121..213f7d7 100644 --- a/roles/refstack/tasks/bootstrap.yml +++ b/roles/refstack/tasks/bootstrap.yml @@ -1,5 +1,5 @@ --- -- name: Create refstack projects +- name: Create refstack projects for users openstack.cloud.project: cloud: "{{ refstack_cloud }}" state: present @@ -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 @@ -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" diff --git a/roles/refstack/tasks/main.yml b/roles/refstack/tasks/main.yml index 52c34ee..fd37dd5 100644 --- a/roles/refstack/tasks/main.yml +++ b/roles/refstack/tasks/main.yml @@ -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: diff --git a/roles/refstack/templates/prepare.sh.j2 b/roles/refstack/templates/prepare.sh.j2 index 877deb1..5e55828 100755 --- a/roles/refstack/templates/prepare.sh.j2 +++ b/roles/refstack/templates/prepare.sh.j2 @@ -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 @@ -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 diff --git a/roles/refstack/templates/single.sh.j2 b/roles/refstack/templates/single.sh.j2 index a7d9cdc..51814d5 100755 --- a/roles/refstack/templates/single.sh.j2 +++ b/roles/refstack/templates/single.sh.j2 @@ -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 diff --git a/roles/refstack/templates/tempest.conf.j2 b/roles/refstack/templates/tempest.conf.j2 index e3b7d1b..496fee7 100644 --- a/roles/refstack/templates/tempest.conf.j2 +++ b/roles/refstack/templates/tempest.conf.j2 @@ -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