Update microversion for for the tests which fail due to multiattach enabled
Related-prod: PRODX-22955
Change-Id: I188ce86d82616a071436f52f831253a16aa09e43
(cherry picked from commit c8b5708326188fc58a9f9ab0a8d75f0051938a4a)
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 c091011..0180513 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 235aea1..4fab5e8 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 ee25a22..33391a0 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 2640311..2e2b99f 100644
--- a/tempest/api/compute/servers/test_device_tagging.py
+++ b/tempest/api/compute/servers/test_device_tagging.py
@@ -115,6 +115,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)
@@ -329,6 +333,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"""
@@ -336,6 +344,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 301db05..44c2197 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 5e82835..3086624 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 955ba1c..5b11c3b 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 ba95569..c2083ed 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/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 fa6f2b3..316f248 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