Fix test_volume_retype for active-active cluster
In case of active-active cluster deployment the host of the cinder
volume might be changed as it is uniq per node.
Related-Prod: PRODX-3051
Change-Id: Ifaf69e1b3563c9c6b729885a45723acacb2c82dd
diff --git a/tempest/api/volume/admin/test_volume_retype.py b/tempest/api/volume/admin/test_volume_retype.py
index 1c56eb2..08943bc 100644
--- a/tempest/api/volume/admin/test_volume_retype.py
+++ b/tempest/api/volume/admin/test_volume_retype.py
@@ -156,10 +156,16 @@
def _verify_migration(self, volume_source, volume_dest):
keys_with_no_change = ('id', 'size', 'description', 'name',
- 'user_id', 'os-vol-tenant-attr:tenant_id',
- 'os-vol-host-attr:host')
+ 'user_id', 'os-vol-tenant-attr:tenant_id',)
keys_with_change = ('volume_type',)
+ # NOTE(vsaienko): with active-active cluster deployment volume
+ # services registered with different hostname.
+ if CONF.volume_feature_enabled.cluster_active_active:
+ keys_with_change += ('os-vol-host-attr:host',)
+ else:
+ keys_with_no_change += ('os-vol-host-attr:host',)
+
# Check the volume information after the retype
self.assertIsNone(volume_dest['os-vol-mig-status-attr:migstat'])
self.assertIsNone(volume_dest['migration_status'])
diff --git a/tempest/config.py b/tempest/config.py
index 0f3fa54..961c77b 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -874,7 +874,11 @@
'which is currently attached to a server instance? This '
'depends on the 3.42 volume API microversion and the '
'2.51 compute API microversion. Also, not all volume or '
- 'compute backends support this operation.')
+ 'compute backends support this operation.'),
+ cfg.BoolOpt('cluster_active_active',
+ default=False,
+ help='The boolean flag to indicate if active-active mode '
+ 'is used by volume backend.')
]