Пример #1
0
 def setUp(self):
     super(TestCiscoIPsecDriverValidation, self).setUp()
     mock.patch('neutron.common.rpc.create_connection').start()
     self.service_plugin = mock.Mock()
     self.driver = ipsec_driver.CiscoCsrIPsecVPNDriver(self.service_plugin)
     self.context = n_ctx.Context('some_user', 'some_tenant')
     self.vpn_service = mock.Mock()
Пример #2
0
    def setUp(self):
        super(TestCiscoIPsecDriver, self).setUp()
        dbapi.configure_db()
        self.addCleanup(dbapi.clear_db)
        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 = {constants.L3_ROUTER_NAT: plugin}

        service_plugin = mock.Mock()
        service_plugin.get_l3_agents_hosting_routers.return_value = [l3_agent]
        service_plugin._get_vpnservice.return_value = {'router_id': _uuid()}
        self.db_update_mock = service_plugin.update_ipsec_site_conn_status
        self.driver = ipsec_driver.CiscoCsrIPsecVPNDriver(service_plugin)
        self.driver.validate_ipsec_connection = mock.Mock()
        mock.patch.object(csr_db, 'create_tunnel_mapping').start()
        self.context = n_ctx.Context('some_user', 'some_tenant')
Пример #3
0
    def setUp(self):
        super(TestCiscoIPsecDriver, self).setUp()
        mock.patch('neutron.common.rpc.create_connection').start()

        service_plugin = mock.Mock()
        service_plugin.get_host_for_router.return_value = FAKE_HOST
        # TODO(pcm): Remove when Cisco L3 router plugin support available
        mock.patch(
            'neutron.services.vpn.service_drivers.'
            'cisco_cfg_loader.get_host_for_router',
            return_value=FAKE_HOST).start()
        service_plugin._get_vpnservice.return_value = {'router_id': _uuid()}
        get_service_plugin = mock.patch(
            'neutron.manager.NeutronManager.get_service_plugins').start()
        get_service_plugin.return_value = {
            constants.L3_ROUTER_NAT: service_plugin
        }
        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')
Пример #4
0
    def setUp(self):
        super(TestCiscoIPsecDriver, self).setUp()
        mock.patch('neutron.common.rpc.create_connection').start()

        service_plugin = mock.Mock()
        service_plugin._get_vpnservice.return_value = {
            'router_id': _uuid()
        }

        l3_plugin = mock.Mock()
        mock.patch(
            'neutron.manager.NeutronManager.get_service_plugins',
            return_value={constants.L3_ROUTER_NAT: l3_plugin}).start()

        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')
Пример #5
0
    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)