Add tests for update group types for volume module
This PS adds a test for update_group_types for the corresponding
Cinder API that was recently added to Tempest [0] and whose policy
is [1].
This PS also rearranges some tests in the related class so that
the tests are bunched together by policy name.
[0] https://github.com/openstack/tempest/blob/1879cc7aa733f38bc5eba1d126bd320dfeaa1a90/tempest/lib/services/volume/v3/group_types_client.py#L79
[1] https://github.com/openstack/cinder/blob/280e59c5b6c953228dcba52b21587b82f7f5f93b/cinder/policies/group_types.py#L38
Change-Id: Ie9bf27c9e9c392ebb2011800e5ce5c1450c3df75
diff --git a/patrole_tempest_plugin/tests/api/volume/test_groups_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_groups_rbac.py
index c9ecdae..ecd193b 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_groups_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_groups_rbac.py
@@ -171,6 +171,31 @@
with self.rbac_utils.override_role(self):
self.create_group_type(ignore_notfound=True)
+ @decorators.idempotent_id('f77f8156-4fc9-4f02-be15-8930f748e10c')
+ @rbac_rule_validation.action(
+ service="cinder",
+ rule="group:group_types_manage")
+ def test_delete_group_type(self):
+ group_type = self.create_group_type(ignore_notfound=True)
+
+ with self.rbac_utils.override_role(self):
+ self.group_types_client.delete_group_type(group_type['id'])
+
+ @decorators.idempotent_id('67929954-4551-4d22-b15a-27fb6e56b711')
+ @rbac_rule_validation.action(
+ service="cinder",
+ rule="group:group_types_manage")
+ def test_update_group_type(self):
+ group_type = self.create_group_type()
+ update_params = {
+ 'name': data_utils.rand_name(
+ self.__class__.__name__ + '-updated-group-type'),
+ 'description': 'updated-group-type-desc'
+ }
+ with self.rbac_utils.override_role(self):
+ self.group_types_client.update_group_type(
+ group_type['id'], **update_params)
+
@decorators.idempotent_id('a5f88c26-df7c-4f21-a3ae-7a4c2d6212b4')
@rbac_rule_validation.action(
service="cinder",
@@ -186,16 +211,6 @@
raise rbac_exceptions.RbacMalformedResponse(
attribute='group_specs')
- @decorators.idempotent_id('f77f8156-4fc9-4f02-be15-8930f748e10c')
- @rbac_rule_validation.action(
- service="cinder",
- rule="group:group_types_manage")
- def test_delete_group_type(self):
- group_type = self.create_group_type(ignore_notfound=True)
-
- with self.rbac_utils.override_role(self):
- self.group_types_client.delete_group_type(group_type['id'])
-
@decorators.idempotent_id('8d9e2831-24c3-47b7-a76a-2e563287f12f')
@rbac_rule_validation.action(
service="cinder",