summaryrefslogtreecommitdiff
path: root/tempest/api/compute
diff options
context:
space:
mode:
authorSophie Huang <sh879n@att.com>2021-06-11 16:26:32 +0000
committerSophie Huang <sh879n@att.com>2021-06-15 19:30:31 +0000
commitdba4c9dedb4bbd14d6b09c796e4dfa234cd7824f (patch)
tree8e99b922edc082707c9a3da08cf9f5f6036caa44 /tempest/api/compute
parent62037d802ae5a482593d30be7792eb2fa3e47478 (diff)
downloadtempest-dba4c9dedb4bbd14d6b09c796e4dfa234cd7824f.tar.gz
Use volume_type option in tempest.conf in compute api test
A new configuration option volume_type was added to tempest.conf to allow tempest users to select volume type during volume creation. In this patchset, this volume_type value is used if configured for compute api volume creation. Change-Id: I031094ab196268dc2c20b38be4864f59639358a7
Diffstat (limited to 'tempest/api/compute')
-rw-r--r--tempest/api/compute/base.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 7900b7782..bee4716c8 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -515,6 +515,12 @@ class BaseV2ComputeTest(api_version_utils.BaseMicroversionTest,
kwargs['display_name'] = vol_name
if image_ref is not None:
kwargs['imageRef'] = image_ref
+ if CONF.volume.volume_type and 'volume_type' not in kwargs:
+ # If volume_type is not provided in config then no need to
+ # add a volume type and
+ # if volume_type has already been added by child class then
+ # no need to override.
+ kwargs['volume_type'] = CONF.volume.volume_type
if CONF.compute.compute_volume_common_az:
kwargs.setdefault('availability_zone',
CONF.compute.compute_volume_common_az)