Removes client aliases
Removes client aliases from Patrole tests
Change-Id: I4995bb26264f14e98d682ed24fa8f457ad9d04fe
Closes-Bug: #1691528
diff --git a/patrole_tempest_plugin/tests/api/compute/rbac_base.py b/patrole_tempest_plugin/tests/api/compute/rbac_base.py
index ff5b46f..0be42e7 100644
--- a/patrole_tempest_plugin/tests/api/compute/rbac_base.py
+++ b/patrole_tempest_plugin/tests/api/compute/rbac_base.py
@@ -37,6 +37,7 @@
super(BaseV2ComputeRbacTest, cls).setup_clients()
cls.auth_provider = cls.os_primary.auth_provider
cls.rbac_utils = rbac_utils.RbacUtils(cls)
+ cls.hosts_client = cls.os_primary.hosts_client
@classmethod
def resource_setup(cls):
diff --git a/patrole_tempest_plugin/tests/api/compute/test_admin_password_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_admin_password_rbac.py
index 08a06e6..a0e46a6 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_admin_password_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_admin_password_rbac.py
@@ -33,11 +33,6 @@
raise cls.skipException('Change password not available.')
@classmethod
- def setup_clients(cls):
- super(AdminPasswordRbacTest, cls).setup_clients()
- cls.client = cls.servers_client
-
- @classmethod
def resource_setup(cls):
super(AdminPasswordRbacTest, cls).resource_setup()
cls.server_id = cls.create_test_server(wait_until='ACTIVE')['id']
@@ -47,6 +42,6 @@
@decorators.idempotent_id('908a7d59-3a66-441c-94cf-38e57ed14956')
def test_change_server_password(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.change_password(
+ self.servers_client.change_password(
self.server_id,
adminPass=data_utils.rand_password())
diff --git a/patrole_tempest_plugin/tests/api/compute/test_admin_server_actions_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_admin_server_actions_rbac.py
index a2d23af..37fad18 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_admin_server_actions_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_admin_server_actions_rbac.py
@@ -26,11 +26,6 @@
class AdminServerActionsRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(AdminServerActionsRbacTest, cls).setup_clients()
- cls.client = cls.servers_client
-
- @classmethod
def skip_checks(cls):
super(AdminServerActionsRbacTest, cls).skip_checks()
if not test.is_extension_enabled('os-admin-actions', 'compute'):
@@ -48,8 +43,8 @@
@decorators.idempotent_id('ae84dd0b-f364-462e-b565-3457f9c019ef')
def test_reset_server_state(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.reset_state(self.server_id, state='error')
- self.addCleanup(self.client.reset_state,
+ self.servers_client.reset_state(self.server_id, state='error')
+ self.addCleanup(self.servers_client.reset_state,
self.server_id,
state='active')
@@ -59,7 +54,7 @@
@decorators.idempotent_id('ce48c340-51c1-4cff-9b6e-0cc5ef008630')
def test_inject_network_info(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.inject_network_info(self.server_id)
+ self.servers_client.inject_network_info(self.server_id)
@rbac_rule_validation.action(
service="nova",
@@ -67,4 +62,4 @@
@decorators.idempotent_id('2911a242-15c4-4fcb-80d5-80a8930661b0')
def test_reset_network(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.reset_network(self.server_id)
+ self.servers_client.reset_network(self.server_id)
diff --git a/patrole_tempest_plugin/tests/api/compute/test_attach_interfaces_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_attach_interfaces_rbac.py
index 90b60c9..05a41ba 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_attach_interfaces_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_attach_interfaces_rbac.py
@@ -28,11 +28,6 @@
class AttachInterfacesRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(AttachInterfacesRbacTest, cls).setup_clients()
- cls.client = cls.interfaces_client
-
- @classmethod
def skip_checks(cls):
super(AttachInterfacesRbacTest, cls).skip_checks()
if not test.is_extension_enabled('os-attach-interfaces', 'compute'):
@@ -58,14 +53,14 @@
cls.server = cls.create_test_server(wait_until='ACTIVE')
def _attach_interface_to_server(self):
- interface = self.client.create_interface(
+ interface = self.interfaces_client.create_interface(
self.server['id'])['interfaceAttachment']
waiters.wait_for_interface_status(
self.interfaces_client, self.server['id'], interface['port_id'],
'ACTIVE')
self.addCleanup(
test_utils.call_and_ignore_notfound_exc,
- self.client.delete_interface, self.server['id'],
+ self.interfaces_client.delete_interface, self.server['id'],
interface['port_id'])
return interface
@@ -75,7 +70,8 @@
rule="os_compute_api:os-attach-interfaces")
def test_list_interfaces(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_interfaces(self.server['id'])['interfaceAttachments']
+ self.interfaces_client.list_interfaces(
+ self.server['id'])['interfaceAttachments']
@decorators.idempotent_id('d2d3a24d-4738-4bce-a287-36d664746cde')
@rbac_rule_validation.action(
@@ -92,4 +88,5 @@
def test_delete_interface(self):
interface = self._attach_interface_to_server()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_interface(self.server['id'], interface['port_id'])
+ self.interfaces_client.delete_interface(self.server['id'],
+ interface['port_id'])
diff --git a/patrole_tempest_plugin/tests/api/compute/test_availability_zone_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_availability_zone_rbac.py
index 0743d7c..2ce9176 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_availability_zone_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_availability_zone_rbac.py
@@ -28,21 +28,16 @@
"enabled." % cls.__name__)
raise cls.skipException(msg)
- @classmethod
- def setup_clients(cls):
- super(NovaAvailabilityZoneRbacTest, cls).setup_clients()
- cls.client = cls.availability_zone_client
-
@rbac_rule_validation.action(service="nova", rule="os_compute_api:"
"os-availability-zone:list")
@decorators.idempotent_id('cd34e7ea-d26e-4fa3-a8d0-f8883726ce3d')
def test_get_availability_zone_list_rbac(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_availability_zones()
+ self.availability_zone_client.list_availability_zones()
@rbac_rule_validation.action(service="nova", rule="os_compute_api:"
"os-availability-zone:detail")
@decorators.idempotent_id('2f61c191-6ece-4f21-b487-39d749e3d38e')
def test_get_availability_zone_list_detail_rbac(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_availability_zones(detail=True)
+ self.availability_zone_client.list_availability_zones(detail=True)
diff --git a/patrole_tempest_plugin/tests/api/compute/test_deferred_delete_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_deferred_delete_rbac.py
index fe9cb11..ebeab76 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_deferred_delete_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_deferred_delete_rbac.py
@@ -23,11 +23,6 @@
class DeferredDeleteRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(DeferredDeleteRbacTest, cls).setup_clients()
- cls.client = cls.servers_client
-
- @classmethod
def skip_checks(cls):
super(DeferredDeleteRbacTest, cls).skip_checks()
if not test.is_extension_enabled('os-deferred-delete', 'compute'):
@@ -49,4 +44,4 @@
# Force-deleting a server enforces os-deferred-delete according to the
# following API: https://github.com/openstack/nova/blob/master/nova/api
# /openstack/compute/deferred_delete.py
- self.client.force_delete_server(self.server['id'])
+ self.servers_client.force_delete_server(self.server['id'])
diff --git a/patrole_tempest_plugin/tests/api/compute/test_flavor_access_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_flavor_access_rbac.py
index 2019331..b771d32 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_flavor_access_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_flavor_access_rbac.py
@@ -28,11 +28,6 @@
class FlavorAccessRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(FlavorAccessRbacTest, cls).setup_clients()
- cls.client = cls.flavors_client
-
- @classmethod
def skip_checks(cls):
super(FlavorAccessRbacTest, cls).skip_checks()
if not test.is_extension_enabled('OS-FLV-EXT-DATA', 'compute'):
@@ -55,7 +50,7 @@
# NOTE(felipemonteiro): show_flavor enforces the specified policy
# action, but only works if a public flavor is passed.
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_flavor(self.public_flavor_id)['flavor']
+ self.flavors_client.show_flavor(self.public_flavor_id)['flavor']
@decorators.idempotent_id('39cb5c8f-9990-436f-9282-fc76a41d9bac')
@rbac_rule_validation.action(
@@ -63,10 +58,10 @@
rule="os_compute_api:os-flavor-access:add_tenant_access")
def test_add_flavor_access(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.add_flavor_access(
+ self.flavors_client.add_flavor_access(
flavor_id=self.flavor_id, tenant_id=self.tenant_id)[
'flavor_access']
- self.addCleanup(self.client.remove_flavor_access,
+ self.addCleanup(self.flavors_client.remove_flavor_access,
flavor_id=self.flavor_id, tenant_id=self.tenant_id)
@decorators.idempotent_id('61b8621f-52e4-473a-8d07-e228af8853d1')
@@ -74,11 +69,11 @@
service="nova",
rule="os_compute_api:os-flavor-access:remove_tenant_access")
def test_remove_flavor_access(self):
- self.client.add_flavor_access(
+ self.flavors_client.add_flavor_access(
flavor_id=self.flavor_id, tenant_id=self.tenant_id)
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.client.remove_flavor_access,
+ self.flavors_client.remove_flavor_access,
flavor_id=self.flavor_id, tenant_id=self.tenant_id)
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.remove_flavor_access(
+ self.flavors_client.remove_flavor_access(
flavor_id=self.flavor_id, tenant_id=self.tenant_id)
diff --git a/patrole_tempest_plugin/tests/api/compute/test_flavor_extra_specs_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_flavor_extra_specs_rbac.py
index 10e27a8..e59fd78 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_flavor_extra_specs_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_flavor_extra_specs_rbac.py
@@ -25,11 +25,6 @@
class FlavorExtraSpecsRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(FlavorExtraSpecsRbacTest, cls).setup_clients()
- cls.client = cls.flavors_client
-
- @classmethod
def skip_checks(cls):
super(FlavorExtraSpecsRbacTest, cls).skip_checks()
if not test.is_extension_enabled('os-flavor-extra-specs', 'compute'):
@@ -43,19 +38,19 @@
@classmethod
def resource_cleanup(cls):
- cls.client.delete_flavor(cls.flavor['id'])
- cls.client.wait_for_resource_deletion(cls.flavor['id'])
+ cls.flavors_client.delete_flavor(cls.flavor['id'])
+ cls.flavors_client.wait_for_resource_deletion(cls.flavor['id'])
super(FlavorExtraSpecsRbacTest, cls).resource_cleanup()
def _set_flavor_extra_spec(self):
rand_key = data_utils.rand_name(self.__class__.__name__ + '-key')
rand_val = data_utils.rand_name(self.__class__.__name__ + '-val')
specs = {rand_key: rand_val}
- self.client.set_flavor_extra_spec(self.flavor['id'],
- **specs)['extra_specs']
+ self.flavors_client.set_flavor_extra_spec(self.flavor['id'],
+ **specs)['extra_specs']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.client.unset_flavor_extra_spec, self.flavor['id'],
- rand_key)
+ self.flavors_client.unset_flavor_extra_spec,
+ self.flavor['id'], rand_key)
return rand_key
@decorators.idempotent_id('daee891d-dfe9-4501-a39c-29f2371bec3c')
@@ -65,7 +60,7 @@
def test_show_flavor_extra_spec(self):
key = self._set_flavor_extra_spec()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_flavor_extra_spec(self.flavor['id'], key)[key]
+ self.flavors_client.show_flavor_extra_spec(self.flavor['id'], key)[key]
@decorators.idempotent_id('fcffeca2-ed04-4e85-bf93-02fb5643f22b')
@rbac_rule_validation.action(
@@ -83,8 +78,8 @@
key = self._set_flavor_extra_spec()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
update_val = data_utils.rand_name(self.__class__.__name__ + '-val')
- self.client.update_flavor_extra_spec(self.flavor['id'], key,
- **{key: update_val})[key]
+ self.flavors_client.update_flavor_extra_spec(
+ self.flavor['id'], key, **{key: update_val})[key]
@decorators.idempotent_id('4b0e5471-e010-4c09-8965-80898e6760a3')
@rbac_rule_validation.action(
@@ -93,7 +88,7 @@
def test_unset_flavor_extra_spec(self):
key = self._set_flavor_extra_spec()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.unset_flavor_extra_spec(self.flavor['id'], key)
+ self.flavors_client.unset_flavor_extra_spec(self.flavor['id'], key)
@decorators.idempotent_id('02c3831a-3ce9-476e-a722-d805ac2da621')
@rbac_rule_validation.action(
@@ -102,4 +97,5 @@
def test_list_flavor_extra_specs(self):
self._set_flavor_extra_spec()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_flavor_extra_specs(self.flavor['id'])['extra_specs']
+ self.flavors_client.list_flavor_extra_specs(
+ self.flavor['id'])['extra_specs']
diff --git a/patrole_tempest_plugin/tests/api/compute/test_flavor_rxtx_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_flavor_rxtx_rbac.py
index 7f070eb..33b1564 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_flavor_rxtx_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_flavor_rxtx_rbac.py
@@ -23,11 +23,6 @@
class FlavorRxtxRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(FlavorRxtxRbacTest, cls).setup_clients()
- cls.client = cls.flavors_client
-
- @classmethod
def skip_checks(cls):
super(FlavorRxtxRbacTest, cls).skip_checks()
if not test.is_extension_enabled('os-flavor-rxtx', 'compute'):
@@ -41,4 +36,4 @@
def test_create_flavor_rxtx(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
# Enforces os_compute_api:os-flavor-rxtx.
- self.client.list_flavors(detail=True)['flavors']
+ self.flavors_client.list_flavors(detail=True)['flavors']
diff --git a/patrole_tempest_plugin/tests/api/compute/test_floating_ip_pools_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_floating_ip_pools_rbac.py
index 75cc8f4..d44dbac 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_floating_ip_pools_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_floating_ip_pools_rbac.py
@@ -34,7 +34,7 @@
@classmethod
def setup_clients(cls):
super(FloatingIpPoolsRbacTest, cls).setup_clients()
- cls.client = cls.os_primary.floating_ip_pools_client
+ cls.fip_pools_client = cls.os_primary.floating_ip_pools_client
@classmethod
def skip_checks(cls):
@@ -50,4 +50,4 @@
rule="os_compute_api:os-floating-ip-pools")
def test_list_floating_ip_pools(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_floating_ip_pools()['floating_ip_pools']
+ self.fip_pools_client.list_floating_ip_pools()['floating_ip_pools']
diff --git a/patrole_tempest_plugin/tests/api/compute/test_floating_ips_bulk_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_floating_ips_bulk_rbac.py
index bff0612..7adc161 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_floating_ips_bulk_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_floating_ips_bulk_rbac.py
@@ -34,7 +34,7 @@
@classmethod
def setup_clients(cls):
super(FloatingIpsBulkRbacTest, cls).setup_clients()
- cls.client = cls.os_primary.floating_ips_bulk_client
+ cls.fip_bulk_client = cls.os_primary.floating_ips_bulk_client
@classmethod
def skip_checks(cls):
@@ -50,4 +50,4 @@
rule="os_compute_api:os-floating-ips-bulk")
def test_list_floating_ips_bulk(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_floating_ips_bulk()['floating_ip_info']
+ self.fip_bulk_client.list_floating_ips_bulk()['floating_ip_info']
diff --git a/patrole_tempest_plugin/tests/api/compute/test_floating_ips_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_floating_ips_rbac.py
index 0bd00a4..e6de908 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_floating_ips_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_floating_ips_rbac.py
@@ -32,11 +32,6 @@
max_microversion = '2.35'
@classmethod
- def setup_clients(cls):
- super(FloatingIpsRbacTest, cls).setup_clients()
- cls.client = cls.floating_ips_client
-
- @classmethod
def skip_checks(cls):
super(FloatingIpsRbacTest, cls).skip_checks()
if not test.is_extension_enabled('os-floating-ips', 'compute'):
@@ -50,4 +45,4 @@
rule="os_compute_api:os-floating-ips")
def test_list_floating_ips(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_floating_ips()['floating_ips']
+ self.floating_ips_client.list_floating_ips()['floating_ips']
diff --git a/patrole_tempest_plugin/tests/api/compute/test_hosts_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_hosts_rbac.py
index 0b7f2d1..2a6b171 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_hosts_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_hosts_rbac.py
@@ -23,11 +23,6 @@
class HostsRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(HostsRbacTest, cls).setup_clients()
- cls.client = cls.os_primary.hosts_client
-
- @classmethod
def skip_checks(cls):
super(HostsRbacTest, cls).skip_checks()
if not test.is_extension_enabled('os-hosts', 'compute'):
@@ -40,4 +35,4 @@
rule="os_compute_api:os-hosts")
def test_list_hosts(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_hosts()['hosts']
+ self.hosts_client.list_hosts()['hosts']
diff --git a/patrole_tempest_plugin/tests/api/compute/test_hypervisor_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_hypervisor_rbac.py
index ba85b5b..d9e9144 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_hypervisor_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_hypervisor_rbac.py
@@ -31,14 +31,10 @@
raise cls.skipException(msg)
@classmethod
- def setup_clients(cls):
- super(HypervisorRbacTest, cls).setup_clients()
- cls.client = cls.hypervisor_client
-
- @classmethod
def resource_setup(cls):
super(HypervisorRbacTest, cls).resource_setup()
- cls.hypervisor = cls.client.list_hypervisors()['hypervisors'][0]
+ cls.hypervisor =\
+ cls.hypervisor_client.list_hypervisors()['hypervisors'][0]
@decorators.idempotent_id('17bbeb9a-e73e-445f-a771-c794448ef562')
@rbac_rule_validation.action(
@@ -46,7 +42,7 @@
rule="os_compute_api:os-hypervisors")
def test_list_hypervisors(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_hypervisors()['hypervisors']
+ self.hypervisor_client.list_hypervisors()['hypervisors']
@decorators.idempotent_id('8a7f6f9e-34a6-4480-8875-bba566c3a581')
@rbac_rule_validation.action(
@@ -54,7 +50,8 @@
rule="os_compute_api:os-hypervisors")
def test_show_hypervisor(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_hypervisor(self.hypervisor['id'])['hypervisor']
+ self.hypervisor_client.show_hypervisor(
+ self.hypervisor['id'])['hypervisor']
@decorators.idempotent_id('b86f03cf-2e79-4d88-9eea-62f761591413')
@rbac_rule_validation.action(
@@ -62,7 +59,7 @@
rule="os_compute_api:os-hypervisors")
def test_list_servers_on_hypervisor(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_servers_on_hypervisor(
+ self.hypervisor_client.list_servers_on_hypervisor(
self.hypervisor['hypervisor_hostname'])['hypervisors']
@decorators.idempotent_id('ca0e465c-6365-4a7f-ae58-6f8ddbca06c2')
@@ -71,7 +68,8 @@
rule="os_compute_api:os-hypervisors")
def test_show_hypervisor_statistics(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_hypervisor_statistics()['hypervisor_statistics']
+ self.hypervisor_client.\
+ show_hypervisor_statistics()['hypervisor_statistics']
@decorators.idempotent_id('109b37c5-91ba-4da5-b2a2-d7618d84406d')
@rbac_rule_validation.action(
@@ -79,7 +77,8 @@
rule="os_compute_api:os-hypervisors")
def test_show_hypervisor_uptime(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_hypervisor_uptime(self.hypervisor['id'])['hypervisor']
+ self.hypervisor_client.show_hypervisor_uptime(
+ self.hypervisor['id'])['hypervisor']
@decorators.idempotent_id('3dbc71c1-8f04-4674-a67c-dcb2fd99b1b4')
@rbac_rule_validation.action(
@@ -87,5 +86,5 @@
rule="os_compute_api:os-hypervisors")
def test_search_hypervisor(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.search_hypervisor(self.hypervisor['hypervisor_hostname'])[
- 'hypervisors']
+ self.hypervisor_client.search_hypervisor(
+ self.hypervisor['hypervisor_hostname'])['hypervisors']
diff --git a/patrole_tempest_plugin/tests/api/compute/test_images_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_images_rbac.py
index d546911..39a87ed 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_images_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_images_rbac.py
@@ -47,7 +47,6 @@
@classmethod
def setup_clients(cls):
super(ImagesV235RbacTest, cls).setup_clients()
- cls.client = cls.compute_images_client
cls.glance_image_client = cls.os_primary.image_client_v2
@classmethod
@@ -67,7 +66,7 @@
rule="get_images")
def test_list_images(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_images()
+ self.compute_images_client.list_images()
@decorators.idempotent_id('4365ae0f-15ee-4b54-a527-1679faaed140')
@rbac_rule_validation.action(
@@ -75,7 +74,7 @@
rule="get_images")
def test_list_images_with_details(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_images(detail=True)
+ self.compute_images_client.list_images(detail=True)
@decorators.idempotent_id('886dfcae-51bf-4610-9e52-82d7189524c2')
@rbac_rule_validation.action(
@@ -83,19 +82,21 @@
rule="get_image")
def test_show_image_details(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_image(self.image['id'])
+ self.compute_images_client.show_image(self.image['id'])
@decorators.idempotent_id('dbe09d4c-e615-48cb-b908-a06a0f410a8e')
@rbac_rule_validation.action(
service="glance",
rule="get_image")
def test_show_image_metadata_item(self):
- self.client.set_image_metadata(self.image['id'], meta={'foo': 'bar'})
- self.addCleanup(self.client.delete_image_metadata_item,
+ self.compute_images_client.set_image_metadata(self.image['id'],
+ meta={'foo': 'bar'})
+ self.addCleanup(self.compute_images_client.delete_image_metadata_item,
self.image['id'], key='foo')
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_image_metadata_item(self.image['id'], key='foo')
+ self.compute_images_client.show_image_metadata_item(self.image['id'],
+ key='foo')
@decorators.idempotent_id('59f66079-d564-47e8-81b0-03c2e84d339e')
@rbac_rule_validation.action(
@@ -103,7 +104,7 @@
rule="get_image")
def test_list_image_metadata(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_image_metadata(self.image['id'])
+ self.compute_images_client.list_image_metadata(self.image['id'])
@decorators.idempotent_id('5888c7aa-0803-46d4-a3fb-5d4729465cd5')
@rbac_rule_validation.action(
@@ -116,7 +117,7 @@
self.glance_image_client.delete_image, image['id'])
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_image(image['id'])
+ self.compute_images_client.delete_image(image['id'])
@decorators.idempotent_id('575604aa-909f-4b1b-a5a5-cfae1f63044b')
@rbac_rule_validation.action(
@@ -127,9 +128,9 @@
# NOTE(felipemonteiro): Although the name of the client function
# appears wrong, it's actually correct: update_image_metadata does an
# http post.
- self.client.update_image_metadata(self.image['id'],
- meta={'foo': 'bar'})
- self.addCleanup(self.client.delete_image_metadata_item,
+ self.compute_images_client.update_image_metadata(self.image['id'],
+ meta={'foo': 'bar'})
+ self.addCleanup(self.compute_images_client.delete_image_metadata_item,
self.image['id'], key='foo')
@decorators.idempotent_id('fb8c4eb6-00e5-454c-b8bc-0e801ec369f1')
@@ -138,8 +139,9 @@
rule="modify_image")
def test_update_image_metadata(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.set_image_metadata(self.image['id'], meta={'foo': 'bar'})
- self.addCleanup(self.client.delete_image_metadata_item,
+ self.compute_images_client.set_image_metadata(self.image['id'],
+ meta={'foo': 'bar'})
+ self.addCleanup(self.compute_images_client.delete_image_metadata_item,
self.image['id'], key='foo')
@decorators.idempotent_id('9c7c2036-af9b-49a8-8ba1-09b027ee5def')
@@ -148,9 +150,9 @@
rule="modify_image")
def test_update_image_metadata_item(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.set_image_metadata_item(self.image['id'],
- meta={'foo': 'bar'}, key='foo')
- self.addCleanup(self.client.delete_image_metadata_item,
+ self.compute_images_client.set_image_metadata_item(
+ self.image['id'], meta={'foo': 'bar'}, key='foo')
+ self.addCleanup(self.compute_images_client.delete_image_metadata_item,
self.image['id'], key='foo')
@decorators.idempotent_id('5f0dc4e6-0761-4613-9bde-0a6acdc78f46')
@@ -158,10 +160,12 @@
service="glance",
rule="modify_image")
def test_delete_image_metadata_item(self):
- self.client.set_image_metadata(self.image['id'], meta={'foo': 'bar'})
+ self.compute_images_client.set_image_metadata(self.image['id'],
+ meta={'foo': 'bar'})
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.client.delete_image_metadata_item,
+ self.compute_images_client.delete_image_metadata_item,
self.image['id'], key='foo')
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_image_metadata_item(self.image['id'], key='foo')
+ self.compute_images_client.delete_image_metadata_item(self.image['id'],
+ key='foo')
diff --git a/patrole_tempest_plugin/tests/api/compute/test_instance_actions_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_instance_actions_rbac.py
index bd1e5c8..b81d2ab 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_instance_actions_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_instance_actions_rbac.py
@@ -24,11 +24,6 @@
class InstanceActionsRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(InstanceActionsRbacTest, cls).setup_clients()
- cls.client = cls.servers_client
-
- @classmethod
def skip_checks(cls):
super(InstanceActionsRbacTest, cls).skip_checks()
if not test.is_extension_enabled('os-instance-actions', 'compute'):
@@ -47,7 +42,7 @@
rule="os_compute_api:os-instance-actions")
def test_list_instance_actions(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_instance_actions(self.server['id'])
+ self.servers_client.list_instance_actions(self.server['id'])
@decorators.idempotent_id('eb04c439-4215-4029-9ccb-5b3c041bfc25')
@rbac_rule_validation.action(
@@ -55,7 +50,7 @@
rule="os_compute_api:os-instance-actions:events")
def test_get_instance_action(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- instance_action = self.client.show_instance_action(
+ instance_action = self.servers_client.show_instance_action(
self.server['id'], self.request_id)['instanceAction']
if 'events' not in instance_action:
raise rbac_exceptions.RbacActionFailed
diff --git a/patrole_tempest_plugin/tests/api/compute/test_instance_usages_audit_log_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_instance_usages_audit_log_rbac.py
index cff3167..e55e306 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_instance_usages_audit_log_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_instance_usages_audit_log_rbac.py
@@ -31,15 +31,10 @@
msg = "os-instance-usage-audit-log extension not enabled."
raise cls.skipException(msg)
- @classmethod
- def setup_clients(cls):
- super(InstanceUsagesAuditLogRbacTest, cls).setup_clients()
- cls.client = cls.instance_usages_audit_log_client
-
@decorators.idempotent_id('c80246c0-5c13-4ab0-97ba-91551cd53dc1')
@rbac_rule_validation.action(
service="nova", rule="os_compute_api:os-instance-usage-audit-log")
def test_list_instance_usage_audit_logs(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_instance_usage_audit_logs()
+ self.instance_usages_audit_log_client.list_instance_usage_audit_logs()
["instance_usage_audit_logs"]
diff --git a/patrole_tempest_plugin/tests/api/compute/test_ips_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_ips_rbac.py
index 600cfbe..c42459a 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_ips_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_ips_rbac.py
@@ -26,11 +26,6 @@
class IpsRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(IpsRbacTest, cls).setup_clients()
- cls.client = cls.servers_client
-
- @classmethod
def skip_checks(cls):
super(IpsRbacTest, cls).skip_checks()
if not test.is_extension_enabled('os-ips', 'compute'):
@@ -56,15 +51,16 @@
rule="os_compute_api:ips:index")
def test_list_addresses(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_addresses(self.server['id'])['addresses']
+ self.servers_client.list_addresses(self.server['id'])['addresses']
@decorators.idempotent_id('fa43e7e5-0db9-48eb-9c6b-c11eb766b8e4')
@rbac_rule_validation.action(
service="nova",
rule="os_compute_api:ips:show")
def test_list_addresses_by_network(self):
- addresses = self.client.list_addresses(self.server['id'])['addresses']
+ addresses = self.servers_client.list_addresses(
+ self.server['id'])['addresses']
address = next(iter(addresses))
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_addresses_by_network(
+ self.servers_client.list_addresses_by_network(
self.server['id'], address)[address]
diff --git a/patrole_tempest_plugin/tests/api/compute/test_keypairs_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_keypairs_rbac.py
index a93d807..8e434fc 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_keypairs_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_keypairs_rbac.py
@@ -23,16 +23,11 @@
class KeypairsRbacTest(rbac_base.BaseV2ComputeRbacTest):
- @classmethod
- def setup_clients(cls):
- super(KeypairsRbacTest, cls).setup_clients()
- cls.client = cls.keypairs_client
-
def _create_keypair(self):
key_name = data_utils.rand_name(self.__class__.__name__ + '-key')
- keypair = self.client.create_keypair(name=key_name)
+ keypair = self.keypairs_client.create_keypair(name=key_name)
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.client.delete_keypair,
+ self.keypairs_client.delete_keypair,
key_name)
return keypair
@@ -51,7 +46,7 @@
def test_show_keypair(self):
kp_name = self._create_keypair()['keypair']['name']
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_keypair(kp_name)
+ self.keypairs_client.show_keypair(kp_name)
@decorators.idempotent_id('6bff9f1c-b809-43c1-8d63-61fbd19d49d3')
@rbac_rule_validation.action(
@@ -60,7 +55,7 @@
def test_delete_keypair(self):
kp_name = self._create_keypair()['keypair']['name']
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_keypair(kp_name)
+ self.keypairs_client.delete_keypair(kp_name)
@decorators.idempotent_id('6bb31346-ff7f-4b10-978e-170ac5fcfa3e')
@rbac_rule_validation.action(
@@ -68,4 +63,4 @@
rule="os_compute_api:os-keypairs:index")
def test_index_keypair(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_keypairs()
+ self.keypairs_client.list_keypairs()
diff --git a/patrole_tempest_plugin/tests/api/compute/test_limits_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_limits_rbac.py
index f16a635..2f19d13 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_limits_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_limits_rbac.py
@@ -21,11 +21,6 @@
class LimitsRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(LimitsRbacTest, cls).setup_clients()
- cls.client = cls.limits_client
-
- @classmethod
def skip_checks(cls):
super(LimitsRbacTest, cls).skip_checks()
if not test.is_extension_enabled('os-limits', 'compute'):
@@ -37,4 +32,4 @@
@decorators.idempotent_id('3fb60f83-9a5f-4fdd-89d9-26c3710844a1')
def test_show_limits(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_limits()
+ self.limits_client.show_limits()
diff --git a/patrole_tempest_plugin/tests/api/compute/test_migrations_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_migrations_rbac.py
index b6c6c5f..dc2bdf6 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_migrations_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_migrations_rbac.py
@@ -23,11 +23,6 @@
class MigrationsRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(MigrationsRbacTest, cls).setup_clients()
- cls.client = cls.migrations_client
-
- @classmethod
def skip_checks(cls):
super(MigrationsRbacTest, cls).skip_checks()
if not test.is_extension_enabled('os-migrations', 'compute'):
@@ -40,4 +35,4 @@
rule="os_compute_api:os-migrations:index")
def test_list_services(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_migrations()['migrations']
+ self.migrations_client.list_migrations()['migrations']
diff --git a/patrole_tempest_plugin/tests/api/compute/test_multinic_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_multinic_rbac.py
index 7e353be..ca0ee26 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_multinic_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_multinic_rbac.py
@@ -28,11 +28,6 @@
max_microversion = '2.36'
@classmethod
- def setup_clients(cls):
- super(MultinicV210RbacTest, cls).setup_clients()
- cls.client = cls.servers_client
-
- @classmethod
def skip_checks(cls):
super(MultinicV210RbacTest, cls).skip_checks()
if not CONF.service_available.neutron:
@@ -65,5 +60,5 @@
self.server['id'])['interfaceAttachment']['net_id']
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.add_fixed_ip(self.server['id'],
- networkId=network_id)
+ self.servers_client.add_fixed_ip(self.server['id'],
+ networkId=network_id)
diff --git a/patrole_tempest_plugin/tests/api/compute/test_quota_sets_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_quota_sets_rbac.py
index 8e90880..dc30d94 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_quota_sets_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_quota_sets_rbac.py
@@ -27,7 +27,6 @@
@classmethod
def setup_clients(cls):
super(QuotaSetsRbacTest, cls).setup_clients()
- cls.client = cls.quotas_client
cls.projects_client = cls.os_primary.projects_client
@classmethod
@@ -55,16 +54,16 @@
service="nova",
rule="os_compute_api:os-quota-sets:update")
def test_update_quota_set(self):
- default_quota_set = self.client.show_default_quota_set(
+ default_quota_set = self.quotas_client.show_default_quota_set(
self.tenant_id)['quota_set']
default_quota_set.pop('id')
new_quota_set = {'injected_file_content_bytes': 20480}
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.update_quota_set(self.tenant_id,
- force=True,
- **new_quota_set)['quota_set']
- self.addCleanup(self.client.update_quota_set, self.tenant_id,
+ self.quotas_client.update_quota_set(self.tenant_id,
+ force=True,
+ **new_quota_set)['quota_set']
+ self.addCleanup(self.quotas_client.update_quota_set, self.tenant_id,
**default_quota_set)
@decorators.idempotent_id('58df5613-8f3c-400a-8b4b-2bae624d05e9')
@@ -73,7 +72,7 @@
rule="os_compute_api:os-quota-sets:defaults")
def test_show_default_quota_set(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_default_quota_set(self.tenant_id)['quota_set']
+ self.quotas_client.show_default_quota_set(self.tenant_id)['quota_set']
@decorators.idempotent_id('e8169ac4-c402-4864-894e-aba74e3a459c')
@rbac_rule_validation.action(
@@ -81,7 +80,7 @@
rule="os_compute_api:os-quota-sets:show")
def test_show_quota_set(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_quota_set(self.tenant_id)['quota_set']
+ self.quotas_client.show_quota_set(self.tenant_id)['quota_set']
@decorators.idempotent_id('4e240644-bf61-4872-9c32-8289ee2fdbbd')
@rbac_rule_validation.action(
@@ -96,7 +95,7 @@
self.projects_client.delete_project, project_id)
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_quota_set(project_id)
+ self.quotas_client.delete_quota_set(project_id)
@decorators.idempotent_id('ac9184b6-f3b3-4e17-a632-4b92c6500f86')
@rbac_rule_validation.action(
@@ -104,4 +103,5 @@
rule="os_compute_api:os-quota-sets:detail")
def test_show_quota_set_details(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_quota_set(self.tenant_id, detail=True)['quota_set']
+ self.quotas_client.show_quota_set(self.tenant_id,
+ detail=True)['quota_set']
diff --git a/patrole_tempest_plugin/tests/api/compute/test_rescue_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_rescue_rbac.py
index 277ba1b..a0a021f 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_rescue_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_rescue_rbac.py
@@ -23,11 +23,6 @@
class RescueRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(RescueRbacTest, cls).setup_clients()
- cls.client = cls.servers_client
-
- @classmethod
def skip_checks(cls):
super(RescueRbacTest, cls).skip_checks()
if not test.is_extension_enabled('os-rescue', 'compute'):
@@ -45,4 +40,4 @@
@decorators.idempotent_id('fbbb2afc-ed0e-4552-887d-ac00fb5d436e')
def test_rescue_server(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.rescue_server(self.server['id'])
+ self.servers_client.rescue_server(self.server['id'])
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_actions_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_actions_rbac.py
index 86b650e..a3197b3 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_actions_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_actions_rbac.py
@@ -35,12 +35,6 @@
class ServerActionsRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(ServerActionsRbacTest, cls).setup_clients()
- cls.client = cls.servers_client
- cls.snapshots_client = cls.snapshots_extensions_client
-
- @classmethod
def resource_setup(cls):
cls.set_validation_resources()
super(ServerActionsRbacTest, cls).resource_setup()
@@ -69,7 +63,7 @@
def setUp(self):
super(ServerActionsRbacTest, self).setUp()
try:
- waiters.wait_for_server_status(self.client,
+ waiters.wait_for_server_status(self.servers_client,
self.server_id, 'ACTIVE')
except lib_exc.NotFound:
# if the server was found to be deleted by a previous test,
@@ -99,14 +93,17 @@
# Wait for snapshot status to become 'available' before
# deletion
waiters.wait_for_volume_resource_status(
- cls.snapshots_client, snapshot['id'], 'available')
+ cls.snapshots_extensions_client, snapshot['id'],
+ 'available')
test_utils.call_and_ignore_notfound_exc(
- cls.snapshots_client.delete_snapshot, snapshot['id'])
+ cls.snapshots_extensions_client.delete_snapshot,
+ snapshot['id'])
for snapshot in volume_snapshots:
if snapshot['volumeId'] == cls.volume_id:
test_utils.call_and_ignore_notfound_exc(
- cls.snapshots_client.wait_for_resource_deletion,
+ (cls.snapshots_extensions_client.
+ wait_for_resource_deletion),
snapshot['id'])
super(ServerActionsRbacTest, cls).resource_cleanup()
@@ -123,39 +120,40 @@
# Since the server is booted from volume, the imageRef does not need
# to be specified.
- server = self.client.create_server(name=server_name,
- imageRef='',
- flavorRef=CONF.compute.flavor_ref,
- **device_mapping)['server']
+ server = self.servers_client.create_server(
+ name=server_name, imageRef='',
+ flavorRef=CONF.compute.flavor_ref,
+ **device_mapping)['server']
- waiters.wait_for_server_status(self.client, server['id'], 'ACTIVE')
+ waiters.wait_for_server_status(self.servers_client, server['id'],
+ 'ACTIVE')
self.servers.append(server)
return server
def _test_start_server(self):
- self.client.start_server(self.server_id)
- waiters.wait_for_server_status(self.client, self.server_id,
+ self.servers_client.start_server(self.server_id)
+ waiters.wait_for_server_status(self.servers_client, self.server_id,
'ACTIVE')
def _test_stop_server(self):
- self.client.stop_server(self.server_id)
- waiters.wait_for_server_status(self.client, self.server_id,
+ self.servers_client.stop_server(self.server_id)
+ waiters.wait_for_server_status(self.servers_client, self.server_id,
'SHUTOFF')
def _test_resize_server(self, flavor):
- self.client.resize_server(self.server_id, flavor)
- waiters.wait_for_server_status(self.client, self.server_id,
+ self.servers_client.resize_server(self.server_id, flavor)
+ waiters.wait_for_server_status(self.servers_client, self.server_id,
'VERIFY_RESIZE')
def _test_revert_resize_server(self):
- self.client.revert_resize_server(self.server_id)
- waiters.wait_for_server_status(self.client, self.server_id,
+ self.servers_client.revert_resize_server(self.server_id)
+ waiters.wait_for_server_status(self.servers_client, self.server_id,
'ACTIVE')
def _test_confirm_resize_server(self):
- self.client.confirm_resize_server(self.server_id)
- waiters.wait_for_server_status(self.client, self.server_id,
+ self.servers_client.confirm_resize_server(self.server_id)
+ waiters.wait_for_server_status(self.servers_client, self.server_id,
'ACTIVE')
@rbac_rule_validation.action(
@@ -221,8 +219,8 @@
@decorators.idempotent_id('54b1a30b-c96c-472c-9c83-ccaf6ec7e20b')
def test_rebuild_server(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.rebuild_server(self.server_id, self.image_ref)
- waiters.wait_for_server_status(self.client, self.server_id,
+ self.servers_client.rebuild_server(self.server_id, self.image_ref)
+ waiters.wait_for_server_status(self.servers_client, self.server_id,
'ACTIVE')
@rbac_rule_validation.action(
@@ -231,8 +229,8 @@
@decorators.idempotent_id('19f27856-56e1-44f8-8615-7257f6b85cbb')
def test_reboot_server(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.reboot_server(self.server_id, type='HARD')
- waiters.wait_for_server_status(self.client, self.server_id,
+ self.servers_client.reboot_server(self.server_id, type='HARD')
+ waiters.wait_for_server_status(self.servers_client, self.server_id,
'ACTIVE')
@rbac_rule_validation.action(
@@ -241,7 +239,7 @@
@decorators.idempotent_id('631f0d86-7607-4198-8312-9da2f05464a4')
def test_server_index(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_servers(minimal=True)
+ self.servers_client.list_servers(minimal=True)
@rbac_rule_validation.action(
service="nova",
@@ -249,7 +247,7 @@
@decorators.idempotent_id('96093480-3ce5-4a8b-b569-aed870379c24')
def test_server_detail(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_servers(detail=True)
+ self.servers_client.list_servers(detail=True)
@rbac_rule_validation.action(
service="nova",
@@ -257,7 +255,7 @@
@decorators.idempotent_id('a9e5a1c0-acfe-49a2-b2b1-fd8b19d61f71')
def test_server_detail_all_tenants(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_servers(detail=True, all_tenants=1)
+ self.servers_client.list_servers(detail=True, all_tenants=1)
@rbac_rule_validation.action(
service="nova",
@@ -265,7 +263,7 @@
@decorators.idempotent_id('4b93ba56-69e6-41f5-82c4-84a5c4c42091')
def test_server_index_all_tenants(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_servers(minimal=True, all_tenants=1)
+ self.servers_client.list_servers(minimal=True, all_tenants=1)
@rbac_rule_validation.action(
service="nova",
@@ -273,7 +271,7 @@
@decorators.idempotent_id('eaaf4f51-31b5-497f-8f0f-f527e5f70b83')
def test_show_server(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_server(self.server_id)
+ self.servers_client.show_server(self.server_id)
@rbac_rule_validation.action(
service="nova",
@@ -322,7 +320,7 @@
def setUp(self):
super(ServerActionsV216RbacTest, self).setUp()
try:
- waiters.wait_for_server_status(self.client,
+ waiters.wait_for_server_status(self.servers_client,
self.server_id, 'ACTIVE')
except lib_exc.NotFound:
# if the server was found to be deleted by a previous test,
@@ -342,7 +340,7 @@
@decorators.idempotent_id('736da575-86f8-4b2a-9902-dd37dc9a409b')
def test_show_server_host_status(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- server = self.client.show_server(self.server_id)['server']
+ server = self.servers_client.show_server(self.server_id)['server']
if 'host_status' not in server:
LOG.info("host_status attribute not returned when role doesn't "
@@ -374,6 +372,6 @@
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
self.assertRaisesRegex(lib_exc.NotFound,
"Compute host fake-host not found.",
- self.client.evacuate_server,
+ self.servers_client.evacuate_server,
self.server_id,
host='fake-host')
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_diagnostics_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_diagnostics_rbac.py
index 2a309e3..f6359b4 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_diagnostics_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_diagnostics_rbac.py
@@ -23,11 +23,6 @@
class ServerDiagnosticsRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(ServerDiagnosticsRbacTest, cls).setup_clients()
- cls.client = cls.servers_client
-
- @classmethod
def skip_checks(cls):
super(ServerDiagnosticsRbacTest, cls).skip_checks()
if not test.is_extension_enabled('os-server-diagnostics', 'compute'):
@@ -46,4 +41,4 @@
@decorators.idempotent_id('5dabfcc4-bedb-417b-8247-b3ee7c5c0f3e')
def test_show_server_diagnostics(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_server_diagnostics(self.server['id'])
+ self.servers_client.show_server_diagnostics(self.server['id'])
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_groups_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_groups_rbac.py
index a75f550..ff79684 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_groups_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_groups_rbac.py
@@ -23,11 +23,6 @@
class ServerGroupsRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(ServerGroupsRbacTest, cls).setup_clients()
- cls.client = cls.server_groups_client
-
- @classmethod
def skip_checks(cls):
super(ServerGroupsRbacTest, cls).skip_checks()
if not test.is_extension_enabled('os-server-groups', 'compute'):
@@ -54,7 +49,7 @@
def test_delete_server_group(self):
server_group = self.create_test_server_group()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_server_group(server_group['id'])
+ self.server_groups_client.delete_server_group(server_group['id'])
@rbac_rule_validation.action(
service="nova",
@@ -62,7 +57,7 @@
@decorators.idempotent_id('5eccd67f-5945-483b-b1c8-de851ebfc1c1')
def test_list_server_groups(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_server_groups()
+ self.server_groups_client.list_server_groups()
@rbac_rule_validation.action(
service="nova",
@@ -71,4 +66,4 @@
def test_show_server_group(self):
server_group = self.create_test_server_group()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_server_group(server_group['id'])
+ self.server_groups_client.show_server_group(server_group['id'])
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_migrations_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_migrations_rbac.py
index 38ef552..842d8b1 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_migrations_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_migrations_rbac.py
@@ -34,7 +34,6 @@
@classmethod
def skip_checks(cls):
super(MigrateServerV225RbacTest, cls).skip_checks()
-
if CONF.compute.min_compute_nodes < 2:
raise cls.skipException(
"Less than 2 compute nodes, skipping migration tests.")
@@ -42,12 +41,10 @@
@classmethod
def setup_clients(cls):
super(MigrateServerV225RbacTest, cls).setup_clients()
- cls.client = cls.servers_client
cls.admin_servers_client = cls.os_admin.servers_client
- cls.hosts_client = cls.os_primary.hosts_client
def _get_server_details(self, server_id):
- body = self.client.show_server(server_id)['server']
+ body = self.servers_client.show_server(server_id)['server']
return body
def _get_host_for_server(self, server_id):
@@ -76,7 +73,7 @@
def test_cold_migration(self):
server = self.create_test_server(wait_until="ACTIVE")
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.migrate_server(server['id'])
+ self.servers_client.migrate_server(server['id'])
waiters.wait_for_server_status(self.admin_servers_client,
server['id'], 'VERIFY_RESIZE')
@@ -94,7 +91,7 @@
target_host = self._get_host_other_than(actual_host)
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.live_migrate_server(
+ self.servers_client.live_migrate_server(
server_id, host=target_host, block_migration=self.block_migration)
waiters.wait_for_server_status(self.admin_servers_client,
server_id, "ACTIVE")
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_password_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_password_rbac.py
index 0a0a660..7826268 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_password_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_password_rbac.py
@@ -23,11 +23,6 @@
class ServerPasswordRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(ServerPasswordRbacTest, cls).setup_clients()
- cls.client = cls.servers_client
-
- @classmethod
def skip_checks(cls):
super(ServerPasswordRbacTest, cls).skip_checks()
if not test.is_extension_enabled('os-server-password', 'compute'):
@@ -46,7 +41,7 @@
rule="os_compute_api:os-server-password")
def test_delete_server_password(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_password(self.server['id'])
+ self.servers_client.delete_password(self.server['id'])
@rbac_rule_validation.action(
service="nova",
@@ -54,4 +49,4 @@
@decorators.idempotent_id('f677971a-7d20-493c-977f-6ff0a74b5b2c')
def test_get_server_password(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_password(self.server['id'])
+ self.servers_client.show_password(self.server['id'])
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_rbac.py
index 7d715ca..3613a25 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_rbac.py
@@ -95,12 +95,13 @@
# Since the server is booted from volume, the imageRef does not need
# to be specified.
- server = self.client.create_server(name=server_name,
- imageRef='',
- flavorRef=CONF.compute.flavor_ref,
- **device_mapping)['server']
+ server = self.servers_client.create_server(
+ name=server_name, imageRef='',
+ flavorRef=CONF.compute.flavor_ref,
+ **device_mapping)['server']
- waiters.wait_for_server_status(self.client, server['id'], 'ACTIVE')
+ waiters.wait_for_server_status(self.servers_client, server['id'],
+ 'ACTIVE')
self.servers.append(server)
return server
@@ -155,8 +156,8 @@
# clean them up after this test case. In order to do that,
# we need to clean up the server first.
self.addCleanup(waiters.wait_for_server_termination,
- self.client, server['id'])
- self.addCleanup(self.client.delete_server, server['id'])
+ self.servers_client, server['id'])
+ self.addCleanup(self.servers_client.delete_server, server['id'])
@rbac_rule_validation.action(
service="nova",
@@ -165,8 +166,8 @@
def test_delete_server(self):
server = self.create_test_server(wait_until='ACTIVE')
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_server(server['id'])
- waiters.wait_for_server_termination(self.client, server['id'])
+ self.servers_client.delete_server(server['id'])
+ waiters.wait_for_server_termination(self.servers_client, server['id'])
@rbac_rule_validation.action(
service="nova",
@@ -177,7 +178,7 @@
new_name = data_utils.rand_name(self.__class__.__name__ + '-server')
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
try:
- self.client.update_server(server['id'], name=new_name)
+ self.servers_client.update_server(server['id'], name=new_name)
except exceptions.ServerFault as e:
# Some other policy may have blocked it.
LOG.info("ServerFault exception caught. Some other policy "
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_tags_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_tags_rbac.py
index 19aa36a..d3576d6 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_tags_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_tags_rbac.py
@@ -34,19 +34,14 @@
raise cls.skipException(msg)
@classmethod
- def setup_clients(cls):
- super(ServerTagsRbacTest, cls).setup_clients()
- cls.client = cls.servers_client
-
- @classmethod
def resource_setup(cls):
super(ServerTagsRbacTest, cls).resource_setup()
cls.server = cls.create_test_server(wait_until='ACTIVE')
def _add_tag_to_server(self):
tag_name = data_utils.rand_name(self.__class__.__name__ + '-tag')
- self.client.update_tag(self.server['id'], tag_name)
- self.addCleanup(self.client.delete_all_tags, self.server['id'])
+ self.servers_client.update_tag(self.server['id'], tag_name)
+ self.addCleanup(self.servers_client.delete_all_tags, self.server['id'])
return tag_name
@decorators.idempotent_id('99e73dd3-adec-4044-b46c-84bdded35d09')
@@ -55,7 +50,7 @@
rule="os_compute_api:os-server-tags:index")
def test_list_tags(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_tags(self.server['id'])['tags']
+ self.servers_client.list_tags(self.server['id'])['tags']
@decorators.idempotent_id('9297c99e-94eb-429f-93cf-9b1838e33622')
@rbac_rule_validation.action(
@@ -64,7 +59,7 @@
def test_check_tag_existence(self):
tag_name = self._add_tag_to_server()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.check_tag_existence(self.server['id'], tag_name)
+ self.servers_client.check_tag_existence(self.server['id'], tag_name)
@decorators.idempotent_id('0d84ee94-d3ca-4635-8edf-b7f67ab8e4a3')
@rbac_rule_validation.action(
@@ -81,7 +76,7 @@
def test_delete_tag(self):
tag_name = self._add_tag_to_server()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_tag(self.server['id'], tag_name)
+ self.servers_client.delete_tag(self.server['id'], tag_name)
@decorators.idempotent_id('a8e19b87-6580-4bc8-9933-e62561ff667d')
@rbac_rule_validation.action(
@@ -90,7 +85,8 @@
def test_update_all_tags(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
new_tag_name = data_utils.rand_name(self.__class__.__name__ + '-tag')
- self.client.update_all_tags(self.server['id'], [new_tag_name])['tags']
+ self.servers_client.update_all_tags(self.server['id'],
+ [new_tag_name])['tags']
@decorators.idempotent_id('89d51936-e333-42f9-a045-132a4865ba1a')
@rbac_rule_validation.action(
@@ -98,4 +94,4 @@
rule="os_compute_api:os-server-tags:delete_all")
def test_delete_all_tags(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_all_tags(self.server['id'])
+ self.servers_client.delete_all_tags(self.server['id'])
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_usage_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_usage_rbac.py
index 8f836a6..777af29 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_usage_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_usage_rbac.py
@@ -23,11 +23,6 @@
class ServerUsageRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(ServerUsageRbacTest, cls).setup_clients()
- cls.client = cls.servers_client
-
- @classmethod
def skip_checks(cls):
super(ServerUsageRbacTest, cls).skip_checks()
if not test.is_extension_enabled('OS-SRV-USG', 'compute'):
@@ -45,4 +40,4 @@
@decorators.idempotent_id('f0437ead-b9fb-462a-9f3d-ce53fac9d57a')
def test_show_server_diagnostics(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_server(self.server['id'])
+ self.servers_client.show_server(self.server['id'])
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_virtual_interfaces_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_virtual_interfaces_rbac.py
index a0a000c..1480444 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_virtual_interfaces_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_virtual_interfaces_rbac.py
@@ -25,11 +25,6 @@
class ServerVirtualInterfacesRbacTest(base.BaseV2ComputeRbacTest):
- @classmethod
- def setup_clients(cls):
- super(ServerVirtualInterfacesRbacTest, cls).setup_clients()
- cls.client = cls.servers_client
-
@rbac_rule_validation.action(
service="nova",
rule="os_compute_api:os-virtual-interfaces")
@@ -41,6 +36,6 @@
if CONF.service_available.neutron:
msg = "Listing virtual interfaces is not supported by this cloud."
with self.assertRaisesRegex(exceptions.BadRequest, msg):
- self.client.list_virtual_interfaces(server['id'])
+ self.servers_client.list_virtual_interfaces(server['id'])
else:
- self.client.list_virtual_interfaces(server['id'])
+ self.servers_client.list_virtual_interfaces(server['id'])
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 160affd..98dbee5 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,6 @@
@classmethod
def setup_clients(cls):
super(ServerVolumeAttachmentRbacTest, cls).setup_clients()
- cls.client = cls.servers_client
cls.volumes_client = cls.os_primary.volumes_client
@classmethod
@@ -52,7 +51,7 @@
@decorators.idempotent_id('529b668b-6edb-41d5-8886-d7dbd0614678')
def test_list_volume_attachments(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_volume_attachments(self.server['id'])[
+ self.servers_client.list_volume_attachments(self.server['id'])[
'volumeAttachments']
@rbac_rule_validation.action(
@@ -70,7 +69,7 @@
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.client.show_volume_attachment(
+ self.servers_client.show_volume_attachment(
self.server['id'], attachment['id'])
@test.attr(type='slow')
@@ -82,7 +81,7 @@
attachment = self.attach_volume(self.server, self.volume)
alt_volume = self.create_volume()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.update_attached_volume(
+ self.servers_client.update_attached_volume(
self.server['id'], attachment['id'], volumeId=alt_volume['id'])
waiters.wait_for_volume_resource_status(self.volumes_client,
alt_volume['id'], 'in-use')
@@ -104,6 +103,6 @@
def test_delete_volume_attachment(self):
self.attach_volume(self.server, self.volume)
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.detach_volume(self.server['id'], self.volume['id'])
+ self.servers_client.detach_volume(self.server['id'], self.volume['id'])
waiters.wait_for_volume_resource_status(self.volumes_client,
self.volume['id'], 'available')
diff --git a/patrole_tempest_plugin/tests/api/compute/test_services_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_services_rbac.py
index 82de5a3..94d094c 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_services_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_services_rbac.py
@@ -23,11 +23,6 @@
class ServicesRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(ServicesRbacTest, cls).setup_clients()
- cls.client = cls.services_client
-
- @classmethod
def skip_checks(cls):
super(ServicesRbacTest, cls).skip_checks()
if not test.is_extension_enabled('os-services', 'compute'):
@@ -40,4 +35,4 @@
@decorators.idempotent_id('7472261b-9c6d-453a-bcb3-aecaa29ad281')
def test_list_services(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_services()['services']
+ self.services_client.list_services()['services']
diff --git a/patrole_tempest_plugin/tests/api/compute/test_simple_tenant_usage_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_simple_tenant_usage_rbac.py
index 5ecc32a..ae2a0fd 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_simple_tenant_usage_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_simple_tenant_usage_rbac.py
@@ -25,7 +25,7 @@
@classmethod
def setup_clients(cls):
super(SimpleTenantUsageRbacTest, cls).setup_clients()
- cls.client = cls.os_primary.tenant_usages_client
+ cls.tenant_usages_client = cls.os_primary.tenant_usages_client
@classmethod
def skip_checks(cls):
@@ -41,7 +41,7 @@
@decorators.idempotent_id('2aef094f-0452-4df6-a66a-0ec22a92b16e')
def test_simple_tenant_usage_list(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_tenant_usages()
+ self.tenant_usages_client.list_tenant_usages()
@rbac_rule_validation.action(
service="nova",
@@ -53,4 +53,4 @@
self.create_test_server(wait_until='ACTIVE')['id']
tenant_id = self.auth_provider.credentials.tenant_id
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_tenant_usage(tenant_id=tenant_id)
+ self.tenant_usages_client.show_tenant_usage(tenant_id=tenant_id)
diff --git a/patrole_tempest_plugin/tests/api/compute/test_suspend_server_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_suspend_server_rbac.py
index 8106a1a..64ffea6 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_suspend_server_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_suspend_server_rbac.py
@@ -26,11 +26,6 @@
class SuspendServerRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
- def setup_clients(cls):
- super(SuspendServerRbacTest, cls).setup_clients()
- cls.client = cls.servers_client
-
- @classmethod
def skip_checks(cls):
super(SuspendServerRbacTest, cls).skip_checks()
if not CONF.compute_feature_enabled.suspend:
@@ -45,11 +40,12 @@
def tearDown(self):
# Guarantee that the server is active during each test run.
- vm_state = self.client.show_server(self.server['id'])['server'][
- 'OS-EXT-STS:vm_state'].upper()
+ vm_state = self.servers_client.show_server(
+ self.server['id'])['server']['OS-EXT-STS:vm_state'].upper()
if vm_state != 'ACTIVE':
- self.client.resume_server(self.server['id'])
- waiters.wait_for_server_status(self.client, self.server['id'],
+ self.servers_client.resume_server(self.server['id'])
+ waiters.wait_for_server_status(self.servers_client,
+ self.server['id'],
'ACTIVE')
super(SuspendServerRbacTest, self).tearDown()
@@ -60,8 +56,8 @@
rule="os_compute_api:os-suspend-server:suspend")
def test_suspend_server(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.suspend_server(self.server['id'])
- waiters.wait_for_server_status(self.client, self.server['id'],
+ self.servers_client.suspend_server(self.server['id'])
+ waiters.wait_for_server_status(self.servers_client, self.server['id'],
'SUSPENDED')
@decorators.idempotent_id('4d90bd02-11f8-45b1-a8a1-534665584675')
@@ -69,11 +65,11 @@
service="nova",
rule="os_compute_api:os-suspend-server:resume")
def test_resume_server(self):
- self.client.suspend_server(self.server['id'])
- waiters.wait_for_server_status(self.client, self.server['id'],
+ self.servers_client.suspend_server(self.server['id'])
+ waiters.wait_for_server_status(self.servers_client, self.server['id'],
'SUSPENDED')
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.resume_server(self.server['id'])
- waiters.wait_for_server_status(self.client,
+ self.servers_client.resume_server(self.server['id'])
+ waiters.wait_for_server_status(self.servers_client,
self.server['id'],
'ACTIVE')
diff --git a/patrole_tempest_plugin/tests/api/compute/test_tenant_networks_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_tenant_networks_rbac.py
index ee2b9a2..9313943 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_tenant_networks_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_tenant_networks_rbac.py
@@ -35,7 +35,7 @@
@classmethod
def setup_clients(cls):
super(TenantNetworksRbacTest, cls).setup_clients()
- cls.client = cls.os_primary.tenant_networks_client
+ cls.tenant_networks_client = cls.os_primary.tenant_networks_client
@classmethod
def skip_checks(cls):
@@ -58,4 +58,4 @@
rule="os_compute_api:os-tenant-networks")
def test_list_show_tenant_networks(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_tenant_networks()['networks']
+ self.tenant_networks_client.list_tenant_networks()['networks']
diff --git a/patrole_tempest_plugin/tests/api/identity/v3/test_auth_rbac.py b/patrole_tempest_plugin/tests/api/identity/v3/test_auth_rbac.py
index 2327cbb..bc096ce 100644
--- a/patrole_tempest_plugin/tests/api/identity/v3/test_auth_rbac.py
+++ b/patrole_tempest_plugin/tests/api/identity/v3/test_auth_rbac.py
@@ -30,14 +30,9 @@
# identity:get_auth_domains once the endpoints are implemented in Tempest's
# identity v3 client.
- @classmethod
- def setup_clients(cls):
- super(IdentityAuthV3RbacTest, cls).setup_clients()
- cls.client = cls.identity_client
-
@decorators.idempotent_id('2a9fbf7f-6feb-4161-ae4b-faf7d6421b1a')
@rbac_rule_validation.action(service="keystone",
rule="identity:get_auth_projects")
def test_list_auth_projects(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_auth_projects()['projects']
+ self.identity_client.list_auth_projects()['projects']
diff --git a/patrole_tempest_plugin/tests/api/identity/v3/test_domain_configuration_rbac.py b/patrole_tempest_plugin/tests/api/identity/v3/test_domain_configuration_rbac.py
index 33526e7..31f962a 100644
--- a/patrole_tempest_plugin/tests/api/identity/v3/test_domain_configuration_rbac.py
+++ b/patrole_tempest_plugin/tests/api/identity/v3/test_domain_configuration_rbac.py
@@ -36,11 +36,6 @@
"user_tree_dn": "ou=Users,dc=my_new_root,dc=org"}
@classmethod
- def setup_clients(cls):
- super(DomainConfigurationV3RbacTest, cls).setup_clients()
- cls.client = cls.domain_config_client
-
- @classmethod
def resource_setup(cls):
super(DomainConfigurationV3RbacTest, cls).resource_setup()
cls.domain_id = cls.setup_test_domain()['id']
@@ -50,10 +45,10 @@
self._create_domain_config(self.domain_id)
def _create_domain_config(self, domain_id):
- domain_config = self.client.create_domain_config(
+ domain_config = self.domain_config_client.create_domain_config(
domain_id, identity=self.identity, ldap=self.ldap)['config']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.client.delete_domain_config,
+ self.domain_config_client.delete_domain_config,
domain_id)
return domain_config
@@ -69,23 +64,23 @@
@decorators.idempotent_id('6bdaecd4-0843-4ed6-ab64-3a57ab0cd118')
def test_show_domain_config(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_domain_config(self.domain_id)['config']
+ self.domain_config_client.show_domain_config(self.domain_id)['config']
@decorators.idempotent_id('1b539f95-4991-4e09-960f-fa771e1007d7')
@rbac_rule_validation.action(service="keystone",
rule="identity:get_domain_config")
def test_show_domain_group_config(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_domain_group_config(self.domain_id, 'identity')[
- 'config']
+ self.domain_config_client.show_domain_group_config(
+ self.domain_id, 'identity')['config']
@decorators.idempotent_id('590c774d-a294-44f8-866e-aac9f4ab3809')
@rbac_rule_validation.action(service="keystone",
rule="identity:get_domain_config")
def test_show_domain_group_option_config(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_domain_group_option_config(self.domain_id, 'identity',
- 'driver')['config']
+ self.domain_config_client.show_domain_group_option_config(
+ self.domain_id, 'identity', 'driver')['config']
@decorators.idempotent_id('21053885-1ce3-4167-b5e3-e470253481da')
@rbac_rule_validation.action(
@@ -95,7 +90,7 @@
# The "security_compliance" group can only be shown for the default
# domain.
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_domain_group_config(
+ self.domain_config_client.show_domain_group_config(
CONF.identity.default_domain_id, 'security_compliance')
@decorators.idempotent_id('d1addd10-9ae4-4360-9961-47324fd22f23')
@@ -103,21 +98,23 @@
rule="identity:get_domain_config_default")
def test_show_default_config_settings(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_default_config_settings()['config']
+ self.domain_config_client.show_default_config_settings()['config']
@decorators.idempotent_id('63183377-251f-4622-81f0-6b58a8a285c9')
@rbac_rule_validation.action(service="keystone",
rule="identity:get_domain_config_default")
def test_show_default_group_config(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_default_group_config('identity')['config']
+ self.domain_config_client.show_default_group_config('identity')[
+ 'config']
@decorators.idempotent_id('6440e9c1-e8da-474d-9118-89996fffe5f8')
@rbac_rule_validation.action(service="keystone",
rule="identity:get_domain_config_default")
def test_show_default_group_option(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_default_group_option('identity', 'driver')['config']
+ self.domain_config_client.show_default_group_option('identity',
+ 'driver')['config']
@rbac_rule_validation.action(service="keystone",
rule="identity:update_domain_config")
@@ -125,7 +122,7 @@
def test_update_domain_config(self):
updated_config = {'ldap': {'url': data_utils.rand_url()}}
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.update_domain_config(
+ self.domain_config_client.update_domain_config(
self.domain_id, **updated_config)['config']
@decorators.idempotent_id('6e32bf96-dbe9-4ac8-b814-0e79fa948285')
@@ -133,7 +130,7 @@
rule="identity:update_domain_config")
def test_update_domain_group_config(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.update_domain_group_config(
+ self.domain_config_client.update_domain_group_config(
self.domain_id, 'identity', identity=self.identity)['config']
@decorators.idempotent_id('d2c510da-a077-4c67-9522-27745ef2812b')
@@ -141,7 +138,7 @@
rule="identity:update_domain_config")
def test_update_domain_group_option_config(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.update_domain_group_option_config(
+ self.domain_config_client.update_domain_group_option_config(
self.domain_id, 'identity', 'driver', driver='ldap')['config']
@rbac_rule_validation.action(service="keystone",
@@ -149,19 +146,20 @@
@decorators.idempotent_id('6bdaecd4-0843-4ed6-ab64-3a57ab0cd117')
def test_delete_domain_config(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_domain_config(self.domain_id)
+ self.domain_config_client.delete_domain_config(self.domain_id)
@decorators.idempotent_id('f479694b-df02-4d5a-88b6-c8b52f9341eb')
@rbac_rule_validation.action(service="keystone",
rule="identity:delete_domain_config")
def test_delete_domain_group_config(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_domain_group_config(self.domain_id, 'identity')
+ self.domain_config_client.delete_domain_group_config(self.domain_id,
+ 'identity')
@decorators.idempotent_id('f594bde3-31c9-414f-922d-0ddafdc0ca40')
@rbac_rule_validation.action(service="keystone",
rule="identity:delete_domain_config")
def test_delete_domain_group_option_config(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_domain_group_option_config(
+ self.domain_config_client.delete_domain_group_option_config(
self.domain_id, 'identity', 'driver')
diff --git a/patrole_tempest_plugin/tests/api/identity/v3/test_role_assignments_rbac.py b/patrole_tempest_plugin/tests/api/identity/v3/test_role_assignments_rbac.py
index 6fe6c29..c1d0369 100644
--- a/patrole_tempest_plugin/tests/api/identity/v3/test_role_assignments_rbac.py
+++ b/patrole_tempest_plugin/tests/api/identity/v3/test_role_assignments_rbac.py
@@ -21,17 +21,13 @@
class IdentityRoleAssignmentsV3RbacTest(rbac_base.BaseIdentityV3RbacTest):
- @classmethod
- def setup_clients(cls):
- super(IdentityRoleAssignmentsV3RbacTest, cls).setup_clients()
- cls.client = cls.role_assignments_client
-
@decorators.idempotent_id('afe57adb-1b9c-43d9-84a9-f0cf4c94e416')
@rbac_rule_validation.action(service="keystone",
rule="identity:list_role_assignments")
def test_list_role_assignments(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_role_assignments()['role_assignments']
+ self.role_assignments_client.\
+ list_role_assignments()['role_assignments']
@decorators.idempotent_id('36c7a990-857e-415c-8717-38d7200a9894')
@rbac_rule_validation.action(
@@ -41,6 +37,6 @@
project = self.setup_test_project()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_role_assignments(
- include_subtree=True, **{'scope.project.id': project['id']})[
- 'role_assignments']
+ self.role_assignments_client.list_role_assignments(
+ include_subtree=True,
+ **{'scope.project.id': project['id']})['role_assignments']
diff --git a/patrole_tempest_plugin/tests/api/image/v2/test_image_namespace_tags_rbac.py b/patrole_tempest_plugin/tests/api/image/v2/test_image_namespace_tags_rbac.py
index 7750a19..8e2bc49 100644
--- a/patrole_tempest_plugin/tests/api/image/v2/test_image_namespace_tags_rbac.py
+++ b/patrole_tempest_plugin/tests/api/image/v2/test_image_namespace_tags_rbac.py
@@ -34,11 +34,6 @@
"""
@classmethod
- def setup_clients(cls):
- super(NamespaceTagsRbacTest, cls).setup_clients()
- cls.client = cls.namespace_tags_client
-
- @classmethod
def resource_setup(cls):
super(NamespaceTagsRbacTest, cls).resource_setup()
cls.namespace = cls.namespaces_client.create_namespace(
@@ -59,14 +54,14 @@
namespace_tag_names.append({'name': tag_name})
if multiple:
- namespace_tags = self.client.create_namespace_tags(
+ namespace_tags = self.namespace_tags_client.create_namespace_tags(
self.namespace, tags=namespace_tag_names)['tags']
else:
- namespace_tags = self.client.create_namespace_tag(
+ namespace_tags = self.namespace_tags_client.create_namespace_tag(
self.namespace, namespace_tag_names[0]['name'])
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.client.delete_namespace_tags,
+ self.namespace_tags_client.delete_namespace_tags,
self.namespace)
return [nt['name'] for nt in namespace_tags] if multiple \
@@ -85,7 +80,7 @@
def test_show_namespace_tag(self):
tag_name = self._create_namespace_tag()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_namespace_tag(self.namespace, tag_name)
+ self.namespace_tags_client.show_namespace_tag(self.namespace, tag_name)
@decorators.idempotent_id('01593828-3edb-461e-8abc-8fdeb3927e37')
@rbac_rule_validation.action(service="glance",
@@ -96,8 +91,8 @@
self.__class__.__name__ + '-tag')
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.update_namespace_tag(self.namespace, tag_name,
- name=updated_tag_name)
+ self.namespace_tags_client.update_namespace_tag(
+ self.namespace, tag_name, name=updated_tag_name)
@decorators.idempotent_id('20ffaf76-ebdc-4267-a1ad-194346f5cc91')
@rbac_rule_validation.action(service="glance",
@@ -111,4 +106,4 @@
rule="get_metadef_tags")
def test_list_namespace_tags(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_namespace_tags(self.namespace)
+ self.namespace_tags_client.list_namespace_tags(self.namespace)
diff --git a/patrole_tempest_plugin/tests/api/volume/test_capabilities_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_capabilities_rbac.py
index 9d76ef3..45b1660 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_capabilities_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_capabilities_rbac.py
@@ -32,7 +32,7 @@
@classmethod
def setup_clients(cls):
super(CapabilitiesRbacTest, cls).setup_clients()
- cls.client = cls.os_primary.volume_capabilities_v2_client
+ cls.capabilities_client = cls.os_primary.volume_capabilities_v2_client
cls.hosts_client = cls.os_primary.volume_hosts_v2_client
@rbac_rule_validation.action(service="cinder",
@@ -41,7 +41,7 @@
def test_show_back_end_capabilities(self):
host = self.hosts_client.list_hosts()['hosts'][0]['host_name']
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_backend_capabilities(host)
+ self.capabilities_client.show_backend_capabilities(host)
class CapabilitiesV3RbacTest(CapabilitiesRbacTest):
diff --git a/patrole_tempest_plugin/tests/api/volume/test_encryption_types_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_encryption_types_rbac.py
index d829591..f11ef03 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_encryption_types_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_encryption_types_rbac.py
@@ -31,11 +31,11 @@
@classmethod
def setup_clients(cls):
super(EncryptionTypesRbacTest, cls).setup_clients()
- cls.client = cls.os_primary.encryption_types_v2_client
+ cls.encryption_types_client = cls.os_primary.encryption_types_v2_client
def _create_volume_type_encryption(self):
vol_type_id = self.create_volume_type()['id']
- self.client.create_encryption_type(
+ self.encryption_types_client.create_encryption_type(
vol_type_id,
provider="nova.volume.encryptors.luks.LuksEncryptor",
control_location="front-end")['encryption']
@@ -48,7 +48,7 @@
def test_create_volume_type_encryption(self):
vol_type_id = self.create_volume_type()['id']
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.create_encryption_type(
+ self.encryption_types_client.create_encryption_type(
vol_type_id,
provider="nova.volume.encryptors.luks.LuksEncryptor",
control_location="front-end")['encryption']
@@ -60,7 +60,7 @@
def test_delete_volume_type_encryption(self):
vol_type_id = self._create_volume_type_encryption()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_encryption_type(vol_type_id)
+ self.encryption_types_client.delete_encryption_type(vol_type_id)
@decorators.idempotent_id('42da9fec-32fd-4dca-9242-8a53b2fed25a')
@rbac_rule_validation.action(
@@ -69,8 +69,9 @@
def test_update_volume_type_encryption(self):
vol_type_id = self._create_volume_type_encryption()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.update_encryption_type(vol_type_id,
- control_location="front-end")
+ self.encryption_types_client.update_encryption_type(
+ vol_type_id,
+ control_location="front-end")
@decorators.idempotent_id('1381a3dc-248f-4282-b231-c9399018c804')
@rbac_rule_validation.action(
@@ -79,7 +80,7 @@
def test_show_volume_type_encryption(self):
vol_type_id = self._create_volume_type_encryption()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_encryption_type(vol_type_id)
+ self.encryption_types_client.show_encryption_type(vol_type_id)
class EncryptionTypesV3RbacTest(EncryptionTypesRbacTest):
diff --git a/patrole_tempest_plugin/tests/api/volume/test_qos_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_qos_rbac.py
index 4638e78..cc24fd4 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_qos_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_qos_rbac.py
@@ -27,16 +27,16 @@
def setup_clients(cls):
super(VolumeQOSRbacTest, cls).setup_clients()
cls.auth_provider = cls.os_primary.auth_provider
- cls.client = cls.os_primary.volume_qos_v2_client
+ cls.qos_client = cls.os_primary.volume_qos_v2_client
def _create_test_qos_specs(self, name=None, consumer=None, **kwargs):
"""Create a test Qos-Specs."""
name = name or data_utils.rand_name(self.__class__.__name__ + '-QoS')
consumer = consumer or 'front-end'
- qos_specs = self.client.create_qos(
+ qos_specs = self.qos_client.create_qos(
name=name, consumer=consumer, **kwargs)['qos_specs']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.client.delete_qos, qos_specs['id'])
+ self.qos_client.delete_qos, qos_specs['id'])
return qos_specs
@rbac_rule_validation.action(
@@ -55,7 +55,7 @@
qos = self._create_test_qos_specs()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
# Delete a qos
- self.client.delete_qos(qos['id'])
+ self.qos_client.delete_qos(qos['id'])
@rbac_rule_validation.action(service="cinder",
rule="volume_extension:qos_specs_manage:read")
@@ -65,7 +65,7 @@
qos = self._create_test_qos_specs()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
# Get a qos
- self.client.show_qos(qos['id'])['qos_specs']
+ self.qos_client.show_qos(qos['id'])['qos_specs']
@rbac_rule_validation.action(service="cinder",
rule="volume_extension:qos_specs_manage:read")
@@ -73,7 +73,7 @@
def test_list_qos(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
# list all qos
- self.client.list_qos()['qos_specs']
+ self.qos_client.list_qos()['qos_specs']
@rbac_rule_validation.action(
service="cinder", rule="volume_extension:qos_specs_manage:update")
@@ -83,7 +83,7 @@
qos = self._create_test_qos_specs()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
# set key
- self.client.set_qos_key(qos['id'], iops_bytes='500')['qos_specs']
+ self.qos_client.set_qos_key(qos['id'], iops_bytes='500')['qos_specs']
@rbac_rule_validation.action(
service="cinder", rule="volume_extension:qos_specs_manage:update")
@@ -92,13 +92,13 @@
# Create a qos
qos = self._create_test_qos_specs()
# Set key
- self.client.set_qos_key(qos['id'], iops_bytes='500')['qos_specs']
+ self.qos_client.set_qos_key(qos['id'], iops_bytes='500')['qos_specs']
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
# Unset key
keys = ['iops_bytes']
- self.client.unset_qos_key(qos['id'], keys)
+ self.qos_client.unset_qos_key(qos['id'], keys)
operation = 'qos-key-unset'
- waiters.wait_for_qos_operations(self.client, qos['id'],
+ waiters.wait_for_qos_operations(self.qos_client, qos['id'],
operation, args=keys)
@rbac_rule_validation.action(
@@ -111,8 +111,8 @@
vol_type = self.create_volume_type()['id']
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
# associate the qos-specs with volume-types
- self.client.associate_qos(qos['id'], vol_type)
- self.addCleanup(self.client.disassociate_qos, qos['id'], vol_type)
+ self.qos_client.associate_qos(qos['id'], vol_type)
+ self.addCleanup(self.qos_client.disassociate_qos, qos['id'], vol_type)
@rbac_rule_validation.action(service="cinder",
rule="volume_extension:qos_specs_manage:read")
@@ -122,11 +122,11 @@
qos = self._create_test_qos_specs()
vol_type = self.create_volume_type()['id']
# associate the qos-specs with volume-types
- self.client.associate_qos(qos['id'], vol_type)
- self.addCleanup(self.client.disassociate_qos, qos['id'], vol_type)
+ self.qos_client.associate_qos(qos['id'], vol_type)
+ self.addCleanup(self.qos_client.disassociate_qos, qos['id'], vol_type)
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
# get the association of the qos-specs
- self.client.show_association_qos(qos['id'])
+ self.qos_client.show_association_qos(qos['id'])
@rbac_rule_validation.action(
service="cinder", rule="volume_extension:qos_specs_manage:update")
@@ -136,14 +136,14 @@
qos = self._create_test_qos_specs()
vol_type = self.create_volume_type()['id']
# associate the qos-specs with volume-types
- self.client.associate_qos(qos['id'], vol_type)
+ self.qos_client.associate_qos(qos['id'], vol_type)
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.client.disassociate_qos, qos['id'], vol_type)
+ self.qos_client.disassociate_qos, qos['id'], vol_type)
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
# disassociate a volume-type with qos-specs
- self.client.disassociate_qos(qos['id'], vol_type)
+ self.qos_client.disassociate_qos(qos['id'], vol_type)
operation = 'disassociate'
- waiters.wait_for_qos_operations(self.client, qos['id'],
+ waiters.wait_for_qos_operations(self.qos_client, qos['id'],
operation, args=vol_type)
@rbac_rule_validation.action(
@@ -154,12 +154,12 @@
# create a test volume-type
vol_type = self.create_volume_type()['id']
# associate the qos-specs with volume-types
- self.client.associate_qos(qos['id'], vol_type)
+ self.qos_client.associate_qos(qos['id'], vol_type)
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.client.disassociate_qos, qos['id'], vol_type)
+ self.qos_client.disassociate_qos, qos['id'], vol_type)
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
# disassociate all volume-types from qos-specs
- self.client.disassociate_all_qos(qos['id'])
+ self.qos_client.disassociate_all_qos(qos['id'])
operation = 'disassociate-all'
- waiters.wait_for_qos_operations(self.client, qos['id'],
+ waiters.wait_for_qos_operations(self.qos_client, qos['id'],
operation)
diff --git a/patrole_tempest_plugin/tests/api/volume/test_quota_classes_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_quota_classes_rbac.py
index 44c0d3e..1518ef4 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_quota_classes_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_quota_classes_rbac.py
@@ -34,7 +34,7 @@
@classmethod
def setup_clients(cls):
super(QuotaClassesRbacTest, cls).setup_clients()
- cls.client = cls.os_primary.quota_classes_client
+ cls.quota_classes_client = cls.os_primary.quota_classes_client
cls.quota_name = data_utils.rand_name(cls.__name__ + '-QuotaClass')
@decorators.idempotent_id('1a060def-2b43-4534-97f5-5eadbbe8c726')
@@ -42,18 +42,20 @@
rule="volume_extension:quota_classes")
def test_show_quota_class_set(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_quota_class_set(self.quota_name)['quota_class_set']
+ self.quota_classes_client.show_quota_class_set(
+ self.quota_name)['quota_class_set']
@decorators.idempotent_id('72159478-23a7-4c75-989f-6bac609eca62')
@rbac_rule_validation.action(service="cinder",
rule="volume_extension:quota_classes")
def test_update_quota_class_set(self):
- quota_class_set = self.client.show_quota_class_set(self.quota_name)[
- 'quota_class_set']
+ quota_class_set = self.quota_classes_client.show_quota_class_set(
+ self.quota_name)['quota_class_set']
quota_class_set.pop('id')
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.update_quota_class_set(self.quota_name, **quota_class_set)
+ self.quota_classes_client.update_quota_class_set(self.quota_name,
+ **quota_class_set)
class QuotaClassesV3RbacTest(QuotaClassesRbacTest):
diff --git a/patrole_tempest_plugin/tests/api/volume/test_scheduler_stats_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_scheduler_stats_rbac.py
index 5a36709..dd423d1 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_scheduler_stats_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_scheduler_stats_rbac.py
@@ -32,7 +32,8 @@
@classmethod
def setup_clients(cls):
super(SchedulerStatsRbacTest, cls).setup_clients()
- cls.client = cls.os_primary.volume_scheduler_stats_v2_client
+ cls.scheduler_stats_client =\
+ cls.os_primary.volume_scheduler_stats_v2_client
@rbac_rule_validation.action(
service="cinder",
@@ -40,7 +41,7 @@
@decorators.idempotent_id('5f800441-4d30-48ec-9e5b-0d55bc86acbb')
def test_list_back_end_storage_pools(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_pools()
+ self.scheduler_stats_client.list_pools()
class SchedulerStatsV3RbacTest(SchedulerStatsRbacTest):
diff --git a/patrole_tempest_plugin/tests/api/volume/test_snapshots_actions_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_snapshots_actions_rbac.py
index 5a4e246..fc39f4a 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_snapshots_actions_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_snapshots_actions_rbac.py
@@ -31,11 +31,6 @@
raise cls.skipException("Cinder snapshot feature disabled")
@classmethod
- def setup_clients(cls):
- super(SnapshotsActionsRbacTest, cls).setup_clients()
- cls.client = cls.snapshots_client
-
- @classmethod
def resource_setup(cls):
super(SnapshotsActionsRbacTest, cls).resource_setup()
cls.volume = cls.create_volume()
@@ -49,7 +44,8 @@
def test_reset_snapshot_status(self):
status = 'error'
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.reset_snapshot_status(self.snapshot['id'], status)
+ self.snapshots_client.reset_snapshot_status(self.snapshot['id'],
+ status)
@rbac_rule_validation.action(
service="cinder",
@@ -59,8 +55,8 @@
temp_snapshot = self.create_snapshot(self.volume['id'])
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.force_delete_snapshot(temp_snapshot['id'])
- self.client.wait_for_resource_deletion(temp_snapshot['id'])
+ self.snapshots_client.force_delete_snapshot(temp_snapshot['id'])
+ self.snapshots_client.wait_for_resource_deletion(temp_snapshot['id'])
class SnapshotsActionsV3RbacTest(SnapshotsActionsRbacTest):
diff --git a/patrole_tempest_plugin/tests/api/volume/test_user_messages_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_user_messages_rbac.py
index 219acb4..813d978 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_user_messages_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_user_messages_rbac.py
@@ -32,7 +32,7 @@
@classmethod
def setup_clients(cls):
super(MessagesV3RbacTest, cls).setup_clients()
- cls.client = cls.os_primary.volume_v3_messages_client
+ cls.messages_client = cls.os_primary.volume_v3_messages_client
def _create_user_message(self):
"""Trigger a 'no valid host' situation to generate a message."""
@@ -59,7 +59,7 @@
'volume %s' % volume['id'])
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.client.delete_message, message_id)
+ self.messages_client.delete_message, message_id)
return message_id
@@ -69,7 +69,7 @@
rule="message:get_all")
def test_list_messages(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_messages()['messages']
+ self.messages_client.list_messages()['messages']
@decorators.idempotent_id('9cc1ad1e-68a2-4407-8b60-ea77909bce08')
@rbac_rule_validation.action(
@@ -79,7 +79,7 @@
message_id = self._create_user_message()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_message(message_id)['message']
+ self.messages_client.show_message(message_id)['message']
@decorators.idempotent_id('65ca7fb7-7f2c-443e-b144-ac86973a97be')
@rbac_rule_validation.action(
@@ -89,5 +89,5 @@
message_id = self._create_user_message()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_message(message_id)
- self.client.wait_for_resource_deletion(message_id)
+ self.messages_client.delete_message(message_id)
+ self.messages_client.wait_for_resource_deletion(message_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 16e77ed..1ddd73f 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
@@ -113,9 +113,9 @@
@decorators.idempotent_id('2750717a-f250-4e41-9e09-02624aad6ff8')
def test_volume_readonly_update(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
-
- self.client.update_volume_readonly(self.volume['id'], readonly=True)
- self.addCleanup(self.client.update_volume_readonly,
+ self.volumes_client.update_volume_readonly(self.volume['id'],
+ readonly=True)
+ self.addCleanup(self.volumes_client.update_volume_readonly,
self.volume['id'], readonly=False)
@decorators.idempotent_id('72bab13c-dfaf-4b6d-a132-c83a85fb1776')
@@ -133,7 +133,8 @@
rule="volume:update")
def test_volume_set_bootable(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.set_bootable_volume(self.volume['id'], bootable=True)
+ self.volumes_client.set_bootable_volume(self.volume['id'],
+ bootable=True)
@decorators.idempotent_id('41566922-75a1-4484-99c7-9c8782ee99ac')
@rbac_rule_validation.action(service="cinder",
@@ -203,3 +204,15 @@
class VolumesActionsV3RbacTest(VolumesActionsRbacTest):
_api_version = 3
+
+
+class VolumesActionsV312RbacTest(rbac_base.BaseVolumeRbacTest):
+ _api_version = 3
+ min_microversion = '3.12'
+ max_microversion = 'latest'
+
+ @decorators.idempotent_id('a654833d-4811-4acd-93ef-5ac4a34c75bc')
+ @rbac_rule_validation.action(service="cinder", rule="volume:get_all")
+ def test_show_volume_summary(self):
+ self.rbac_utils.switch_role(self, toggle_rbac_role=True)
+ self.volumes_client.show_volume_summary()['volume-summary']
diff --git a/patrole_tempest_plugin/tests/api/volume/test_volume_metadata_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_volume_metadata_rbac.py
index 8ee8713..9e93658 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_volume_metadata_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_volume_metadata_rbac.py
@@ -27,7 +27,6 @@
@classmethod
def setup_clients(cls):
super(VolumeMetadataRbacTest, cls).setup_clients()
- cls.client = cls.volumes_client
if CONF.image_feature_enabled.api_v1:
cls.image_client = cls.os_primary.image_client
elif CONF.image_feature_enabled.api_v2:
@@ -50,8 +49,8 @@
def _add_metadata(self, volume):
# Create metadata for the volume
metadata = {"key1": "value1"}
- self.client.create_volume_metadata(self.volume['id'], metadata)[
- 'metadata']
+ self.volumes_client.create_volume_metadata(
+ self.volume['id'], metadata)['metadata']
@rbac_rule_validation.action(service="cinder",
rule="volume:create_volume_metadata")
@@ -65,24 +64,26 @@
@decorators.idempotent_id('87ea37d9-23ab-47b2-a59c-16fc4d2c6dfa')
def test_show_volume_metadata(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_volume_metadata(self.volume['id'])['metadata']
+ self.volumes_client.show_volume_metadata(self.volume['id'])['metadata']
@rbac_rule_validation.action(service="cinder",
rule="volume:delete_volume_metadata")
@decorators.idempotent_id('7498dfc1-9db2-4423-ad20-e6dcb25d1beb')
def test_delete_volume_metadata_item(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_volume_metadata_item(self.volume['id'], "key1")
+ self.volumes_client.delete_volume_metadata_item(self.volume['id'],
+ "key1")
@decorators.idempotent_id('a41c8eed-2051-4a25-b401-df036faacbdc')
@rbac_rule_validation.action(
service="cinder",
rule="volume:delete_volume_metadata")
def test_delete_volume_image_metadata(self):
- self.client.update_volume_image_metadata(self.volume['id'],
- image_id=self.image_id)
+ self.volumes_client.update_volume_image_metadata(
+ self.volume['id'], image_id=self.image_id)
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_volume_image_metadata(self.volume['id'], 'image_id')
+ self.volumes_client.delete_volume_image_metadata(self.volume['id'],
+ 'image_id')
@rbac_rule_validation.action(service="cinder",
rule="volume:update_volume_metadata")
@@ -90,7 +91,7 @@
def test_update_volume_metadata_item(self):
updated_metadata_item = {"key1": "value1_update"}
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.update_volume_metadata_item(
+ self.volumes_client.update_volume_metadata_item(
self.volume['id'], "key1", updated_metadata_item)['meta']
@decorators.idempotent_id('a231b445-97a5-4657-b05f-245895e88da9')
@@ -99,7 +100,8 @@
def test_update_volume_metadata(self):
updated_metadata = {"key1": "value1"}
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.update_volume_metadata(self.volume['id'], updated_metadata)
+ self.volumes_client.update_volume_metadata(self.volume['id'],
+ updated_metadata)
@decorators.idempotent_id('a9d9e825-5ea3-42e6-96f3-7ac4e97b2ed0')
@rbac_rule_validation.action(
@@ -107,5 +109,5 @@
rule="volume:update_volume_metadata")
def test_update_volume_image_metadata(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.update_volume_image_metadata(
+ self.volumes_client.update_volume_image_metadata(
self.volume['id'], image_id=self.image_id)
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 0321e13..a56ca5a 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
@@ -37,14 +37,14 @@
@classmethod
def setup_clients(cls):
super(VolumeQuotasRbacTest, cls).setup_clients()
- cls.client = cls.os_primary.volume_quotas_client
+ cls.quotas_client = cls.os_primary.volume_quotas_client
@rbac_rule_validation.action(service="cinder",
rule="volume_extension:quotas:show")
@decorators.idempotent_id('b3c7177e-b6b1-4d0f-810a-fc95606964dd')
def test_list_default_quotas(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_default_quota_set(
+ self.quotas_client.show_default_quota_set(
self.demo_tenant_id)['quota_set']
@rbac_rule_validation.action(service="cinder",
@@ -56,7 +56,7 @@
'snapshots': 11}
# Update limits for all quota resources
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.update_quota_set(
+ self.quotas_client.update_quota_set(
self.demo_tenant_id,
**new_quota_set)['quota_set']
diff --git a/patrole_tempest_plugin/tests/api/volume/test_volume_services_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_volume_services_rbac.py
index c1d8a65..ac6d2ce 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_volume_services_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_volume_services_rbac.py
@@ -36,7 +36,7 @@
@classmethod
def setup_clients(cls):
super(VolumeServicesRbacTest, cls).setup_clients()
- cls.client = cls.os_primary.volume_services_v2_client
+ cls.services_client = cls.os_primary.volume_services_v2_client
@decorators.idempotent_id('b9134f01-97c0-4abd-9455-fe2f03e3f966')
@rbac_rule_validation.action(
@@ -44,7 +44,7 @@
rule="volume_extension:services:index")
def test_list_services(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_services()['services']
+ self.services_client.list_services()['services']
class VolumeServicesV3RbacTest(VolumeServicesRbacTest):
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 057379b..212482c 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
@@ -28,7 +28,7 @@
@classmethod
def setup_clients(cls):
super(VolumesTransfersRbacTest, cls).setup_clients()
- cls.client = cls.os_primary.volume_transfers_v2_client
+ cls.transfers_client = cls.os_primary.volume_transfers_v2_client
cls.adm_volumes_client = cls.os_admin.volumes_v2_client
@classmethod
@@ -41,12 +41,12 @@
# 'awaiting-transfer' state, preventing cleanup and causing
# the test to fail.
test_utils.call_and_ignore_notfound_exc(
- self.client.delete_volume_transfer, transfer['id'])
+ self.transfers_client.delete_volume_transfer, transfer['id'])
waiters.wait_for_volume_resource_status(
self.adm_volumes_client, self.volume['id'], 'available')
def _create_transfer(self):
- transfer = self.client.create_volume_transfer(
+ transfer = self.transfers_client.create_volume_transfer(
volume_id=self.volume['id'])['transfer']
self.addCleanup(self._delete_transfer, transfer)
return transfer
@@ -64,14 +64,14 @@
def test_get_volume_transfer(self):
transfer = self._create_transfer()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_volume_transfer(transfer['id'])
+ self.transfers_client.show_volume_transfer(transfer['id'])
@rbac_rule_validation.action(service="cinder",
rule="volume:get_all_transfers")
@decorators.idempotent_id('02a06f2b-5040-49e2-b2b7-619a7db59603')
def test_list_volume_transfers(self):
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.list_volume_transfers()
+ self.transfers_client.list_volume_transfers()
@rbac_rule_validation.action(service="cinder",
rule="volume:accept_transfer")
@@ -79,8 +79,8 @@
def test_accept_volume_transfer(self):
transfer = self._create_transfer()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.accept_volume_transfer(transfer['id'],
- auth_key=transfer['auth_key'])
+ self.transfers_client.accept_volume_transfer(
+ transfer['id'], auth_key=transfer['auth_key'])
@rbac_rule_validation.action(service="cinder",
rule="volume:delete_transfer")
@@ -88,7 +88,7 @@
def test_delete_volume_transfer(self):
transfer = self._create_transfer()
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.delete_volume_transfer(transfer['id'])
+ self.transfers_client.delete_volume_transfer(transfer['id'])
class VolumesTransfersV3RbacTest(VolumesTransfersRbacTest):
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 ce443e2..34889cd 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
@@ -25,11 +25,6 @@
class VolumesSnapshotRbacTest(rbac_base.BaseVolumeRbacTest):
@classmethod
- def setup_clients(cls):
- super(VolumesSnapshotRbacTest, cls).setup_clients()
- cls.client = cls.snapshots_client
-
- @classmethod
def skip_checks(cls):
super(VolumesSnapshotRbacTest, cls).skip_checks()
if not CONF.volume_feature_enabled.snapshot:
@@ -67,8 +62,8 @@
def test_snapshot_get(self):
# Get the snapshot
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.show_snapshot(self.snapshot
- ['id'])['snapshot']
+ self.snapshots_client.show_snapshot(self.snapshot
+ ['id'])['snapshot']
@rbac_rule_validation.action(service="cinder",
rule="volume:update_snapshot")
@@ -78,7 +73,7 @@
params = {'description': new_desc}
# Updates snapshot with new values
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
- self.client.update_snapshot(
+ self.snapshots_client.update_snapshot(
self.snapshot['id'], **params)['snapshot']
@rbac_rule_validation.action(service="cinder",
@@ -99,7 +94,7 @@
temp_snapshot = self.create_snapshot(self.volume['id'])
self.rbac_utils.switch_role(self, toggle_rbac_role=True)
# Delete the snapshot
- self.client.delete_snapshot(temp_snapshot['id'])
+ self.snapshots_client.delete_snapshot(temp_snapshot['id'])
class VolumesSnapshotV3RbacTest(VolumesSnapshotRbacTest):