def setUp(self): super(TestIPsecDriver, self).setUp() mock.patch('neutron.common.rpc.create_connection').start() l3_agent = mock.Mock() l3_agent.host = FAKE_HOST plugin = mock.Mock() plugin.get_l3_agents_hosting_routers.return_value = [l3_agent] directory.add_plugin(constants.CORE, plugin) directory.add_plugin(constants.L3, plugin) self.svc_plugin = mock.Mock() self.svc_plugin.get_l3_agents_hosting_routers.return_value = [l3_agent] self._fake_vpn_router_id = _uuid() self.svc_plugin._get_vpnservice.return_value = { 'router_id': self._fake_vpn_router_id } self.driver = ipsec_driver.IPsecVPNDriver(self.svc_plugin)
def setUp(self): super(TestIPsecDriver, self).setUp() mock.patch('neutron.common.rpc.create_connection').start() l3_agent = mock.Mock() l3_agent.host = FAKE_HOST plugin = mock.Mock() plugin.get_l3_agents_hosting_routers.return_value = [l3_agent] plugin_p = mock.patch('neutron.manager.NeutronManager.get_plugin') get_plugin = plugin_p.start() get_plugin.return_value = plugin service_plugin_p = mock.patch( 'neutron.manager.NeutronManager.get_service_plugins') get_service_plugin = service_plugin_p.start() get_service_plugin.return_value = {nconstants.L3_ROUTER_NAT: plugin} self.svc_plugin = mock.Mock() self.svc_plugin.get_l3_agents_hosting_routers.return_value = [l3_agent] self._fake_vpn_router_id = _uuid() self.svc_plugin._get_vpnservice.return_value = { 'router_id': self._fake_vpn_router_id } self.driver = ipsec_driver.IPsecVPNDriver(self.svc_plugin)