Revert "Use a non admin privileges for retyping a volume"
This reverts commit f5869b4557855af9450501c65e03bd16fd269036.
When retyping a volume, it is possible that Cinder falls back to
migrating a volume in order to complete the retype which is admin-only
operation.
This will result in a failure because Cinder will attempt to contact
Nova using the credentials of the user which are not elevated, with
Nova refusing to do the volume swap.
Therefore, in order to effectively test this, we should stick to using
the admin API as a retype can require a migration which is an
admin-only operation.
Related-Bug: #1740544
Change-Id: I3e4853146bb6e2a62205ffe690da081229215f54
diff --git a/tempest/scenario/test_volume_migrate_attached.py b/tempest/scenario/test_volume_migrate_attached.py
index 6cdaa23..5667fbb 100644
--- a/tempest/scenario/test_volume_migrate_attached.py
+++ b/tempest/scenario/test_volume_migrate_attached.py
@@ -38,6 +38,11 @@
credentials = ['primary', 'admin']
@classmethod
+ def setup_clients(cls):
+ super(TestVolumeMigrateRetypeAttached, cls).setup_clients()
+ cls.admin_volumes_client = cls.os_admin.volumes_v2_client
+
+ @classmethod
def skip_checks(cls):
super(TestVolumeMigrateRetypeAttached, cls).skip_checks()
if not CONF.volume_feature_enabled.multi_backend:
@@ -77,7 +82,7 @@
def _volume_retype_with_migration(self, volume_id, new_volume_type):
migration_policy = 'on-demand'
- self.volumes_client.retype_volume(
+ self.admin_volumes_client.retype_volume(
volume_id, new_type=new_volume_type,
migration_policy=migration_policy)
waiters.wait_for_volume_retype(self.volumes_client,