def rpc_init(sc, conf): fwrpcmgr = fw.FwAgent(conf, sc) fwagent = RpcAgent(sc, host=cfg.CONF.host, topic=a_topics.FW_NFP_CONFIGAGENT_TOPIC, manager=fwrpcmgr) lbv2_report_state = { 'binary': 'NCO', 'host': cfg.CONF.host, 'topic': a_topics.LBV2_NFP_CONFIGAGENT_TOPIC, 'plugin_topic': a_topics.LBV2_NFP_PLUGIN_TOPIC, 'agent_type': 'NFP Loadbalancer V2 agent', 'configurations': { 'device_drivers': ['loadbalancerv2'] }, 'start_flag': True, 'report_interval': 10 } lbv2rpcmgr = lbv2.Lbv2Agent(conf, sc) lbv2agent = RpcAgent(sc, host=cfg.CONF.host, topic=a_topics.LBV2_NFP_CONFIGAGENT_TOPIC, manager=lbv2rpcmgr, report_state=lbv2_report_state) vpn_report_state = { 'binary': 'NCO', 'host': cfg.CONF.host, 'topic': a_topics.VPN_NFP_CONFIGAGENT_TOPIC, 'plugin_topic': a_topics.VPN_NFP_PLUGIN_TOPIC, 'agent_type': 'NFP Vpn agent', 'configurations': { 'device_drivers': ['vpn'] }, 'start_flag': True, 'report_interval': 10 } vpnrpcmgr = vpn.VpnAgent(conf, sc) vpnagent = RpcAgent(sc, host=cfg.CONF.host, topic=a_topics.VPN_NFP_CONFIGAGENT_TOPIC, manager=vpnrpcmgr, report_state=vpn_report_state) rpchandler = notif_handler.RpcHandler(conf, sc) rpcagent = RpcAgent( sc, host=cfg.CONF.host, topic=a_topics.CONFIG_ORCH_TOPIC, manager=rpchandler, ) sc.register_rpc_agents([fwagent, lbv2agent, vpnagent, rpcagent])
def setUp(self): super(VPNTestCase, self).setUp() self.conf = Conf() self.vpn_handler = vpn.VpnAgent(self.conf, 'sc') self.context = TestContext().get_context() import_path = "neutron_vpnaas.db.vpn.vpn_db.VPNPluginDb" self.import_gvs_api = import_path + '.get_vpnservices' self.import_gikp_api = import_path + '.get_ikepolicies' self.import_gipsp_api = import_path + '.get_ipsecpolicies' self.import_gisc_api = import_path + '.get_ipsec_site_connections' self.import_lib = 'gbpservice.nfp.lib.transport' self._call = 'oslo_messaging.rpc.client._CallContext.call'