From 642b07b930cf5f49d1ed9aa220021d45ca631b1a Mon Sep 17 00:00:00 2001 From: ghanshyam Date: Thu, 19 Nov 2015 10:01:14 +0900 Subject: [PATCH] Add compute microversions configuration on tempest Many projects like Nova, Ironic etc have implemented the microversions for versioning their APIs. Tempest is going to tests those microversions - I57b78b4c0543b6fb0533b556886a19a03297555e. For testing microversion in Tempest on gate, we need to set a valid range of microversion in Tempest config and based on that Tempest will run appropriate tests. This commit adds the below range options for compute microversion testing- - [None, 'latest'] - for master branch as default - [None, None] - for tests running on v2.0 - option to set the range. Depends-On: I81e86faca6f8c0ffb7da22154a62236ac25cf0c0 Partially implements blueprint api-microversions-testing-support Change-Id: I171b862d1bba1af467f5b9a76288216c39e2adda --- lib/tempest | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/tempest b/lib/tempest index 6adc449ad0..61351c0628 100644 --- a/lib/tempest +++ b/lib/tempest @@ -357,6 +357,30 @@ function configure_tempest { compute_api_extensions=$(remove_disabled_extensions $compute_api_extensions $DISABLE_COMPUTE_API_EXTENSIONS) fi + # Set the microversion range for compute tests. + # This is used to run the Nova microversions tests. + # Setting [None, latest] range of microversion which allow Tempest to run all microversions tests. + # NOTE- To avoid microversion tests failure on stable branch, we need to change "tempest_compute_max_microversion" + # for stable branch on each release which should be changed from "latest" to max supported version of that release. + local tempest_compute_min_microversion=${TEMPEST_COMPUTE_MIN_MICROVERSION:-None} + local tempest_compute_max_microversion=${TEMPEST_COMPUTE_MAX_MICROVERSION:-"latest"} + # Reset microversions to None where v2.0 is running which does not support microversion. + # Both "None" means no microversion testing. + if [[ "$TEMPEST_COMPUTE_TYPE" == "compute_legacy" ]]; then + tempest_compute_min_microversion=None + tempest_compute_max_microversion=None + fi + if [ "$tempest_compute_min_microversion" == "None" ]; then + inicomment $TEMPEST_CONFIG compute-feature-enabled min_microversion + else + iniset $TEMPEST_CONFIG compute-feature-enabled min_microversion $tempest_compute_min_microversion + fi + if [ "$tempest_compute_max_microversion" == "None" ]; then + inicomment $TEMPEST_CONFIG compute-feature-enabled max_microversion + else + iniset $TEMPEST_CONFIG compute-feature-enabled max_microversion $tempest_compute_max_microversion + fi + iniset $TEMPEST_CONFIG compute-feature-enabled resize True iniset $TEMPEST_CONFIG compute-feature-enabled live_migration ${LIVE_MIGRATION_AVAILABLE:-False} iniset $TEMPEST_CONFIG compute-feature-enabled change_password False