How to use inject_network_info method in tempest

Best Python code snippet using tempest_python

admin_actions.py

Source:admin_actions.py Github

copy

Full Screen

...46 raise exc.HTTPConflict(explanation=e.format_message())47 return webob.Response(status_int=202)48 @extensions.expected_errors((404, 409))49 @wsgi.action('inject_network_info')50 def _inject_network_info(self, req, id, body):51 """Permit admins to inject network info into a server."""52 context = req.environ['nova.context']53 authorize(context, 'inject_network_info')54 try:55 instance = common.get_instance(self.compute_api, context, id,56 want_objects=True)57 self.compute_api.inject_network_info(context, instance)58 except exception.InstanceIsLocked as e:59 raise exc.HTTPConflict(explanation=e.format_message())60 return webob.Response(status_int=202)61 @extensions.expected_errors((400, 404))62 @wsgi.action('reset_state')63 def _reset_state(self, req, id, body):64 """Permit admins to reset the state of a server."""65 context = req.environ["nova.context"]66 authorize(context, 'reset_state')67 # Identify the desired state from the body68 try:69 state = state_map[body["reset_state"]["state"]]70 except (TypeError, KeyError):71 msg = _("Desired state must be specified. Valid states "...

Full Screen

Full Screen

test_admin_server_actions_rbac.py

Source:test_admin_server_actions_rbac.py Github

copy

Full Screen

...42 @rbac_rule_validation.action(43 service="nova",44 rule="os_compute_api:os-admin-actions:inject_network_info")45 @decorators.idempotent_id('ce48c340-51c1-4cff-9b6e-0cc5ef008630')46 def test_inject_network_info(self):47 self.rbac_utils.switch_role(self, toggle_rbac_role=True)48 self.servers_client.inject_network_info(self.server_id)49 @rbac_rule_validation.action(50 service="nova",51 rule="os_compute_api:os-admin-actions:reset_network")52 @decorators.idempotent_id('2911a242-15c4-4fcb-80d5-80a8930661b0')53 def test_reset_network(self):54 self.rbac_utils.switch_role(self, toggle_rbac_role=True)...

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