How to use create_router_on_l3_agent method in tempest

Best Python code snippet using tempest_python

test_agents_rbac.py

Source:test_agents_rbac.py Github

copy

Full Screen

...90 self.agents_client.list_routers_on_l3_agent(self.agent['id'])91 @decorators.idempotent_id('466b2a10-8747-4c09-855a-bd90a1c86ce7')92 @rbac_rule_validation.action(service="neutron",93 rule="create_l3-router")94 def test_create_router_on_l3_agent(self):95 """Create router on L3 agent test.96 RBAC test for the neutron create_l3-router policy97 """98 self.rbac_utils.switch_role(self, toggle_rbac_role=True)99 self.agents_client.create_router_on_l3_agent(100 self.agent['id'], router_id=self.router['id'])101 self.addCleanup(102 test_utils.call_and_ignore_notfound_exc,103 self.agents_client.delete_router_from_l3_agent,104 self.agent['id'], router_id=self.router['id'])105 @decorators.idempotent_id('8138cfc9-3e48-4a34-adf6-894077aa1be4')106 @rbac_rule_validation.action(service="neutron",107 rule="delete_l3-router")108 def test_delete_router_from_l3_agent(self):109 """Delete router from L3 agent test.110 RBAC test for the neutron delete_l3-router policy111 """112 self.agents_client.create_router_on_l3_agent(113 self.agent['id'], router_id=self.router['id'])114 self.addCleanup(115 test_utils.call_and_ignore_notfound_exc,116 self.agents_client.delete_router_from_l3_agent,117 self.agent['id'], router_id=self.router['id'])118 self.rbac_utils.switch_role(self, toggle_rbac_role=True)119 self.agents_client.delete_router_from_l3_agent(120 self.agent['id'], router_id=self.router['id'])121class DHCPAgentSchedulersRbacTest(base.BaseNetworkRbacTest):122 @classmethod123 def skip_checks(cls):124 super(DHCPAgentSchedulersRbacTest, cls).skip_checks()125 if not test.is_extension_enabled('dhcp_agent_scheduler', 'network'):126 msg = "dhcp_agent_scheduler extension not enabled."...

Full Screen

Full Screen

agents_client.py

Source:agents_client.py Github

copy

Full Screen

...29 return self.list_resources(uri, **filters)30 def list_routers_on_l3_agent(self, agent_id):31 uri = '/agents/%s/l3-routers' % agent_id32 return self.list_resources(uri)33 def create_router_on_l3_agent(self, agent_id, **kwargs):34 # TODO(piyush): Current api-site doesn't contain this API description.35 # After fixing the api-site, we need to fix here also for putting the36 # link to api-site.37 # LP: https://bugs.launchpad.net/openstack-api-site/+bug/152667038 uri = '/agents/%s/l3-routers' % agent_id39 return self.create_resource(uri, kwargs)40 def delete_router_from_l3_agent(self, agent_id, router_id):41 uri = '/agents/%s/l3-routers/%s' % (agent_id, router_id)42 return self.delete_resource(uri)43 def list_networks_hosted_by_one_dhcp_agent(self, agent_id):44 uri = '/agents/%s/dhcp-networks' % agent_id45 return self.list_resources(uri)46 def delete_network_from_dhcp_agent(self, agent_id, network_id):47 uri = '/agents/%s/dhcp-networks/%s' % (agent_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