Merge "Correct policy action for check_endpoint_group test"
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_volume_attachments_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_volume_attachments_rbac.py
index 98dbee5..a401f24 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_volume_attachments_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_volume_attachments_rbac.py
@@ -30,7 +30,7 @@
@classmethod
def setup_clients(cls):
super(ServerVolumeAttachmentRbacTest, cls).setup_clients()
- cls.volumes_client = cls.os_primary.volumes_client
+ cls.volumes_client = cls.os_primary.volumes_client_latest
@classmethod
def skip_checks(cls):
@@ -68,6 +68,7 @@
@decorators.idempotent_id('997df9c2-6e54-47b6-ab74-e4fdb500f385')
def test_show_volume_attachment(self):
attachment = self.attach_volume(self.server, self.volume)
+
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
self.servers_client.show_volume_attachment(
self.server['id'], attachment['id'])
@@ -80,6 +81,7 @@
def test_update_volume_attachment(self):
attachment = self.attach_volume(self.server, self.volume)
alt_volume = self.create_volume()
+
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
self.servers_client.update_attached_volume(
self.server['id'], attachment['id'], volumeId=alt_volume['id'])
@@ -102,6 +104,7 @@
@decorators.idempotent_id('12b03e90-d087-46af-9c4d-507d021c4984')
def test_delete_volume_attachment(self):
self.attach_volume(self.server, self.volume)
+
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
self.servers_client.detach_volume(self.server['id'], self.volume['id'])
waiters.wait_for_volume_resource_status(self.volumes_client,
diff --git a/patrole_tempest_plugin/tests/api/compute/test_volume_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_volume_rbac.py
index b775872..0935c95 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_volume_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_volume_rbac.py
@@ -34,6 +34,11 @@
max_microversion = '2.35'
@classmethod
+ def setup_clients(cls):
+ super(VolumeRbacTest, cls).setup_clients()
+ cls.admin_volumes_client = cls.os_admin.volumes_client_latest
+
+ @classmethod
def resource_setup(cls):
super(VolumeRbacTest, cls).resource_setup()
cls.volume = cls.create_volume()
@@ -56,7 +61,7 @@
size=CONF.volume.volume_size)['volume']
# Use the admin volumes client to wait, because waiting involves
# calling show API action which enforces a different policy.
- waiters.wait_for_volume_resource_status(self.os_admin.volumes_client,
+ waiters.wait_for_volume_resource_status(self.admin_volumes_client,
volume['id'], 'available')
# Use non-deprecated volumes_client for deletion.
self.addCleanup(self.volumes_client.delete_volume, volume['id'])
diff --git a/patrole_tempest_plugin/tests/api/volume/test_volume_actions_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_volume_actions_rbac.py
index b666a2d..b379c5d 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_volume_actions_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_volume_actions_rbac.py
@@ -33,6 +33,7 @@
def setup_clients(cls):
super(VolumesActionsRbacTest, cls).setup_clients()
cls.admin_image_client = cls.os_admin.image_client_v2
+ cls.admin_volumes_client = cls.os_admin.volumes_client_latest
@classmethod
def resource_setup(cls):
@@ -54,7 +55,7 @@
server['id'], volumeId=volume_id,
device='/dev/%s' % CONF.compute.volume_device_name)
waiters.wait_for_volume_resource_status(
- self.os_admin.volumes_client, volume_id, 'in-use')
+ self.admin_volumes_client, volume_id, 'in-use')
self.addCleanup(self._detach_volume, volume_id)
def _detach_volume(self, volume_id=None):
@@ -63,7 +64,7 @@
self.volumes_client.detach_volume(volume_id)
waiters.wait_for_volume_resource_status(
- self.os_admin.volumes_client, volume_id, 'available')
+ self.admin_volumes_client, volume_id, 'available')
@test.services('compute')
@rbac_rule_validation.action(service="cinder", rule="volume:attach")
@@ -106,7 +107,7 @@
image_id)
waiters.wait_for_image_status(self.admin_image_client, image_id,
'active')
- waiters.wait_for_volume_resource_status(self.os_admin.volumes_client,
+ waiters.wait_for_volume_resource_status(self.admin_volumes_client,
self.volume['id'], 'available')
@rbac_rule_validation.action(service="cinder",
@@ -161,7 +162,7 @@
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
self.volumes_client.retype_volume(volume['id'], new_type=vol_type)
waiters.wait_for_volume_retype(
- self.os_admin.volumes_client, volume['id'], vol_type)
+ self.admin_volumes_client, volume['id'], vol_type)
@rbac_rule_validation.action(
service="cinder",
@@ -204,7 +205,7 @@
self.volumes_client.force_detach_volume(
volume['id'], connector=None,
attachment_id=attachment['attachment_id'])
- waiters.wait_for_volume_resource_status(self.os_admin.volumes_client,
+ waiters.wait_for_volume_resource_status(self.admin_volumes_client,
volume['id'], 'available')
@@ -221,6 +222,7 @@
def setup_clients(cls):
super(VolumesActionsV310RbacTest, cls).setup_clients()
cls.admin_image_client = cls.os_admin.image_client_v2
+ cls.admin_volumes_client = cls.os_admin.volumes_client_latest
@test.attr(type=["slow"])
@test.services('image')
@@ -243,7 +245,7 @@
image_id)
waiters.wait_for_image_status(self.admin_image_client, image_id,
'active')
- waiters.wait_for_volume_resource_status(self.os_admin.volumes_client,
+ waiters.wait_for_volume_resource_status(self.admin_volumes_client,
volume['id'], 'available')
diff --git a/patrole_tempest_plugin/tests/api/volume/test_volume_quotas_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_volume_quotas_rbac.py
index 6e9812b..851d468 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_volume_quotas_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_volume_quotas_rbac.py
@@ -29,7 +29,7 @@
@classmethod
def setup_clients(cls):
super(VolumeQuotasRbacTest, cls).setup_clients()
- cls.quotas_client = cls.os_primary.volume_quotas_client
+ cls.quotas_client = cls.os_primary.volume_quotas_v2_client
@rbac_rule_validation.action(service="cinder",
rule="volume_extension:quotas:show")
diff --git a/patrole_tempest_plugin/tests/api/volume/test_volume_transfers_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_volume_transfers_rbac.py
index 212482c..405d02b 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_volume_transfers_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_volume_transfers_rbac.py
@@ -23,13 +23,11 @@
class VolumesTransfersRbacTest(rbac_base.BaseVolumeRbacTest):
- credentials = ['primary', 'admin']
-
@classmethod
def setup_clients(cls):
super(VolumesTransfersRbacTest, cls).setup_clients()
cls.transfers_client = cls.os_primary.volume_transfers_v2_client
- cls.adm_volumes_client = cls.os_admin.volumes_v2_client
+ cls.admin_volumes_client = cls.os_admin.volumes_client_latest
@classmethod
def resource_setup(cls):
@@ -43,7 +41,7 @@
test_utils.call_and_ignore_notfound_exc(
self.transfers_client.delete_volume_transfer, transfer['id'])
waiters.wait_for_volume_resource_status(
- self.adm_volumes_client, self.volume['id'], 'available')
+ self.admin_volumes_client, self.volume['id'], 'available')
def _create_transfer(self):
transfer = self.transfers_client.create_volume_transfer(
diff --git a/patrole_tempest_plugin/tests/api/volume/test_volumes_backup_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_volumes_backup_rbac.py
index e6944cc..e8949d6 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_volumes_backup_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_volumes_backup_rbac.py
@@ -41,6 +41,11 @@
if not CONF.volume_feature_enabled.backup:
raise cls.skipException("Cinder backup feature disabled")
+ @classmethod
+ def setup_clients(cls):
+ super(VolumesBackupsRbacTest, cls).setup_clients()
+ cls.admin_backups_client = cls.os_admin.backups_v2_client
+
def _decode_url(self, backup_url):
return json.loads(base64.decode_as_text(backup_url))
@@ -95,7 +100,7 @@
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
self.backups_client.reset_backup_status(backup_id=backup['id'],
status='error')
- waiters.wait_for_volume_resource_status(self.os_admin.backups_client,
+ waiters.wait_for_volume_resource_status(self.admin_backups_client,
backup['id'], 'error')
@test.attr(type=["slow"])
@@ -104,10 +109,11 @@
@decorators.idempotent_id('9c794bf9-2446-4f41-8fe0-80b71e757f9d')
def test_restore_backup(self):
backup = self.create_backup(volume_id=self.volume['id'])
+
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
restore = self.backups_client.restore_backup(backup['id'])['restore']
waiters.wait_for_volume_resource_status(
- self.os_admin.backups_client, restore['backup_id'], 'available')
+ self.admin_backups_client, restore['backup_id'], 'available')
@test.attr(type=["slow"])
@rbac_rule_validation.action(service="cinder",
@@ -121,7 +127,7 @@
volume_id=self.volume['id'])['backup']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.backups_client.delete_backup, backup['id'])
- waiters.wait_for_volume_resource_status(self.os_admin.backups_client,
+ waiters.wait_for_volume_resource_status(self.admin_backups_client,
backup['id'], 'available')
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
diff --git a/patrole_tempest_plugin/tests/api/volume/test_volumes_extend_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_volumes_extend_rbac.py
index 5709669..971e079 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_volumes_extend_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_volumes_extend_rbac.py
@@ -26,6 +26,11 @@
class VolumesExtendRbacTest(rbac_base.BaseVolumeRbacTest):
@classmethod
+ def setup_clients(cls):
+ super(VolumesExtendRbacTest, cls).setup_clients()
+ cls.admin_volumes_client = cls.os_admin.volumes_client_latest
+
+ @classmethod
def resource_setup(cls):
super(VolumesExtendRbacTest, cls).resource_setup()
# Create a test shared volume for tests
@@ -40,7 +45,7 @@
self.volumes_client.extend_volume(self.volume['id'],
new_size=extend_size)
waiters.wait_for_volume_resource_status(
- self.os_admin.volumes_client, self.volume['id'], 'available')
+ self.admin_volumes_client, self.volume['id'], 'available')
class VolumesExtendV3RbacTest(VolumesExtendRbacTest):
diff --git a/patrole_tempest_plugin/tests/api/volume/test_volumes_manage_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_volumes_manage_rbac.py
index 8e71ee8..bea3a46 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_volumes_manage_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_volumes_manage_rbac.py
@@ -42,6 +42,7 @@
def setup_clients(cls):
super(VolumesManageRbacTest, cls).setup_clients()
cls.volume_manage_client = cls.os_primary.volume_manage_v2_client
+ cls.admin_volumes_client = cls.os_admin.volumes_client_latest
def _manage_volume(self, org_volume):
# Manage volume
@@ -59,14 +60,14 @@
new_volume_id = self.volume_manage_client.manage_volume(
**new_volume_ref)['volume']['id']
- waiters.wait_for_volume_resource_status(self.os_admin.volumes_client,
+ waiters.wait_for_volume_resource_status(self.admin_volumes_client,
new_volume_id, 'available')
self.addCleanup(self.delete_volume,
self.volumes_client, new_volume_id)
def _unmanage_volume(self, volume):
self.volumes_client.unmanage_volume(volume['id'])
- self.volumes_client.wait_for_resource_deletion(volume['id'])
+ self.admin_volumes_client.wait_for_resource_deletion(volume['id'])
@rbac_rule_validation.action(
service="cinder",
diff --git a/patrole_tempest_plugin/tests/api/volume/test_volumes_snapshots_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_volumes_snapshots_rbac.py
index 422a3db..13ced96 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_volumes_snapshots_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_volumes_snapshots_rbac.py
@@ -32,6 +32,11 @@
raise cls.skipException("Cinder volume snapshots are disabled")
@classmethod
+ def setup_clients(cls):
+ super(VolumesSnapshotRbacTest, cls).setup_clients()
+ cls.admin_snapshots_client = cls.os_admin.snapshots_v2_client
+
+ @classmethod
def resource_setup(cls):
super(VolumesSnapshotRbacTest, cls).resource_setup()
# Create a test shared volume for tests
@@ -77,8 +82,7 @@
self.snapshots_client.update_snapshot(
self.snapshot['id'], **params)['snapshot']
waiters.wait_for_volume_resource_status(
- self.os_admin.snapshots_client,
- self.snapshot['id'], 'available')
+ self.admin_snapshots_client, self.snapshot['id'], 'available')
@rbac_rule_validation.action(service="cinder",
rule="volume:get_all_snapshots")
@@ -99,7 +103,7 @@
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
# Delete the snapshot
self.snapshots_client.delete_snapshot(temp_snapshot['id'])
- self.os_admin.snapshots_client.wait_for_resource_deletion(
+ self.admin_snapshots_client.wait_for_resource_deletion(
temp_snapshot['id'])
diff --git a/requirements.txt b/requirements.txt
index 126a3dc..cd6a577 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -7,5 +7,5 @@
oslo.log>=3.22.0 # Apache-2.0
oslo.config!=4.3.0,!=4.4.0,>=4.0.0 # Apache-2.0
oslo.policy>=1.23.0 # Apache-2.0
-tempest>=14.0.0 # Apache-2.0
+tempest>=16.1.0 # Apache-2.0
stevedore>=1.20.0 # Apache-2.0
diff --git a/test-requirements.txt b/test-requirements.txt
index 3e03437..177d0fd 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -13,4 +13,4 @@
oslotest>=1.10.0 # Apache-2.0
oslo.policy>=1.23.0 # Apache-2.0
oslo.log>=3.22.0 # Apache-2.0
-tempest>=14.0.0 # Apache-2.0
+tempest>=16.1.0 # Apache-2.0