def setUp(self): super(TestCiscoIPsecDriver, self).setUp() mock.patch('neutron.common.rpc.create_connection').start() self._fake_vpn_router_id = _uuid() service_plugin = mock.Mock() service_plugin._get_vpnservice.return_value = { 'router_id': self._fake_vpn_router_id } l3_plugin = mock.Mock() directory.add_plugin(lib_const.L3, l3_plugin) l3_plugin.get_host_for_router.return_value = FAKE_HOST l3_agent = mock.Mock() l3_agent.host = 'some-host' l3_plugin.get_l3_agents_hosting_routers.return_value = [l3_agent] self.driver = ipsec_driver.CiscoCsrIPsecVPNDriver(service_plugin) mock.patch.object(csr_db, 'create_tunnel_mapping').start() self.context = n_ctx.Context('some_user', 'some_tenant')
def setUp(self): super(TestCiscoIPsecDriverRequests, self).setUp() mock.patch('neutron.common.rpc.create_connection').start() service_plugin = mock.Mock() self.driver = ipsec_driver.CiscoCsrIPsecVPNDriver(service_plugin)