From 1caecc598eedd94cb103725857d6687f9fab6ec7 Mon Sep 17 00:00:00 2001 From: Goutham Pacha Ravi Date: Wed, 22 Dec 2021 11:40:09 -0800 Subject: [PATCH] Set tempest api version config in devstack plugin manila's tempest plugin is branchless and can at any time add tests for API microversions incompatible with stable branches. We used to configure test API versions via the post test hook when relying on devstack-gate. However, API version config makes sense whenever we use devstack and have tempest enabled. This will help us simplify default job configuration in the manila-tempest-plugin repository. Since the API version won't change on a stable branch, hard-coding the versions (as other micro-versioned services do in their devstack) doesn't pose any risk of failing reality. Change-Id: Ia671fa74c0ee338199bd92a1613882328d24c9e2 Related-Bug: #1928879 Signed-off-by: Goutham Pacha Ravi --- contrib/ci/post_test_hook.sh | 17 ----------------- devstack/plugin.sh | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/contrib/ci/post_test_hook.sh b/contrib/ci/post_test_hook.sh index f3649d8cc6..18fe5fd0c8 100755 --- a/contrib/ci/post_test_hook.sh +++ b/contrib/ci/post_test_hook.sh @@ -56,23 +56,6 @@ else fi iniset $TEMPEST_CONFIG share backend_names $BACKENDS_NAMES -# If testing a stable branch, we need to ensure we're testing with supported -# API micro-versions; so set the versions from code if we're not testing the -# master branch. If we're testing master, we'll allow manila-tempest-plugin -# (which is branchless) tell us what versions it wants to test. -if [[ $ZUUL_BRANCH != "master" ]]; then - # Grab the supported API micro-versions from the code - _API_VERSION_REQUEST_PATH=$BASE/new/manila/manila/api/openstack/api_version_request.py - _DEFAULT_MIN_VERSION=$(awk '$0 ~ /_MIN_API_VERSION = /{print $3}' $_API_VERSION_REQUEST_PATH) - _DEFAULT_MAX_VERSION=$(awk '$0 ~ /_MAX_API_VERSION = /{print $3}' $_API_VERSION_REQUEST_PATH) - # Override the *_api_microversion tempest options if present - MANILA_TEMPEST_MIN_API_MICROVERSION=${MANILA_TEMPEST_MIN_API_MICROVERSION:-$_DEFAULT_MIN_VERSION} - MANILA_TEMPEST_MAX_API_MICROVERSION=${MANILA_TEMPEST_MAX_API_MICROVERSION:-$_DEFAULT_MAX_VERSION} - # Set these options in tempest.conf - iniset $TEMPEST_CONFIG share min_api_microversion $MANILA_TEMPEST_MIN_API_MICROVERSION - iniset $TEMPEST_CONFIG share max_api_microversion $MANILA_TEMPEST_MAX_API_MICROVERSION -fi - # Set two retries for CI jobs iniset $TEMPEST_CONFIG share share_creation_retry_number 2 diff --git a/devstack/plugin.sh b/devstack/plugin.sh index f8218131b1..e70cab7b83 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -958,6 +958,22 @@ function update_tempest { iniset $TEMPEST_CONFIG identity alt_password $ADMIN_PASSWORD iniset $TEMPEST_CONFIG identity alt_tenant_name ${ALT_TENANT_NAME:-"alt_demo"} iniset $TEMPEST_CONFIG identity alt_domain_name $ADMIN_DOMAIN_NAME + + # If testing a stable branch, we need to ensure we're testing with supported + # API micro-versions; so set the versions from code if we're not testing the + # master branch. If we're testing master, we'll allow manila-tempest-plugin + # (which is branchless) tell us what versions it wants to test. + if [[ "$TARGET_BRANCH" != "master" ]]; then + # Grab the supported API micro-versions from the code + _DEFAULT_MIN_VERSION=$(openstack --os-cloud devstack versions show --service sharev2 -c 'Min Microversion' --status CURRENT -f value) + _DEFAULT_MAX_VERSION=$(openstack --os-cloud devstack versions show --service sharev2 -c 'Max Microversion' --status CURRENT -f value) + # Override the *_api_microversion tempest options if present + MANILA_TEMPEST_MIN_API_MICROVERSION=${MANILA_TEMPEST_MIN_API_MICROVERSION:-$_DEFAULT_MIN_VERSION} + MANILA_TEMPEST_MAX_API_MICROVERSION=${MANILA_TEMPEST_MAX_API_MICROVERSION:-$_DEFAULT_MAX_VERSION} + # Set these options in tempest.conf + iniset $TEMPEST_CONFIG share min_api_microversion $MANILA_TEMPEST_MIN_API_MICROVERSION + iniset $TEMPEST_CONFIG share max_api_microversion $MANILA_TEMPEST_MAX_API_MICROVERSION + fi fi }