Esempio n. 1
0
    def _configure_agent(self, host, agent_mode='dvr_snat'):
        conf = self._get_config_opts()
        l3_agent_main.register_opts(conf)
        conf.set_override('interface_driver', self.INTERFACE_DRIVER)

        br_int = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
        conf.set_override('ovs_integration_bridge', br_int.br_name)

        temp_dir = self.get_new_temp_dir()
        get_temp_file_path = functools.partial(self.get_temp_file_path,
                                               root=temp_dir)
        conf.set_override('state_path', temp_dir.path)
        conf.set_override('log_file',
                          get_temp_file_path('log_file'))
        conf.set_override('metadata_proxy_socket',
                          get_temp_file_path('metadata_proxy'))
        conf.set_override('ha_confs_path',
                          get_temp_file_path('ha_confs'))
        conf.set_override('external_pids',
                          get_temp_file_path('external/pids'))
        conf.set_override('host', host)
        conf.set_override('agent_mode', agent_mode)
        conf.set_override(
            'root_helper', cfg.CONF.AGENT.root_helper, group='AGENT')
        conf.set_override(
            'root_helper_daemon', cfg.CONF.AGENT.root_helper_daemon,
            group='AGENT')

        return conf
Esempio n. 2
0
    def _configure_agent(self, host):
        conf = self._get_config_opts()
        l3_agent_main.register_opts(conf)
        cfg.CONF.set_override('debug', False)
        agent_config.setup_logging()
        conf.set_override(
            'interface_driver',
            'neutron.agent.linux.interface.OVSInterfaceDriver')
        conf.set_override('router_delete_namespaces', True)
        conf.set_override('root_helper', self.root_helper, group='AGENT')

        br_int = self.create_ovs_bridge()
        br_ex = self.create_ovs_bridge()
        conf.set_override('ovs_integration_bridge', br_int.br_name)
        conf.set_override('external_network_bridge', br_ex.br_name)

        temp_dir = self.get_new_temp_dir()
        get_temp_file_path = functools.partial(self.get_temp_file_path,
                                               root=temp_dir)
        conf.set_override('state_path', temp_dir.path)
        conf.set_override('metadata_proxy_socket',
                          get_temp_file_path('metadata_proxy'))
        conf.set_override('ha_confs_path',
                          get_temp_file_path('ha_confs'))
        conf.set_override('external_pids',
                          get_temp_file_path('external/pids'))
        conf.set_override('host', host)
        agent = l3_test_agent.TestL3NATAgent(host, conf)
        mock.patch.object(ip_lib, 'send_gratuitous_arp').start()

        return agent
Esempio n. 3
0
    def _configure_agent(self, host, agent_mode='dvr_snat'):
        conf = self._get_config_opts()
        l3_agent_main.register_opts(conf)
        conf.set_override(
            'interface_driver',
            'neutron.agent.linux.interface.OVSInterfaceDriver')

        br_int = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
        br_ex = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
        conf.set_override('ovs_integration_bridge', br_int.br_name)
        conf.set_override('external_network_bridge', br_ex.br_name)

        temp_dir = self.get_new_temp_dir()
        get_temp_file_path = functools.partial(self.get_temp_file_path,
                                               root=temp_dir)
        conf.set_override('state_path', temp_dir.path)
        # NOTE(cbrandily): log_file or log_dir must be set otherwise
        # metadata_proxy_watch_log has no effect
        conf.set_override('log_file',
                          get_temp_file_path('log_file'))
        conf.set_override('metadata_proxy_socket',
                          get_temp_file_path('metadata_proxy'))
        conf.set_override('ha_confs_path',
                          get_temp_file_path('ha_confs'))
        conf.set_override('external_pids',
                          get_temp_file_path('external/pids'))
        conf.set_override('host', host)
        conf.set_override('agent_mode', agent_mode)

        return conf
Esempio n. 4
0
    def _configure_agent(self, host):
        """Override specific config options"""
        config = self._get_config_opts()
        l3_agent_main.register_opts(config)
        cfg.CONF.set_override("debug", True)
        agent_config.setup_logging()
        config.set_override("interface_driver", "neutron.agent.linux.interface.OVSInterfaceDriver")

        br_int = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
        br_ex = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
        config.set_override("ovs_integration_bridge", br_int.br_name)
        config.set_override("external_network_bridge", br_ex.br_name)

        temp_dir = self.get_new_temp_dir()
        get_temp_file_path = functools.partial(self.get_temp_file_path, root=temp_dir)
        config.set_override("state_path", temp_dir.path)
        config.set_override("metadata_proxy_socket", get_temp_file_path("metadata_proxy"))
        config.set_override("ha_confs_path", get_temp_file_path("ha_confs"))
        config.set_override("external_pids", get_temp_file_path("external/pids"))
        config.set_override("host", host)
        ipsec_config_base_dir = "%s/%s" % (temp_dir.path, "ipsec")
        config.set_override("config_base_dir", ipsec_config_base_dir, group="ipsec")

        config(["--config-file", self.vpn_agent_ini])

        # Assign ip address to br-ex port because it is a gateway
        ex_port = ip_lib.IPDevice(br_ex.br_name)
        ex_port.addr.add(str(PUBLIC_NET[1]))

        return vpn_agent.VPNAgent(host, config)
Esempio n. 5
0
    def _configure_agent(self, host):
        """Override specific config options"""
        config = self._get_config_opts()
        l3_agent_main.register_opts(config)
        cfg.CONF.set_override('debug', True)
        agent_config.setup_logging()
        config.set_override('extensions', ['vpnaas'], 'agent')
        config.set_override(
            'interface_driver',
            'neutron.agent.linux.interface.OVSInterfaceDriver')

        br_int = self.useFixture(net_helpers.OVSBridgeFixture()).bridge
        config.set_override('ovs_integration_bridge', br_int.br_name)

        temp_dir = self.get_new_temp_dir()
        get_temp_file_path = functools.partial(self.get_temp_file_path,
                                               root=temp_dir)
        config.set_override('state_path', temp_dir.path)
        config.set_override('metadata_proxy_socket',
                          get_temp_file_path('metadata_proxy'))
        config.set_override('ha_confs_path',
                          get_temp_file_path('ha_confs'))
        config.set_override('external_pids',
                          get_temp_file_path('external/pids'))
        config.set_override('host', host)
        ipsec_config_base_dir = '%s/%s' % (temp_dir.path, 'ipsec')
        config.set_override('config_base_dir',
                          ipsec_config_base_dir, group='ipsec')

        # Assign ip address to br-int port because it is a gateway
        ex_port = ip_lib.IPDevice(br_int.br_name)
        ex_port.addr.add(str(PUBLIC_NET[1]))

        return config
Esempio n. 6
0
    def _configure_agent(self, host):
        conf = self._get_config_opts()
        l3_agent_main.register_opts(conf)
        cfg.CONF.set_override('debug', False)
        agent_config.setup_logging()
        conf.set_override(
            'interface_driver',
            'neutron.agent.linux.interface.OVSInterfaceDriver')
        conf.set_override('router_delete_namespaces', True)
        conf.set_override('root_helper', self.root_helper, group='AGENT')

        br_int = self.create_ovs_bridge()
        br_ex = self.create_ovs_bridge()
        conf.set_override('ovs_integration_bridge', br_int.br_name)
        conf.set_override('external_network_bridge', br_ex.br_name)

        temp_dir = self.useFixture(fixtures.TempDir()).path
        conf.set_override('state_path', temp_dir)
        conf.set_override('metadata_proxy_socket',
                          '%s/metadata_proxy' % temp_dir)
        conf.set_override('ha_confs_path',
                          '%s/ha_confs' % temp_dir)
        conf.set_override('external_pids',
                          '%s/external/pids' % temp_dir)
        conf.set_override('host', host)
        agent = l3_test_agent.TestL3NATAgent(host, conf)
        mock.patch.object(agent, '_arping').start()

        return agent
Esempio n. 7
0
def main(manager='dragonflow.neutron.agent.l3.l3_controller_agent.'
         'L3ControllerAgentWithStateReport'):
    l3_agent.register_opts(cfg.CONF)
    common_config.init(sys.argv[1:])
    config.setup_logging()
    cfg.CONF.set_override('router_delete_namespaces', True)
    server = neutron_service.Service.create(
        binary='neutron-l3-controller-agent',
        topic=topics.L3_AGENT,
        report_interval=cfg.CONF.AGENT.report_interval,
        manager=manager)
    service.launch(cfg.CONF, server).wait()