Пример #1
0
 def setUp(self):
     super(TestCiscoValidatorSelection, self).setUp()
     # TODO(armax): remove this if branch as soon as the ServiceTypeManager
     # API for adding provider configurations becomes available
     if not hasattr(st_db.ServiceTypeManager, 'add_provider_configuration'):
         vpnaas_provider = (constants.VPN + ':vpnaas:' +
                            CISCO_IPSEC_SERVICE_DRIVER + ':default')
         cfg.CONF.set_override('service_provider', [vpnaas_provider],
                               'service_providers')
     else:
         vpnaas_provider = [{
             'service_type': constants.VPN,
             'name': 'vpnaas',
             'driver': CISCO_IPSEC_SERVICE_DRIVER,
             'default': True
         }]
         # override the default service provider
         self.service_providers = (mock.patch.object(
             st_db.ServiceTypeManager, 'get_service_providers').start())
         self.service_providers.return_value = vpnaas_provider
     mock.patch('neutron.common.rpc.create_connection').start()
     stm = st_db.ServiceTypeManager()
     stm.get_provider_names_by_resource_ids = mock.Mock(return_value={})
     mock.patch('neutron.db.servicetype_db.ServiceTypeManager.get_instance',
                return_value=stm).start()
     mock.patch('neutron_vpnaas.db.vpn.vpn_db.VPNPluginDb.get_vpnservices',
                return_value=[]).start()
     self.vpn_plugin = vpn_plugin.VPNDriverPlugin()
Пример #2
0
 def setUp(self):
     super(TestCiscoValidatorSelection, self).setUp()
     vpnaas_provider = (constants.VPN + ':vpnaas:' +
                        CISCO_IPSEC_SERVICE_DRIVER + ':default')
     cfg.CONF.set_override('service_provider', [vpnaas_provider],
                           'service_providers')
     stm = st_db.ServiceTypeManager()
     mock.patch('neutron.db.servicetype_db.ServiceTypeManager.get_instance',
                return_value=stm).start()
     mock.patch('neutron.common.rpc.create_connection').start()
     self.vpn_plugin = vpn_plugin.VPNDriverPlugin()
Пример #3
0
 def vpnservices_providers_set(self, vpnservices=None, provider_names=None):
     if not vpnservices:
         vpnservices = []
     if not provider_names:
         provider_names = {}
     stm = st_db.ServiceTypeManager()
     stm.get_provider_names_by_resource_ids = mock.Mock(
         return_value=provider_names)
     mock.patch('neutron.db.servicetype_db.ServiceTypeManager.get_instance',
                return_value=stm).start()
     mock.patch('neutron_vpnaas.db.vpn.vpn_db.VPNPluginDb.get_vpnservices',
                return_value=vpnservices).start()
     yield stm
Пример #4
0
 def setUp(self):
     super(TestValidatorSelection, self).setUp()
     vpnaas_provider = [{
         'service_type': nconstants.VPN,
         'name': 'vpnaas',
         'driver': IPSEC_SERVICE_DRIVER,
         'default': True
     }]
     # override the default service provider
     self.service_providers = (mock.patch.object(
         st_db.ServiceTypeManager, 'get_service_providers').start())
     self.service_providers.return_value = vpnaas_provider
     mock.patch('neutron.common.rpc.create_connection').start()
     stm = st_db.ServiceTypeManager()
     mock.patch('neutron.db.servicetype_db.ServiceTypeManager.get_instance',
                return_value=stm).start()
     self.vpn_plugin = vpn_plugin.VPNDriverPlugin()
Пример #5
0
 def setUp(self):
     super(TestValidatorSelection, self).setUp()
     vpnaas_provider = [{
         'service_type': constants.VPN,
         'name': 'vpnaas',
         'driver': IPSEC_SERVICE_DRIVER,
         'default': True
     }]
     # override the default service provider
     self.service_providers = (mock.patch.object(
         st_db.ServiceTypeManager, 'get_service_providers').start())
     self.service_providers.return_value = vpnaas_provider
     mock.patch('neutron_lib.rpc.Connection').start()
     stm = st_db.ServiceTypeManager()
     stm.get_provider_names_by_resource_ids = mock.Mock(return_value={})
     mock.patch('neutron.db.servicetype_db.ServiceTypeManager.get_instance',
                return_value=stm).start()
     mock.patch('neutron_vpnaas.db.vpn.vpn_db.VPNPluginDb.get_vpnservices',
                return_value=[]).start()
     self.vpn_plugin = vpn_plugin.VPNDriverPlugin()