From 424375c73952d8379f21ff1d5d25b4695726fcb7 Mon Sep 17 00:00:00 2001 From: Tom Barron Date: Mon, 28 Jan 2019 14:06:07 -0500 Subject: [PATCH] Allow setting test API microversions in gate tests Add MANILA_TEMPEST_MIN_API_MICROVERSION and MANILA_TEMPEST_MAX_API_MICROVERSION to the ci post_test_hook. These options default to the values specified in the api_version_request.py file. On master branch don't set these as we want to run with the latest. Related-bug: #1781671 Change-Id: I085ed175dfbe132c80a6a86ab34a281b3c94f5f0 --- manila/post_test_hook.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/manila/post_test_hook.sh b/manila/post_test_hook.sh index e80b80f..18885e5 100644 --- a/manila/post_test_hook.sh +++ b/manila/post_test_hook.sh @@ -66,6 +66,23 @@ elif [[ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]]; then iniset $TEMPEST_CONFIG share enable_ip_rules_for_protocols nfs fi +# 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