Example #1
0
    def setUp(self):
        super(ServiceInstanceManagerTestCase, self).setUp()
        self._context = context.get_admin_context()

        self._helper_cifs = mock.Mock()
        self._helper_nfs = mock.Mock()
        self._db = mock.Mock()
        self.stubs.Set(service_instance.neutron, 'API', fake_network.API)
        self.stubs.Set(service_instance.compute, 'API', fake_compute.API)
        with mock.patch.object(service_instance.ServiceInstanceManager,
                               '_setup_connectivity_with_service_instances',
                               mock.Mock()):
            self._manager = service_instance.ServiceInstanceManager(
                self._db, {})
        self._manager.service_tenant_id = 'service tenant id'
        self._manager.service_network_id = 'service network id'
        self._manager.admin_context = self._context
        self._manager._execute = mock.Mock(return_value=('', ''))
        self._manager.vif_driver = mock.Mock()
        self.stubs.Set(utils, 'synchronized',
                       mock.Mock(return_value=lambda f: f))
        self.stubs.Set(service_instance.os.path, 'exists',
                       mock.Mock(return_value=True))
        self._manager._helpers = {
            'CIFS': self._helper_cifs,
            'NFS': self._helper_nfs,
        }
        self.share = fake_share()
Example #2
0
 def __init__(self, *args, **kwargs):
     """Do initialization."""
     super(GenericShareDriver, self).__init__([False, True], *args,
                                              **kwargs)
     self.admin_context = context.get_admin_context()
     self.configuration.append_config_values(share_opts)
     self._helpers = {}
     self.backend_name = self.configuration.safe_get(
         'share_backend_name') or "Cinder_Volumes"
     self.ssh_connections = {}
     self.service_instance_manager = (
         service_instance.ServiceInstanceManager(
             driver_config=self.configuration))
Example #3
0
 def __init__(self, db, *args, **kwargs):
     """Do initialization."""
     super(GenericShareDriver, self).__init__(*args, **kwargs)
     self.admin_context = context.get_admin_context()
     self.db = db
     self.configuration.append_config_values(share_opts)
     self.configuration.append_config_values(service_instance.server_opts)
     self.mode = self.get_driver_mode([
         const.MULTI_SVM_MODE,
     ])
     self._helpers = {}
     self.backend_name = self.configuration.safe_get(
         'share_backend_name') or "Cinder_Volumes"
     self.ssh_connections = {}
     self.service_instance_manager = (
         service_instance.ServiceInstanceManager(
             self.db, driver_config=self.configuration))
Example #4
0
 def _setup_service_instance_manager(self):
     self.service_instance_manager = (
         service_instance.ServiceInstanceManager(
             driver_config=self.configuration))