How to use delete_policy_association_for_region_and_service method in tempest

Best Python code snippet using tempest_python

test_policy_association.py

Source:test_policy_association.py Github

copy

Full Screen

...122 * whether the persona can delete a policy association for a service123 """124 pass125 @abc.abstractmethod126 def test_identity_delete_policy_association_for_region_and_service(self):127 """Test identity:delete_policy_association_for_region_and_service policy.128 This test must check129 * whether the persona can delete a policy association for a region130 and service131 """132 pass133class SystemAdminTests(134 IdentityV3RbacPolicyAssociationTests, base.BaseIdentityTest):135 credentials = ['system_admin']136 def test_identity_create_policy_association_for_endpoint(self):137 self.do_request(138 'update_policy_association_for_endpoint',139 expected_status=204,140 policy_id=self.policy_id, endpoint_id=self.endpoint_id)141 self.addCleanup(142 self.admin_policies_client.delete_policy_association_for_endpoint,143 policy_id=self.policy_id, endpoint_id=self.endpoint_id)144 def test_identity_create_policy_association_for_service(self):145 self.do_request(146 'update_policy_association_for_service',147 expected_status=204,148 policy_id=self.policy_id, service_id=self.service_id)149 self.addCleanup(150 self.admin_policies_client.delete_policy_association_for_service,151 policy_id=self.policy_id, service_id=self.service_id)152 def test_identity_create_policy_association_for_region_and_service(self):153 self.do_request(154 'update_policy_association_for_region_and_service',155 expected_status=204,156 policy_id=self.policy_id, service_id=self.service_id,157 region_id=self.region_id)158 delete_fn = getattr(159 self.admin_policies_client,160 'delete_policy_association_for_region_and_service'161 )162 self.addCleanup(delete_fn,163 policy_id=self.policy_id,164 service_id=self.service_id,165 region_id=self.region_id)166 def test_identity_check_policy_association_for_endpoint(self):167 self.admin_policies_client.update_policy_association_for_endpoint(168 policy_id=self.policy_id, endpoint_id=self.endpoint_id)169 self.addCleanup(170 self.admin_policies_client.delete_policy_association_for_endpoint,171 policy_id=self.policy_id, endpoint_id=self.endpoint_id)172 self.do_request(173 'show_policy_association_for_endpoint',174 expected_status=204,175 policy_id=self.policy_id, endpoint_id=self.endpoint_id)176 def test_identity_check_policy_association_for_service(self):177 self.admin_policies_client.update_policy_association_for_service(178 policy_id=self.policy_id, service_id=self.service_id)179 self.addCleanup(180 self.admin_policies_client.delete_policy_association_for_service,181 policy_id=self.policy_id, service_id=self.service_id)182 self.do_request(183 'show_policy_association_for_service',184 expected_status=204,185 policy_id=self.policy_id, service_id=self.service_id)186 def test_identity_check_policy_association_for_region_and_service(self):187 update_fn = getattr(188 self.admin_policies_client,189 'update_policy_association_for_region_and_service'190 )191 update_fn(policy_id=self.policy_id,192 service_id=self.service_id,193 region_id=self.region_id)194 delete_fn = getattr(195 self.admin_policies_client,196 'delete_policy_association_for_region_and_service'197 )198 self.addCleanup(delete_fn,199 policy_id=self.policy_id,200 service_id=self.service_id,201 region_id=self.region_id)202 self.do_request(203 'show_policy_association_for_region_and_service',204 expected_status=204,205 policy_id=self.policy_id,206 service_id=self.service_id,207 region_id=self.region_id)208 def test_identity_get_policy_for_endpoint(self):209 self.admin_policies_client.update_policy_association_for_endpoint(210 policy_id=self.policy_id, endpoint_id=self.endpoint_id)211 self.addCleanup(212 self.admin_policies_client.delete_policy_association_for_endpoint,213 policy_id=self.policy_id, endpoint_id=self.endpoint_id)214 self.do_request(215 'show_policy_for_endpoint',216 expected_status=200,217 endpoint_id=self.endpoint_id)218 def test_identity_list_endpoints_for_policy(self):219 self.admin_policies_client.update_policy_association_for_endpoint(220 policy_id=self.policy_id, endpoint_id=self.endpoint_id)221 self.addCleanup(222 self.admin_policies_client.delete_policy_association_for_endpoint,223 policy_id=self.policy_id, endpoint_id=self.endpoint_id)224 self.do_request(225 'list_endpoints_for_policy',226 expected_status=200,227 policy_id=self.policy_id)228 def test_identity_delete_policy_association_for_endpoint(self):229 self.admin_policies_client.update_policy_association_for_endpoint(230 policy_id=self.policy_id, endpoint_id=self.endpoint_id)231 self.do_request(232 'delete_policy_association_for_endpoint',233 expected_status=204,234 policy_id=self.policy_id, endpoint_id=self.endpoint_id)235 def test_identity_delete_policy_association_for_service(self):236 self.admin_policies_client.update_policy_association_for_service(237 policy_id=self.policy_id, service_id=self.service_id)238 self.do_request(239 'delete_policy_association_for_service',240 expected_status=204,241 policy_id=self.policy_id, service_id=self.service_id)242 def test_identity_delete_policy_association_for_region_and_service(self):243 update_fn = getattr(244 self.admin_policies_client,245 'update_policy_association_for_region_and_service'246 )247 update_fn(policy_id=self.policy_id,248 service_id=self.service_id,249 region_id=self.region_id)250 self.do_request(251 'delete_policy_association_for_region_and_service',252 expected_status=204,253 policy_id=self.policy_id,254 service_id=self.service_id,255 region_id=self.region_id)256class SystemMemberTests(SystemAdminTests, base.BaseIdentityTest):257 credentials = ['system_member', 'system_admin']258 def test_identity_create_policy_association_for_endpoint(self):259 self.do_request(260 'update_policy_association_for_endpoint',261 expected_status=exceptions.Forbidden,262 policy_id=self.policy_id, endpoint_id=self.endpoint_id)263 def test_identity_create_policy_association_for_service(self):264 self.do_request(265 'update_policy_association_for_service',266 expected_status=exceptions.Forbidden,267 policy_id=self.policy_id, service_id=self.service_id)268 def test_identity_create_policy_association_for_region_and_service(self):269 self.do_request(270 'update_policy_association_for_region_and_service',271 expected_status=exceptions.Forbidden,272 policy_id=self.policy_id, service_id=self.service_id,273 region_id=self.region_id)274 def test_identity_delete_policy_association_for_endpoint(self):275 self.admin_policies_client.update_policy_association_for_endpoint(276 policy_id=self.policy_id, endpoint_id=self.endpoint_id)277 self.addCleanup(278 self.admin_policies_client.delete_policy_association_for_endpoint,279 policy_id=self.policy_id, endpoint_id=self.endpoint_id)280 self.do_request(281 'delete_policy_association_for_endpoint',282 expected_status=exceptions.Forbidden,283 policy_id=self.policy_id, endpoint_id=self.endpoint_id)284 def test_identity_delete_policy_association_for_service(self):285 self.admin_policies_client.update_policy_association_for_service(286 policy_id=self.policy_id, service_id=self.service_id)287 self.addCleanup(288 self.admin_policies_client.delete_policy_association_for_service,289 policy_id=self.policy_id, service_id=self.service_id)290 self.do_request(291 'delete_policy_association_for_service',292 expected_status=exceptions.Forbidden,293 policy_id=self.policy_id, service_id=self.service_id)294 def test_identity_delete_policy_association_for_region_and_service(self):295 update_fn = getattr(296 self.admin_policies_client,297 'update_policy_association_for_region_and_service'298 )299 update_fn(policy_id=self.policy_id,300 service_id=self.service_id,301 region_id=self.region_id)302 delete_fn = getattr(303 self.admin_policies_client,304 'delete_policy_association_for_region_and_service'305 )306 self.addCleanup(delete_fn,307 policy_id=self.policy_id,308 service_id=self.service_id,...

Full Screen

Full Screen

test_policy_association_rbac.py

Source:test_policy_association_rbac.py Github

copy

Full Screen

...125 @rbac_rule_validation.action(126 service="keystone",127 rules=["identity:delete_policy_association_for_region_and_service"])128 @decorators.idempotent_id('9c956888-81d4-4a24-8203-bff7b8a7834c')129 def test_delete_policy_association_for_region_and_service(self):130 self._update_policy_association_for_region_and_service(131 self.policy_id, self.service_id, self.region_id)132 with self.override_role():133 self.policies_client.\134 delete_policy_association_for_region_and_service(...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful