Normalize volume_type_multiattach option with upstream
followup to I5f68ef56fcc55dfc636936dabb5e6ad761579519
put it in [volume] section [0]
[0] https://review.opendev.org/c/openstack/tempest/+/875372
Related-Issue: PRODX-34963
Change-Id: Id818a5bfccbc0b81bb8c1de2229a0b033bdb9a5c
diff --git a/tempest/api/compute/admin/test_volume_swap.py b/tempest/api/compute/admin/test_volume_swap.py
index 047a540..430fa5d 100644
--- a/tempest/api/compute/admin/test_volume_swap.py
+++ b/tempest/api/compute/admin/test_volume_swap.py
@@ -156,7 +156,7 @@
super(TestMultiAttachVolumeSwap, cls).skip_checks()
if not CONF.compute_feature_enabled.volume_multiattach:
raise cls.skipException('Volume multi-attach is not available.')
- if not CONF.compute_feature_enabled.volume_type_multiattach:
+ if not CONF.volume.volume_type_multiattach:
raise cls.skipException('Multi-attach volume type is not defined')
@classmethod
@@ -194,8 +194,7 @@
"server1"
8. Check "volume2" is attached to "server1".
"""
- multiattach_vol_type = CONF.compute_feature_enabled.\
- volume_type_multiattach
+ 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
diff --git a/tempest/api/compute/admin/test_volumes_negative.py b/tempest/api/compute/admin/test_volumes_negative.py
index 96076ea..7adeb10 100644
--- a/tempest/api/compute/admin/test_volumes_negative.py
+++ b/tempest/api/compute/admin/test_volumes_negative.py
@@ -85,7 +85,7 @@
super(UpdateMultiattachVolumeNegativeTest, cls).skip_checks()
if not CONF.compute_feature_enabled.volume_multiattach:
raise cls.skipException('Volume multi-attach is not available.')
- if not CONF.compute_feature_enabled.volume_type_multiattach:
+ if not CONF.volume.volume_type_multiattach:
raise cls.skipException('Multi-attach volume type is not defined')
@decorators.attr(type=['negative'])
@@ -102,8 +102,7 @@
5. Check "vol1" is still attached to both servers
6. Check "vol2" is not attached to any server
"""
- multiattach_vol_type = CONF.compute_feature_enabled.\
- volume_type_multiattach
+ multiattach_vol_type = CONF.volume.volume_type_multiattach
# Create two multiattach capable volumes.
vol1 = self.create_volume(volume_type=multiattach_vol_type)
diff --git a/tempest/api/compute/volumes/test_attach_volume.py b/tempest/api/compute/volumes/test_attach_volume.py
index 617b3a0..997f080 100644
--- a/tempest/api/compute/volumes/test_attach_volume.py
+++ b/tempest/api/compute/volumes/test_attach_volume.py
@@ -342,7 +342,7 @@
super(AttachVolumeMultiAttachTest, cls).skip_checks()
if not CONF.compute_feature_enabled.volume_multiattach:
raise cls.skipException('Volume multi-attach is not available.')
- if not CONF.compute_feature_enabled.volume_type_multiattach:
+ if not CONF.volume.volume_type_multiattach:
raise cls.skipException('Multi-attach volume type is not defined')
def _attach_volume_to_servers(self, volume, servers):
@@ -385,8 +385,7 @@
kwargs = {}
if bootable:
kwargs['image_ref'] = CONF.compute.image_ref
- multiattach_vol_type = CONF.compute_feature_enabled.\
- volume_type_multiattach
+ multiattach_vol_type = CONF.volume.volume_type_multiattach
return self.create_volume(volume_type=multiattach_vol_type,
**kwargs)
diff --git a/tempest/config.py b/tempest/config.py
index 41baf4e..d22742b 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -654,10 +654,6 @@
help='Does the test environment support attaching a volume to '
'more than one instance? This depends on hypervisor and '
'volume backend/type and compute API version 2.60.'),
- cfg.StrOpt('volume_type_multiattach',
- default='',
- help='Multiattach volume type used while creating multiattach '
- 'volume. When empty multiattach tests are skipped'),
cfg.BoolOpt('xenapi_apis',
default=False,
help='Does the test environment support the XenAPI-specific '
@@ -1047,6 +1043,10 @@
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. When empty multiattach tests are skipped'),
cfg.StrOpt('storage_protocol',
default='iSCSI',
help='Backend protocol to target when creating volume types'),