Best Python code snippet using tempest_python
test_images_member_rbac.py
Source:test_images_member_rbac.py
...36 """37 image_id = self.create_image()['id']38 # Toggle role and add image member39 self.rbac_utils.switch_role(self, toggle_rbac_role=True)40 self.image_member_client.create_image_member(image_id,41 member=self.alt_tenant_id)42 @rbac_rule_validation.action(service="glance",43 rule="delete_member")44 @decorators.idempotent_id('ba075234-6484-11e6-881e-080027d0d606')45 def test_delete_image_member(self):46 """Delete image member47 RBAC test for the glance delete_member policy48 """49 image_id = self.create_image()['id']50 self.image_member_client.create_image_member(image_id,51 member=self.alt_tenant_id)52 # Toggle role and delete image member53 self.rbac_utils.switch_role(self, toggle_rbac_role=True)54 self.image_member_client.delete_image_member(image_id,55 self.alt_tenant_id)56 @rbac_rule_validation.action(service="glance",57 rule="get_member",58 expected_error_code=404)59 @decorators.idempotent_id('c01fd308-6484-11e6-881e-080027d0d606')60 def test_show_image_member(self):61 """Show image member62 RBAC test for the glance get_member policy63 """64 image_id = self.create_image()['id']65 self.image_member_client.create_image_member(66 image_id,67 member=self.alt_tenant_id)68 # Toggle role and get image member69 self.rbac_utils.switch_role(self, toggle_rbac_role=True)70 self.image_member_client.show_image_member(71 image_id,72 self.alt_tenant_id)73 @rbac_rule_validation.action(service="glance",74 rule="modify_member")75 @decorators.idempotent_id('ca448bb2-6484-11e6-881e-080027d0d606')76 def test_update_image_member(self):77 """Update image member78 RBAC test for the glance modify_member policy79 """80 image_id = self.create_image(visibility='shared')['id']81 self.image_member_client.create_image_member(82 image_id,83 member=self.tenant_id)84 self.image_member_client.update_image_member(85 image_id, self.tenant_id,86 status='accepted')87 # Toggle role and update member88 self.rbac_utils.switch_role(self, toggle_rbac_role=True)89 self.image_member_client.update_image_member(90 image_id, self.tenant_id,91 status='pending')92 @rbac_rule_validation.action(service="glance",93 rule="get_members")94 @decorators.idempotent_id('d0a2dc20-6484-11e6-881e-080027d0d606')95 def test_list_image_members(self):96 """List image member97 RBAC test for the glance get_members policy98 """99 image_id = self.create_image()['id']100 self.image_member_client.create_image_member(image_id,101 member=self.alt_tenant_id)102 # Toggle role and list image members103 self.rbac_utils.switch_role(self, toggle_rbac_role=True)...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!