Merge "Add workaround for issue with deletion of TF security-group" into mcp/epoxy
diff --git a/tempest/api/compute/admin/test_live_migration.py b/tempest/api/compute/admin/test_live_migration.py
index f6a1ae9..20fa7bd 100644
--- a/tempest/api/compute/admin/test_live_migration.py
+++ b/tempest/api/compute/admin/test_live_migration.py
@@ -381,3 +381,6 @@
min_microversion = '2.25'
max_microversion = 'latest'
block_migration = 'auto'
+
+ if CONF.compute_feature_enabled.volume_multiattach:
+ min_microversion = '2.60'
diff --git a/tempest/api/compute/admin/test_volume.py b/tempest/api/compute/admin/test_volume.py
index b0f20f6..9092f9c 100644
--- a/tempest/api/compute/admin/test_volume.py
+++ b/tempest/api/compute/admin/test_volume.py
@@ -43,6 +43,9 @@
class AttachSCSIVolumeTestJSON(BaseAttachSCSIVolumeTest):
"""Test attaching scsi volume to server"""
+ if CONF.compute_feature_enabled.volume_multiattach:
+ min_microversion = '2.60'
+
@testtools.skipIf(
CONF.compute_feature_enabled.barbican_integration_enabled,
"Not supported when barbican integration enabled.")
diff --git a/tempest/api/compute/admin/test_volume_swap.py b/tempest/api/compute/admin/test_volume_swap.py
index 0d8370d..d7abf72 100644
--- a/tempest/api/compute/admin/test_volume_swap.py
+++ b/tempest/api/compute/admin/test_volume_swap.py
@@ -80,6 +80,9 @@
class TestVolumeSwap(TestVolumeSwapBase):
"""The test suite for swapping of volume with admin user"""
+ if CONF.compute_feature_enabled.volume_multiattach:
+ min_microversion = '2.60'
+
# NOTE(mriedem): This is an uncommon scenario to call the compute API
# to swap volumes directly; swap volume is primarily only for volume
# live migration and retype callbacks from the volume service, and is slow
diff --git a/tempest/api/compute/admin/test_volumes_negative.py b/tempest/api/compute/admin/test_volumes_negative.py
index 8b07d9a..32892a6 100644
--- a/tempest/api/compute/admin/test_volumes_negative.py
+++ b/tempest/api/compute/admin/test_volumes_negative.py
@@ -27,6 +27,10 @@
create_default_network = True
+ if CONF.compute_feature_enabled.volume_multiattach:
+ min_microversion = '2.60'
+ max_microversion = 'latest'
+
@classmethod
def setup_credentials(cls):
cls.prepare_instance_network()
diff --git a/tempest/api/compute/servers/test_delete_server.py b/tempest/api/compute/servers/test_delete_server.py
index 596d2bd..dfbed3b 100644
--- a/tempest/api/compute/servers/test_delete_server.py
+++ b/tempest/api/compute/servers/test_delete_server.py
@@ -29,6 +29,9 @@
"""Test deleting servers in various states"""
create_default_network = True
+ if CONF.compute_feature_enabled.volume_multiattach:
+ min_microversion = '2.60'
+
# NOTE: Server creations of each test class should be under 10
# for preventing "Quota exceeded for instances"
diff --git a/tempest/api/compute/servers/test_device_tagging.py b/tempest/api/compute/servers/test_device_tagging.py
index d2fdd52..5f9bb4f 100644
--- a/tempest/api/compute/servers/test_device_tagging.py
+++ b/tempest/api/compute/servers/test_device_tagging.py
@@ -83,6 +83,10 @@
# 2.32 and 2.36 inclusive; the 2.37 microversion broke tags for networks.
max_microversion = '2.32'
+ if CONF.compute_feature_enabled.volume_multiattach:
+ min_microversion = '2.60'
+ max_microversion = 'latest'
+
def verify_device_metadata(self, md_json):
try:
md_dict = json.loads(md_json)
@@ -297,6 +301,10 @@
min_microversion = '2.42'
max_microversion = 'latest'
+ if CONF.compute_feature_enabled.volume_multiattach:
+ min_microversion = '2.60'
+ max_microversion = 'latest'
+
class TaggedAttachmentsTest(DeviceTaggingBase):
"""Test tagged attachments with compute microversion greater than 2.48"""
@@ -304,6 +312,10 @@
min_microversion = '2.49'
max_microversion = 'latest'
+ if CONF.compute_feature_enabled.volume_multiattach:
+ min_microversion = '2.60'
+ max_microversion = 'latest'
+
@classmethod
def skip_checks(cls):
super(TaggedAttachmentsTest, cls).skip_checks()
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index 938e4b4..67f50ba 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -37,6 +37,9 @@
class ServerActionsBase(base.BaseV2ComputeTest):
"""Test server actions"""
+ if CONF.compute_feature_enabled.volume_multiattach:
+ min_microversion = '2.60'
+
def setUp(self):
# NOTE(afazekas): Normally we use the same server with all test cases,
# but if it has an issue, we build a new one
diff --git a/tempest/api/compute/servers/test_server_rescue.py b/tempest/api/compute/servers/test_server_rescue.py
index 9404ebd..646f1cd 100644
--- a/tempest/api/compute/servers/test_server_rescue.py
+++ b/tempest/api/compute/servers/test_server_rescue.py
@@ -29,6 +29,9 @@
class ServerRescueTestBase(base.BaseV2ComputeTest):
create_default_network = True
+ if CONF.compute_feature_enabled.volume_multiattach:
+ min_microversion = '2.60'
+
@classmethod
def skip_checks(cls):
super(ServerRescueTestBase, cls).skip_checks()
diff --git a/tempest/api/compute/servers/test_server_rescue_negative.py b/tempest/api/compute/servers/test_server_rescue_negative.py
index fd05ec6..ba1a7fc 100644
--- a/tempest/api/compute/servers/test_server_rescue_negative.py
+++ b/tempest/api/compute/servers/test_server_rescue_negative.py
@@ -30,6 +30,9 @@
class ServerRescueNegativeTestJSON(base.BaseV2ComputeTest):
"""Negative tests of server rescue"""
+ if CONF.compute_feature_enabled.volume_multiattach:
+ min_microversion = '2.60'
+
@classmethod
def skip_checks(cls):
super(ServerRescueNegativeTestJSON, cls).skip_checks()
diff --git a/tempest/api/compute/volumes/test_attach_volume.py b/tempest/api/compute/volumes/test_attach_volume.py
index 81b5c9d..22a8e74 100644
--- a/tempest/api/compute/volumes/test_attach_volume.py
+++ b/tempest/api/compute/volumes/test_attach_volume.py
@@ -61,6 +61,9 @@
class AttachVolumeTestJSON(BaseAttachVolumeTest):
"""Test attaching volume to server"""
+ if CONF.compute_feature_enabled.volume_multiattach:
+ min_microversion = '2.60'
+
@decorators.idempotent_id('52e9045a-e90d-4c0d-9087-79d657faffff')
# This test is conditionally marked slow if SSH validation is enabled.
@decorators.attr(type='slow', condition=CONF.validation.run_validation)
diff --git a/tempest/api/compute/volumes/test_attach_volume_negative.py b/tempest/api/compute/volumes/test_attach_volume_negative.py
index 43b4bf5..09bf488 100644
--- a/tempest/api/compute/volumes/test_attach_volume_negative.py
+++ b/tempest/api/compute/volumes/test_attach_volume_negative.py
@@ -23,6 +23,9 @@
class AttachVolumeNegativeTest(test_attach_volume.BaseAttachVolumeTest):
"""Negative tests of volume attaching"""
+ if CONF.compute_feature_enabled.volume_multiattach:
+ min_microversion = '2.60'
+
@decorators.attr(type=['negative'])
@decorators.related_bug('1630783', status_code=500)
@decorators.idempotent_id('a313b5cd-fbd0-49cc-94de-870e99f763c7')
diff --git a/tempest/api/volume/admin/test_multi_backend.py b/tempest/api/volume/admin/test_multi_backend.py
index 028bf1a..b45824e 100644
--- a/tempest/api/volume/admin/test_multi_backend.py
+++ b/tempest/api/volume/admin/test_multi_backend.py
@@ -30,8 +30,9 @@
raise cls.skipException("Cinder multi-backend feature disabled")
if len(set(CONF.volume.backend_names)) < 2:
- raise cls.skipException("Requires at least two different "
- "backend names")
+ raise cls.skipException(
+ "Requires at least two different "
+ "backend names")
@classmethod
def resource_setup(cls):
@@ -66,21 +67,34 @@
extra_specs = {spec_key_with_prefix: backend_name_key}
else:
extra_specs = {spec_key_without_prefix: backend_name_key}
- cls.create_volume_type(name=type_name,
- extra_specs=extra_specs)
+ cls.create_volume_type(
+ name=type_name, extra_specs=extra_specs)
+ # Pick up AZ from volume_type
+ services = cls.admin_volume_services_client.list_services()
+ vol_svrs = [
+ srv
+ for srv in services.get("services")
+ if srv["binary"] == "cinder-volume" and backend_name_key
+ in srv["host"]
+ ]
+ vol_type_zone = vol_svrs[0]["zone"]
- params = {'name': vol_name, 'volume_type': type_name,
- 'size': CONF.volume.volume_size}
+ params = {
+ "name": vol_name,
+ "volume_type": type_name,
+ "size": CONF.volume.volume_size,
+ "availability_zone": vol_type_zone,
+ }
cls.volume = cls.create_volume(**params)
if with_prefix:
- cls.volume_id_list_with_prefix.append(cls.volume['id'])
+ cls.volume_id_list_with_prefix.append(cls.volume["id"])
else:
- cls.volume_id_list_without_prefix.append(
- cls.volume['id'])
- waiters.wait_for_volume_resource_status(cls.admin_volume_client,
- cls.volume['id'], 'available')
+ cls.volume_id_list_without_prefix.append(cls.volume["id"])
+ waiters.wait_for_volume_resource_status(
+ cls.admin_volume_client, cls.volume["id"], "available"
+ )
- @decorators.idempotent_id('c1a41f3f-9dad-493e-9f09-3ff197d477cc')
+ @decorators.idempotent_id("c1a41f3f-9dad-493e-9f09-3ff197d477cc")
def test_backend_name_reporting(self):
"""Test backend name reporting for volume when type is without prefix
@@ -92,7 +106,7 @@
for volume_id in self.volume_id_list_without_prefix:
self._test_backend_name_reporting_by_volume_id(volume_id)
- @decorators.idempotent_id('f38e647f-ab42-4a31-a2e7-ca86a6485215')
+ @decorators.idempotent_id("f38e647f-ab42-4a31-a2e7-ca86a6485215")
def test_backend_name_reporting_with_prefix(self):
"""Test backend name reporting for volume when type is with prefix
@@ -105,7 +119,7 @@
for volume_id in self.volume_id_list_with_prefix:
self._test_backend_name_reporting_by_volume_id(volume_id)
- @decorators.idempotent_id('46435ab1-a0af-4401-8373-f14e66b0dd58')
+ @decorators.idempotent_id("46435ab1-a0af-4401-8373-f14e66b0dd58")
def test_backend_name_distinction(self):
"""Test volume backend distinction when type is without prefix
@@ -116,7 +130,7 @@
"""
self._test_backend_name_distinction(self.volume_id_list_without_prefix)
- @decorators.idempotent_id('4236305b-b65a-4bfc-a9d2-69cb5b2bf2ed')
+ @decorators.idempotent_id("4236305b-b65a-4bfc-a9d2-69cb5b2bf2ed")
def test_backend_name_distinction_with_prefix(self):
"""Test volume backend distinction when type is with prefix
@@ -128,28 +142,29 @@
self._test_backend_name_distinction(self.volume_id_list_with_prefix)
def _get_volume_host(self, volume_id):
- return self.admin_volume_client.show_volume(
- volume_id)['volume']['os-vol-host-attr:host']
+ return self.admin_volume_client.show_volume(volume_id)["volume"][
+ "os-vol-host-attr:host"
+ ]
def _test_backend_name_reporting_by_volume_id(self, volume_id):
# this test checks if os-vol-attr:host is populated correctly after
# the multi backend feature has been enabled
# if multi-backend is enabled: os-vol-attr:host should be like:
# host@backend_name
- volume = self.admin_volume_client.show_volume(volume_id)['volume']
+ volume = self.admin_volume_client.show_volume(volume_id)["volume"]
- volume1_host = volume['os-vol-host-attr:host']
- msg = ("multi-backend reporting incorrect values for volume %s" %
- volume_id)
+ volume1_host = volume["os-vol-host-attr:host"]
+ msg = ("multi-backend reporting incorrect values for volume %s"
+ % volume_id)
self.assertGreater(len(volume1_host.split("@")), 1, msg)
def _test_backend_name_distinction(self, volume_id_list):
# this test checks that the volumes created at setUp don't
# belong to the same backend (if they are, than the
# volume backend distinction is not working properly)
- volume_hosts = [self._get_volume_host(volume) for volume in
- volume_id_list]
+ volume_hosts = [self._get_volume_host(volume)
+ for volume in volume_id_list]
# assert that volumes are each created on separate hosts:
- msg = ("volumes %s were created in the same backend" % ", "
- .join(volume_hosts))
+ msg = "volumes %s were created in the same backend" % ", ".join(
+ volume_hosts)
self.assertCountEqual(volume_hosts, set(volume_hosts), msg)
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index 7a08545..b93ade5 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -267,6 +267,12 @@
kwargs['validatable'] = True
tenant_network = self.get_tenant_network()
+
+ # Since microversion v2.37 'networks' field is required
+ if self.compute_request_microversion >= '2.37' and 'networks'\
+ not in kwargs:
+ kwargs['networks'] = 'none'
+
body, _ = compute.create_test_server(
self.os_primary,
tenant_network=tenant_network,
diff --git a/tempest/api/volume/test_volumes_backup.py b/tempest/api/volume/test_volumes_backup.py
index a3ba974..eb581ee 100644
--- a/tempest/api/volume/test_volumes_backup.py
+++ b/tempest/api/volume/test_volumes_backup.py
@@ -29,6 +29,8 @@
"""Test volumes backup"""
create_default_network = True
+ if CONF.compute_feature_enabled.volume_multiattach:
+ min_microversion = '2.60'
@classmethod
def skip_checks(cls):
diff --git a/tempest/api/volume/test_volumes_extend.py b/tempest/api/volume/test_volumes_extend.py
index c766db8..02b8745 100644
--- a/tempest/api/volume/test_volumes_extend.py
+++ b/tempest/api/volume/test_volumes_extend.py
@@ -180,6 +180,9 @@
class VolumesExtendAttachedTest(BaseVolumesExtendAttachedTest):
+ if CONF.compute_feature_enabled.volume_multiattach:
+ min_microversion = '2.60'
+
@classmethod
def skip_checks(cls):
super(VolumesExtendAttachedTest, cls).skip_checks()
diff --git a/tempest/api/volume/test_volumes_snapshots.py b/tempest/api/volume/test_volumes_snapshots.py
index 35afffd..3e06304 100644
--- a/tempest/api/volume/test_volumes_snapshots.py
+++ b/tempest/api/volume/test_volumes_snapshots.py
@@ -29,6 +29,9 @@
create_default_network = True
+ if CONF.compute_feature_enabled.volume_multiattach:
+ min_microversion = '2.60'
+
@classmethod
def skip_checks(cls):
super(VolumesSnapshotTestJSON, cls).skip_checks()
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index feb2cf1..4586af5 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -52,7 +52,10 @@
credentials = ['primary', 'admin']
- compute_min_microversion = None
+ if CONF.compute_feature_enabled.volume_multiattach:
+ compute_min_microversion = '2.60'
+ else:
+ compute_min_microversion = None
compute_max_microversion = LATEST_MICROVERSION
volume_min_microversion = None
volume_max_microversion = LATEST_MICROVERSION