How to use assign_user_role_on_system method in tempest

Best Python code snippet using tempest_python

dynamic_creds.py

Source:dynamic_creds.py Github

copy

Full Screen

...236 elif scope == 'domain':237 self.creds_client.assign_user_role_on_domain(238 user, role, domain)239 elif scope == 'system':240 self.creds_client.assign_user_role_on_system(user, role)241 LOG.info("Dynamic test user %s is created with scope %s and roles: %s",242 user['id'], scope, roles_to_assign)243 creds = self.creds_client.get_credentials(**cred_params)244 return cred_provider.TestResources(creds)245 def _create_network_resources(self, tenant_id):246 """The function creates network resources in the given tenant.247 The function checks if network_resources class member is empty,248 In case it is, it will create a network, a subnet and a router for249 the tenant according to the given tenant id parameter.250 Otherwise it will create a network resource according251 to the values from network_resources dict.252 :param tenant_id: The tenant id to create resources for.253 :type tenant_id: str254 :raises: InvalidConfiguration, Exception...

Full Screen

Full Screen

cred_client.py

Source:cred_client.py Github

copy

Full Screen

...205 domain['id'], user['id'], role['id'])206 except lib_exc.Conflict:207 LOG.debug("Role %s already assigned on domain %s for user %s",208 role['id'], domain['id'], user['id'])209 def assign_user_role_on_system(self, user, role_name):210 """Assign the specified role on the system211 :param user: a user dict212 :param role_name: name of the role to be assigned213 """214 role = self._check_role_exists(role_name)215 if not role:216 msg = 'No "%s" role found' % role_name217 raise lib_exc.NotFound(msg)218 try:219 self.roles_client.create_user_role_on_system(220 user['id'], role['id'])221 except lib_exc.Conflict:222 LOG.debug("Role %s already assigned on the system for user %s",223 role['id'], user['id'])...

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