commit | f14ce8122093b81bb34137adfc1e8323687c80ef | [log] [tgz] |
---|---|---|
author | rajat29 <rajat.sharma@nectechnologies.in> | Mon Nov 20 13:55:21 2017 +0530 |
committer | rajat29 <rajat.sharma@nectechnologies.in> | Thu Nov 23 10:13:04 2017 +0530 |
tree | f719078f9f4e2f0f8cec709664687a022d8b2114 | |
parent | f07edf12bfcdc4f92b14604af1e52aaa59bdd142 [diff] |
Add missing volume RBAC test Add missing RBAC test for 'show_group_type' API [0] which enforces "group:access_group_type_specs" according to policy in code docs [1]. [0]https://developer.openstack.org/api-ref/block-storage/v3/#show-group-type-details [1]https://github.com/openstack/cinder/blob/76231f3ad2828fe7bb60ecd9686db807622bbb7a/cinder/policies/group_types.py#L53 Change-Id: I71c81d0798082c03408d75deb021e7fcf077b938
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 20f20a5..192e1c4 100644 --- a/patrole_tempest_plugin/tests/api/volume/test_groups_rbac.py +++ b/patrole_tempest_plugin/tests/api/volume/test_groups_rbac.py
@@ -148,7 +148,21 @@ service="cinder", rule="group:group_types_manage") def test_delete_group_type(self): - goup_type = self.create_group_type(ignore_notfound=True) + group_type = self.create_group_type(ignore_notfound=True) self.rbac_utils.switch_role(self, toggle_rbac_role=True) - self.group_types_client.delete_group_type(goup_type['id']) + self.group_types_client.delete_group_type(group_type['id']) + + @decorators.idempotent_id('8d9e2831-24c3-47b7-a76a-2e563287f12f') + @rbac_rule_validation.action( + service="cinder", + rule="group:access_group_types_specs") + def test_show_group_type(self): + group_type = self.create_group_type() + self.rbac_utils.switch_role(self, toggle_rbac_role=True) + resp_body = \ + self.group_types_client.show_group_type( + group_type['id'])['group_type'] + if 'group_specs' not in resp_body: + raise rbac_exceptions.RbacMalformedResponse( + attribute='group_specs')