Browse code

Add variable to set volume service version on tempest

Tempest is going to test volume v3 APIs as default
in gate and running a separate job to run tests on v2 APIs.

To give this ability, this commit provide a var to tell
which API version need to be tested and accordingly it
configure the catalog_type and microversion setting on tempest.

Change-Id: I531f3b32e81ac5d282461597ca286c09429cb143
Needed-By: I0c9193501eb9eaa25eb5f0786bb72eb7855099fb

ghanshyam authored on 2017/12/14 18:16:56
Showing 1 changed files
... ...
@@ -422,6 +422,13 @@ function configure_tempest {
422 422
     iniset $TEMPEST_CONFIG validation network_for_ssh $TEMPEST_SSH_NETWORK_NAME
423 423
 
424 424
     # Volume
425
+    # Set the service catalog entry for Tempest to run on. Typically
426
+    # used to try different Volume API version targets. The tempest
427
+    # default it to 'volumev3'(v3 APIs endpoint) , so only set this
428
+    # if you want to change it.
429
+    if [[ -n "$TEMPEST_VOLUME_TYPE" ]]; then
430
+        iniset $TEMPEST_CONFIG volume catalog_type $TEMPEST_VOLUME_TYPE
431
+    fi
425 432
     # Only turn on TEMPEST_VOLUME_MANAGE_SNAPSHOT by default for "lvm" backends
426 433
     if [[ "$CINDER_ENABLED_BACKENDS" == *"lvm"* ]]; then
427 434
         TEMPEST_VOLUME_MANAGE_SNAPSHOT=${TEMPEST_VOLUME_MANAGE_SNAPSHOT:-True}
... ...
@@ -443,6 +450,12 @@ function configure_tempest {
443 443
     iniset $TEMPEST_CONFIG volume-feature-enabled api_v1 $(trueorfalse False TEMPEST_VOLUME_API_V1)
444 444
     local tempest_volume_min_microversion=${TEMPEST_VOLUME_MIN_MICROVERSION:-None}
445 445
     local tempest_volume_max_microversion=${TEMPEST_VOLUME_MAX_MICROVERSION:-"latest"}
446
+    # Reset microversions to None where v2 is running which does not support microversion.
447
+    # Both "None" means no microversion testing.
448
+    if [[ "$TEMPEST_VOLUME_TYPE" == "volumev2" ]]; then
449
+        tempest_volume_min_microversion=None
450
+        tempest_volume_max_microversion=None
451
+    fi
446 452
     if [ "$tempest_volume_min_microversion" == "None" ]; then
447 453
         inicomment $TEMPEST_CONFIG volume min_microversion
448 454
     else