示例#1
0
    def setUp(self):
        super(SmbFsTestCase, self).setUp()

        self._FAKE_SMBFS_CONFIG = mock.MagicMock(
            smbfs_oversub_ratio=2,
            smbfs_used_ratio=0.5,
            smbfs_shares_config='/fake/config/path',
            smbfs_default_volume_format='raw',
            smbfs_sparsed_volumes=False)

        self._smbfs_driver = smbfs.SmbfsDriver(configuration=mock.Mock())
        self._smbfs_driver._remotefsclient = mock.Mock()
        self._smbfs_driver._local_volume_dir = mock.Mock(
            return_value=self._FAKE_MNT_POINT)
        self._smbfs_driver._execute = mock.Mock()
        self._smbfs_driver.base = self._FAKE_MNT_BASE
        self._smbfs_driver._alloc_info_file_path = (
            self._FAKE_ALLOCATION_DATA_PATH)
        self.context = context.get_admin_context()

        self.volume = fake_volume.fake_volume_obj(
            self.context,
            id='4f711859-4928-4cb7-801a-a50c37ceaccc',
            size=self._FAKE_VOLUME_SIZE,
            provider_location=self._FAKE_SHARE,
            display_name=self._FAKE_VOLUME_NAME,
            status='available')

        self.snapshot = fake_snapshot.fake_snapshot_obj(
            self.context,
            id=self._FAKE_SNAPSHOT_ID,
            status='available',
            volume_size=1)
        self.snapshot.volume = self.volume
示例#2
0
 def setUp(self):
     super(SmbFsTestCase, self).setUp()
     smbfs.SmbfsDriver.__init__ = lambda x: None
     self._smbfs_driver = smbfs.SmbfsDriver()
     self._smbfs_driver._remotefsclient = mock.Mock()
     self._smbfs_driver._local_volume_dir = mock.Mock(
         return_value=self._FAKE_MNT_POINT)
     self._smbfs_driver._execute = mock.Mock()
     self._smbfs_driver.base = self._FAKE_MNT_BASE
示例#3
0
    def setUp(self):
        super(SmbFsTestCase, self).setUp()

        self._smbfs_driver = smbfs.SmbfsDriver(configuration=mock.Mock())
        self._smbfs_driver._remotefsclient = mock.Mock()
        self._smbfs_driver._local_volume_dir = mock.Mock(
            return_value=self._FAKE_MNT_POINT)
        self._smbfs_driver._execute = mock.Mock()
        self._smbfs_driver.base = self._FAKE_MNT_BASE
示例#4
0
    def setUp(self):
        super(SmbFsTestCase, self).setUp()

        self._smbfs_driver = smbfs.SmbfsDriver(configuration=mock.Mock())
        self._smbfs_driver._remotefsclient = mock.Mock()
        self._smbfs_driver._local_volume_dir = mock.Mock(
            return_value=self._FAKE_MNT_POINT)
        self._smbfs_driver._execute = mock.Mock()
        self._smbfs_driver.base = self._FAKE_MNT_BASE
        self._smbfs_driver._alloc_info_file_path = (
            self._FAKE_ALLOCATION_DATA_PATH)
示例#5
0
    def setUp(self):
        super(SmbFsTestCase, self).setUp()

        self._FAKE_SMBFS_CONFIG = mock.MagicMock(
            smbfs_oversub_ratio = 2,
            smbfs_used_ratio = 0.5,
            smbfs_shares_config = '/fake/config/path',
            smbfs_default_volume_format = 'raw',
            smbfs_sparsed_volumes = False)

        self._smbfs_driver = smbfs.SmbfsDriver(configuration=mock.Mock())
        self._smbfs_driver._remotefsclient = mock.Mock()
        self._smbfs_driver._local_volume_dir = mock.Mock(
            return_value=self._FAKE_MNT_POINT)
        self._smbfs_driver._execute = mock.Mock()
        self._smbfs_driver.base = self._FAKE_MNT_BASE
        self._smbfs_driver._alloc_info_file_path = (
            self._FAKE_ALLOCATION_DATA_PATH)