Exemple #1
0
 def create_agent(self,
                  create_tunnels=True,
                  ancillary_bridge=None,
                  local_ip='192.168.10.1'):
     if create_tunnels:
         tunnel_types = [n_const.TYPE_VXLAN]
     else:
         tunnel_types = None
     bridge_mappings = ['physnet:%s' % self.br_phys]
     self.config.set_override('tunnel_types', tunnel_types, "AGENT")
     self.config.set_override('polling_interval', 1, "AGENT")
     self.config.set_override('local_ip', local_ip, "OVS")
     self.config.set_override('bridge_mappings', bridge_mappings, "OVS")
     # Physical bridges should be created prior to running
     self._bridge_classes()['br_phys'](self.br_phys).create()
     ext_mgr = ext_manager.L2AgentExtensionsManager(self.config)
     with mock.patch.object(ovs_qos_driver.QosOVSAgentDriver,
                            '_qos_bandwidth_initialize'):
         agent = ovs_agent.OVSNeutronAgent(self._bridge_classes(), ext_mgr,
                                           self.config)
     self.addCleanup(self.ovs.delete_bridge, self.br_int)
     if tunnel_types:
         self.addCleanup(self.ovs.delete_bridge, self.br_tun)
     self.addCleanup(self.ovs.delete_bridge, self.br_phys)
     agent.sg_agent = mock.Mock()
     agent.ancillary_brs = []
     if ancillary_bridge:
         agent.ancillary_brs.append(ancillary_bridge)
     return agent
Exemple #2
0
 def init_extension_manager(self, connection):
     ext_manager.register_opts(cfg.CONF)
     self.ext_manager = (ext_manager.L2AgentExtensionsManager(cfg.CONF))
     agent_api = self.mgr.get_agent_api(sg_agent=self.sg_agent)
     self.ext_manager.initialize(connection,
                                 self.mgr.get_extension_driver_type(),
                                 agent_api)
 def setUp(self):
     super(TestL2AgentExtensionsManager, self).setUp()
     mock.patch('neutron.agent.l2.extensions.qos.QosAgentExtension',
                autospec=True).start()
     conf = cfg.CONF
     l2_ext_manager.register_opts(conf)
     cfg.CONF.set_override('extensions', ['qos'], 'agent')
     self.manager = l2_ext_manager.L2AgentExtensionsManager(conf)
Exemple #4
0
 def _create_agent_extension_manager(self, connection):
     ext_manager.register_opts(self.conf)
     mgr = ext_manager.L2AgentExtensionsManager(self.conf)
     mgr.initialize(connection, 'sriov')
     return mgr