• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python helpers.register_ovs_agent函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中neutron.tests.common.helpers.register_ovs_agent函数的典型用法代码示例。如果您正苦于以下问题:Python register_ovs_agent函数的具体用法?Python register_ovs_agent怎么用?Python register_ovs_agent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了register_ovs_agent函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_get_agent_by_host

 def test_get_agent_by_host(self):
     helpers.register_l3_agent()
     helpers.register_dhcp_agent()
     helpers.register_ovs_agent()
     agent = l2pop_db.get_agent_by_host(
         self.ctx.session, helpers.HOST)
     self.assertEqual(constants.AGENT_TYPE_OVS, agent.agent_type)
开发者ID:sebrandon1,项目名称:neutron,代码行数:7,代码来源:test_db.py


示例2: setUp

    def setUp(self):
        ml2_config.cfg.CONF.set_override('mechanism_drivers',
                                         ['logger', 'fake_agent'],
                                         'ml2')

        super(TestBagpipeServiceDriverCallbacks, self).setUp(self._plugin_name)

        self.port_create_status = 'DOWN'
        self.plugin = manager.NeutronManager.get_plugin()
        self.plugin.start_rpc_listeners()

        self.bagpipe_driver = self.bgpvpn_plugin.driver

        self.patched_driver = mock.patch.object(
            self.bgpvpn_plugin.driver,
            '_retrieve_bgpvpn_network_info_for_port',
            return_value=BGPVPN_INFO)
        self.patched_driver.start()

        self.mock_attach_rpc = self.mocked_bagpipeAPI.attach_port_on_bgpvpn
        self.mock_detach_rpc = self.mocked_bagpipeAPI.detach_port_from_bgpvpn
        self.mock_update_bgpvpn_rpc = self.mocked_bagpipeAPI.update_bgpvpn
        self.mock_delete_bgpvpn_rpc = self.mocked_bagpipeAPI.delete_bgpvpn

        # we choose an agent of type const.AGENT_TYPE_OFA
        # because this is the type used by the fake_agent mech driver
        helpers.register_ovs_agent(helpers.HOST, const.AGENT_TYPE_OFA)
        helpers.register_l3_agent()
开发者ID:rasta-rocket,项目名称:networking-bgpvpn,代码行数:28,代码来源:test_bagpipe.py


示例3: test_ovs_bridge_name_not_set_when_not_trunk

 def test_ovs_bridge_name_not_set_when_not_trunk(self):
     helpers.register_ovs_agent(host=helpers.HOST)
     with self.port() as port:
         port['port'][pb.HOST_ID] = helpers.HOST
         bound_port = self.core_plugin.update_port(self.context,
                                                   port['port']['id'], port)
         self.assertIsNone(
             bound_port[pb.VIF_DETAILS].get(pb.VIF_DETAILS_BRIDGE_NAME))
开发者ID:sebrandon1,项目名称:neutron,代码行数:8,代码来源:test_plugin.py


示例4: test_get_agent_by_host

 def test_get_agent_by_host(self):
     # Register a L2 agent + A bunch of other agents on the same host
     helpers.register_l3_agent()
     helpers.register_dhcp_agent()
     helpers.register_ovs_agent()
     agent = self.db_mixin.get_agent_by_host(
         self.ctx.session, helpers.HOST)
     self.assertEqual(constants.AGENT_TYPE_OVS, agent.agent_type)
开发者ID:abhilabh,项目名称:neutron,代码行数:8,代码来源:test_db.py


示例5: test_ovs_bridge_name_set_to_integration_bridge_when_not_trunk

 def test_ovs_bridge_name_set_to_integration_bridge_when_not_trunk(self):
     helpers.register_ovs_agent(host=helpers.HOST,
                                integration_bridge='br-fake')
     with self.port() as port:
         port['port'][pb.HOST_ID] = helpers.HOST
         bound_port = self.core_plugin.update_port(self.context,
                                                   port['port']['id'], port)
         self.assertEqual('br-fake',
             bound_port[pb.VIF_DETAILS].get(pb.VIF_DETAILS_BRIDGE_NAME))
开发者ID:igordcard,项目名称:neutron,代码行数:9,代码来源:test_plugin.py


示例6: test__handle_port_binding_set_device_owner

 def test__handle_port_binding_set_device_owner(self):
     helpers.register_ovs_agent(host=helpers.HOST)
     with self.port() as subport:
         port = (
             self.trunk_plugin.
             _rpc_backend._skeleton._handle_port_binding(
                 self.context, subport['port']['id'],
                 mock.ANY, helpers.HOST))
         self.assertEqual(
             constants.TRUNK_SUBPORT_OWNER, port['device_owner'])
开发者ID:AradhanaSingh,项目名称:neutron,代码行数:10,代码来源:test_server.py


示例7: test__get_ha_router_interface_ids_with_ha_replicated_port

 def test__get_ha_router_interface_ids_with_ha_replicated_port(self):
     helpers.register_dhcp_agent()
     helpers.register_l3_agent()
     helpers.register_ovs_agent()
     self._create_ha_router()
     self._setup_port_binding(
         device_owner=constants.DEVICE_OWNER_HA_REPLICATED_INT,
         device_id=TEST_ROUTER_ID)
     ha_iface_ids = l2pop_db._get_ha_router_interface_ids(
         self.ctx.session, TEST_NETWORK_ID)
     self.assertEqual(1, len(list(ha_iface_ids)))
开发者ID:sebrandon1,项目名称:neutron,代码行数:11,代码来源:test_db.py


示例8: test_get_nondistributed_active_network_ports

 def test_get_nondistributed_active_network_ports(self):
     self._setup_port_binding(dvr=False)
     # Register a L2 agent + A bunch of other agents on the same host
     helpers.register_l3_agent()
     helpers.register_dhcp_agent()
     helpers.register_ovs_agent()
     fdb_network_ports = l2pop_db.get_nondistributed_active_network_ports(
         self.ctx.session, TEST_NETWORK_ID)
     self.assertEqual(1, len(fdb_network_ports))
     _, agent = fdb_network_ports[0]
     self.assertEqual(constants.AGENT_TYPE_OVS, agent.agent_type)
开发者ID:sebrandon1,项目名称:neutron,代码行数:11,代码来源:test_db.py


示例9: test_get_nondvr_active_network_ports

 def test_get_nondvr_active_network_ports(self):
     self._setup_port_binding(dvr=False)
     # Register a L2 agent + A bunch of other agents on the same host
     helpers.register_l3_agent()
     helpers.register_dhcp_agent()
     helpers.register_ovs_agent()
     fdb_network_ports = self.db_mixin.get_nondvr_active_network_ports(
         self.ctx.session, 'network_id')
     self.assertEqual(1, len(fdb_network_ports))
     _, agent = fdb_network_ports[0]
     self.assertEqual(constants.AGENT_TYPE_OVS, agent.agent_type)
开发者ID:abhilabh,项目名称:neutron,代码行数:11,代码来源:test_db.py


示例10: test_get_dvr_active_network_ports

 def test_get_dvr_active_network_ports(self):
     self._setup_port_binding()
     # Register a L2 agent + A bunch of other agents on the same host
     helpers.register_l3_agent()
     helpers.register_dhcp_agent()
     helpers.register_ovs_agent()
     tunnel_network_ports = l2pop_db.get_dvr_active_network_ports(
         self.ctx.session, 'network_id')
     self.assertEqual(1, len(tunnel_network_ports))
     _, agent = tunnel_network_ports[0]
     self.assertEqual(constants.AGENT_TYPE_OVS, agent.agent_type)
开发者ID:21atlas,项目名称:neutron,代码行数:11,代码来源:test_db.py


示例11: test_ovs_bridge_name_not_set_if_integration_bridge_not_set

 def test_ovs_bridge_name_not_set_if_integration_bridge_not_set(self):
     """This will only happen if a stein or later ml2 driver is
     binding an interface for a pre stein ml2 agent.
     """
     helpers.register_ovs_agent(host=helpers.HOST)
     with self.port() as port:
         port['port'][pb.HOST_ID] = helpers.HOST
         bound_port = self.core_plugin.update_port(self.context,
                                                   port['port']['id'], port)
         self.assertIsNone(
             bound_port[pb.VIF_DETAILS].get(pb.VIF_DETAILS_BRIDGE_NAME))
开发者ID:igordcard,项目名称:neutron,代码行数:11,代码来源:test_plugin.py


示例12: test_get_distributed_active_network_ports

 def test_get_distributed_active_network_ports(self):
     self._setup_port_binding(
         device_owner=constants.DEVICE_OWNER_DVR_INTERFACE)
     # Register a L2 agent + A bunch of other agents on the same host
     helpers.register_l3_agent()
     helpers.register_dhcp_agent()
     helpers.register_ovs_agent()
     tunnel_network_ports = l2pop_db.get_distributed_active_network_ports(
         self.ctx.session, TEST_NETWORK_ID)
     self.assertEqual(1, len(tunnel_network_ports))
     _, agent = tunnel_network_ports[0]
     self.assertEqual(constants.AGENT_TYPE_OVS, agent.agent_type)
开发者ID:sebrandon1,项目名称:neutron,代码行数:12,代码来源:test_db.py


示例13: _register_ml2_agents

 def _register_ml2_agents(self):
     helpers.register_ovs_agent(host=HOST, tunneling_ip='20.0.0.1')
     helpers.register_ovs_agent(host=HOST_2, tunneling_ip='20.0.0.2')
     helpers.register_ovs_agent(host=HOST_3, tunneling_ip='20.0.0.3',
                                tunnel_types=[])
     helpers.register_ovs_agent(host=HOST_4, tunneling_ip='20.0.0.4')
     helpers.register_ovs_agent(host=HOST_5, tunneling_ip='20.0.0.5',
                                binary='neutron-fake-agent',
                                tunnel_types=[],
                                interface_mappings={'physnet1': 'eth9'},
                                agent_type=constants.AGENT_TYPE_OFA,
                                l2pop_network_types=['vlan'])
开发者ID:dlundquist,项目名称:neutron,代码行数:12,代码来源:test_mech_driver.py


示例14: test_get_ha_agents_by_router_id

 def test_get_ha_agents_by_router_id(self):
     helpers.register_dhcp_agent()
     helpers.register_l3_agent()
     helpers.register_ovs_agent()
     self._create_ha_router()
     self._setup_port_binding(
         device_owner=constants.DEVICE_OWNER_ROUTER_SNAT,
         device_id=TEST_ROUTER_ID)
     agents = l2pop_db.get_ha_agents_by_router_id(
         self.ctx.session, TEST_ROUTER_ID)
     ha_agents = [agent.host for agent in agents]
     self.assertEqual(tools.UnorderedList([HOST, HOST_2]), ha_agents)
开发者ID:sebrandon1,项目名称:neutron,代码行数:12,代码来源:test_db.py


示例15: test_port_bind_successfully

 def test_port_bind_successfully(self):
     helpers.register_ovs_agent(host=helpers.HOST)
     with self.network() as network:
         with self.subnet(network=network) as subnet:
             with self.port(
                     subnet=subnet, device_owner=DEVICE_OWNER_COMPUTE,
                     arg_list=(portbindings.HOST_ID, 'admin_state_up',),
                     **self.host_args) as port:
                 # Note: Port creation invokes _bind_port_if_needed(),
                 # therefore it is all we need in order to test a successful
                 # binding
                 self.assertEqual(port['port']['binding:vif_type'],
                                  portbindings.VIF_TYPE_OVS)
开发者ID:21atlas,项目名称:neutron,代码行数:13,代码来源:test_plugin.py


示例16: _register_ml2_agents

 def _register_ml2_agents(self):
     helpers.register_ovs_agent(host=HOST, tunneling_ip="20.0.0.1")
     helpers.register_ovs_agent(host=HOST_2, tunneling_ip="20.0.0.2")
     helpers.register_ovs_agent(host=HOST_3, tunneling_ip="20.0.0.3", tunnel_types=[])
     helpers.register_ovs_agent(host=HOST_4, tunneling_ip="20.0.0.4")
     helpers.register_ovs_agent(
         host=HOST_5,
         tunneling_ip="20.0.0.5",
         binary="neutron-fake-agent",
         tunnel_types=[],
         interface_mappings={"physnet1": "eth9"},
         agent_type=constants.AGENT_TYPE_OFA,
         l2pop_network_types=["vlan"],
     )
开发者ID:yizhongyin,项目名称:OpenstackLiberty,代码行数:14,代码来源:test_mech_driver.py


示例17: test_active_port_count_with_ha_dvr_snat_port

 def test_active_port_count_with_ha_dvr_snat_port(self):
     helpers.register_dhcp_agent()
     helpers.register_l3_agent()
     helpers.register_ovs_agent()
     self._create_ha_router()
     self._setup_port_binding(
         device_owner=constants.DEVICE_OWNER_ROUTER_SNAT,
         device_id=TEST_ROUTER_ID)
     port_count = l2pop_db.get_agent_network_active_port_count(
         self.ctx.session, HOST, TEST_NETWORK_ID)
     self.assertEqual(1, port_count)
     port_count = l2pop_db.get_agent_network_active_port_count(
         self.ctx.session, HOST_2, TEST_NETWORK_ID)
     self.assertEqual(1, port_count)
开发者ID:sebrandon1,项目名称:neutron,代码行数:14,代码来源:test_db.py


示例18: test_ovs_bridge_name_set_when_trunk_bound

 def test_ovs_bridge_name_set_when_trunk_bound(self):
     helpers.register_ovs_agent(host=helpers.HOST)
     with self.port() as port:
         trunk_port_id = port['port']['id']
         trunk_req = {'port_id': trunk_port_id,
                      'tenant_id': 'test_tenant',
                      'sub_ports': []}
         trunk_res = self.trunk_plugin.create_trunk(self.context,
                                                    {'trunk': trunk_req})
         port['port'][pb.HOST_ID] = helpers.HOST
         bound_port = self.core_plugin.update_port(self.context,
                                                   trunk_port_id, port)
         self.assertEqual(
             utils.gen_trunk_br_name(trunk_res['id']),
             bound_port[pb.VIF_DETAILS][pb.VIF_DETAILS_BRIDGE_NAME])
开发者ID:igordcard,项目名称:neutron,代码行数:15,代码来源:test_plugin.py


示例19: test_active_network_ports_with_dvr_snat_port

 def test_active_network_ports_with_dvr_snat_port(self):
     # Test to get agent hosting dvr snat port
     helpers.register_l3_agent()
     helpers.register_dhcp_agent()
     helpers.register_ovs_agent()
     # create DVR router
     self._create_router()
     # setup DVR snat port
     self._setup_port_binding(
         device_owner=constants.DEVICE_OWNER_ROUTER_SNAT,
         device_id=TEST_ROUTER_ID)
     helpers.register_dhcp_agent()
     fdb_network_ports = l2pop_db.get_nondistributed_active_network_ports(
         self.ctx.session, TEST_NETWORK_ID)
     self.assertEqual(1, len(fdb_network_ports))
开发者ID:sebrandon1,项目名称:neutron,代码行数:15,代码来源:test_db.py


示例20: test_active_network_ports_with_ha_dvr_snat_port

 def test_active_network_ports_with_ha_dvr_snat_port(self):
     # test to get HA agents hosting HA+DVR snat port
     helpers.register_dhcp_agent()
     helpers.register_l3_agent()
     helpers.register_ovs_agent()
     # create HA+DVR router
     self._create_ha_router()
     # setup HA snat port
     self._setup_port_binding(
         device_owner=constants.DEVICE_OWNER_ROUTER_SNAT,
         device_id=TEST_ROUTER_ID)
     fdb_network_ports = l2pop_db.get_nondistributed_active_network_ports(
         self.ctx, TEST_NETWORK_ID)
     self.assertEqual(0, len(fdb_network_ports))
     ha_ports = l2pop_db.get_ha_active_network_ports(
         self.ctx, TEST_NETWORK_ID)
     self.assertEqual(2, len(ha_ports))
开发者ID:openstack,项目名称:neutron,代码行数:17,代码来源:test_db.py



注:本文中的neutron.tests.common.helpers.register_ovs_agent函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python l3_test_common.get_subnet_id函数代码示例发布时间:2022-05-27
下一篇:
Python helpers.register_l3_agent函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap