summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-03-17 12:00:45 +0000
committerGerrit Code Review <review@openstack.org>2023-03-17 12:00:45 +0000
commitcfa71428ff617ad71be79bf370b71a6facad9ae0 (patch)
tree3b3a303a84909eb4be80ed5641309253146205fc
parent35b4b58d01e0e92a3e5d3dcadba9c874482bcc20 (diff)
parentb04b102984fa16f4837f63e322baf472c1c76609 (diff)
downloadtempest-cfa71428ff617ad71be79bf370b71a6facad9ae0.tar.gz
Merge "Update multiattach tests"
-rw-r--r--tempest/api/compute/admin/test_volume_swap.py5
-rw-r--r--tempest/api/compute/admin/test_volumes_negative.py6
-rw-r--r--tempest/api/compute/volumes/test_attach_volume.py4
-rw-r--r--tempest/config.py4
4 files changed, 14 insertions, 5 deletions
diff --git a/tempest/api/compute/admin/test_volume_swap.py b/tempest/api/compute/admin/test_volume_swap.py
index 7da87c76f..36148c5f9 100644
--- a/tempest/api/compute/admin/test_volume_swap.py
+++ b/tempest/api/compute/admin/test_volume_swap.py
@@ -199,11 +199,12 @@ class TestMultiAttachVolumeSwap(TestVolumeSwapBase):
"server1"
8. Check "volume2" is attached to "server1".
"""
+ multiattach_vol_type = CONF.volume.volume_type_multiattach
# Create two volumes.
# NOTE(gmann): Volumes are created before server creation so that
# volumes cleanup can happen successfully irrespective of which volume
# is attached to server.
- volume1 = self.create_volume(multiattach=True)
+ volume1 = self.create_volume(volume_type=multiattach_vol_type)
# Make volume1 read-only since you can't swap from a volume with
# multiple read/write attachments, and you can't change the readonly
# flag on an in-use volume so we have to do this before attaching
@@ -211,7 +212,7 @@ class TestMultiAttachVolumeSwap(TestVolumeSwapBase):
# attach modes, then we can handle this differently.
self.admin_volumes_client.update_volume_readonly(
volume1['id'], readonly=True)
- volume2 = self.create_volume(multiattach=True)
+ volume2 = self.create_volume(volume_type=multiattach_vol_type)
# Create two servers and wait for them to be ACTIVE.
validation_resources = self.get_class_validation_resources(
diff --git a/tempest/api/compute/admin/test_volumes_negative.py b/tempest/api/compute/admin/test_volumes_negative.py
index 91ab09e79..55c842fee 100644
--- a/tempest/api/compute/admin/test_volumes_negative.py
+++ b/tempest/api/compute/admin/test_volumes_negative.py
@@ -115,9 +115,11 @@ class UpdateMultiattachVolumeNegativeTest(base.BaseV2ComputeAdminTest):
5. Check "vol1" is still attached to both servers
6. Check "vol2" is not attached to any server
"""
+ multiattach_vol_type = CONF.volume.volume_type_multiattach
+
# Create two multiattach capable volumes.
- vol1 = self.create_volume(multiattach=True)
- vol2 = self.create_volume(multiattach=True)
+ vol1 = self.create_volume(volume_type=multiattach_vol_type)
+ vol2 = self.create_volume(volume_type=multiattach_vol_type)
# Create two instances.
validation_resources = self.get_class_validation_resources(
diff --git a/tempest/api/compute/volumes/test_attach_volume.py b/tempest/api/compute/volumes/test_attach_volume.py
index 5380c6732..7ea8f0968 100644
--- a/tempest/api/compute/volumes/test_attach_volume.py
+++ b/tempest/api/compute/volumes/test_attach_volume.py
@@ -369,7 +369,9 @@ class AttachVolumeMultiAttachTest(BaseAttachVolumeTest):
kwargs = {}
if bootable:
kwargs['image_ref'] = CONF.compute.image_ref
- return self.create_volume(multiattach=True, **kwargs)
+ multiattach_vol_type = CONF.volume.volume_type_multiattach
+ return self.create_volume(volume_type=multiattach_vol_type,
+ **kwargs)
def _create_and_multiattach(self):
"""Creates two server instances and a volume and attaches to both.
diff --git a/tempest/config.py b/tempest/config.py
index dfc0a8eb3..551578ee4 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -1015,6 +1015,10 @@ VolumeGroup = [
cfg.StrOpt('volume_type',
default='',
help='Volume type to be used while creating volume.'),
+ cfg.StrOpt('volume_type_multiattach',
+ default='',
+ help='Multiattach volume type used while creating multiattach '
+ 'volume.'),
cfg.StrOpt('storage_protocol',
default='iSCSI',
help='Backend protocol to target when creating volume types'),