コード例 #1
0
 def setUp(self):
     self.lg = FakeLogger()
     _initxattr()
     _mock_clear_metadata()
     self._saved_df_wm = gluster.swift.obj.diskfile.write_metadata
     self._saved_df_rm = gluster.swift.obj.diskfile.read_metadata
     gluster.swift.obj.diskfile.write_metadata = _mock_write_metadata
     gluster.swift.obj.diskfile.read_metadata = _mock_read_metadata
     self._saved_ut_wm = gluster.swift.common.utils.write_metadata
     self._saved_ut_rm = gluster.swift.common.utils.read_metadata
     gluster.swift.common.utils.write_metadata = _mock_write_metadata
     gluster.swift.common.utils.read_metadata = _mock_read_metadata
     self._saved_do_fsync = gluster.swift.obj.diskfile.do_fsync
     gluster.swift.obj.diskfile.do_fsync = _mock_do_fsync
コード例 #2
0
 def setUp(self):
     self._orig_tpool_exc = tpool.execute
     tpool.execute = lambda f, *args, **kwargs: f(*args, **kwargs)
     self.lg = FakeLogger()
     _initxattr()
     _mock_clear_metadata()
     self._saved_df_wm = gluster.swift.obj.diskfile.write_metadata
     self._saved_df_rm = gluster.swift.obj.diskfile.read_metadata
     gluster.swift.obj.diskfile.write_metadata = _mock_write_metadata
     gluster.swift.obj.diskfile.read_metadata = _mock_read_metadata
     self._saved_ut_wm = gluster.swift.common.utils.write_metadata
     self._saved_ut_rm = gluster.swift.common.utils.read_metadata
     gluster.swift.common.utils.write_metadata = _mock_write_metadata
     gluster.swift.common.utils.read_metadata = _mock_read_metadata
     self._saved_do_fsync = gluster.swift.obj.diskfile.do_fsync
     gluster.swift.obj.diskfile.do_fsync = _mock_do_fsync
     self.td = tempfile.mkdtemp()
     self.conf = dict(devices=self.td, mb_per_sync=2, keep_cache_size=(1024 * 1024), mount_check=False)
     self.mgr = OnDiskManager(self.conf, self.lg)
コード例 #3
0
 def setUp(self):
     self._orig_tpool_exc = tpool.execute
     tpool.execute = lambda f, *args, **kwargs: f(*args, **kwargs)
     self.lg = FakeLogger()
     _initxattr()
     _mock_clear_metadata()
     self._saved_df_wm = swiftonfile.swift.obj.diskfile.write_metadata
     self._saved_df_rm = swiftonfile.swift.obj.diskfile.read_metadata
     swiftonfile.swift.obj.diskfile.write_metadata = _mock_write_metadata
     swiftonfile.swift.obj.diskfile.read_metadata = _mock_read_metadata
     self._saved_ut_wm = swiftonfile.swift.common.utils.write_metadata
     self._saved_ut_rm = swiftonfile.swift.common.utils.read_metadata
     swiftonfile.swift.common.utils.write_metadata = _mock_write_metadata
     swiftonfile.swift.common.utils.read_metadata = _mock_read_metadata
     self._saved_do_fsync = swiftonfile.swift.obj.diskfile.do_fsync
     swiftonfile.swift.obj.diskfile.do_fsync = _mock_do_fsync
     self.td = tempfile.mkdtemp()
     self.conf = dict(devices=self.td, mb_per_sync=2,
                      keep_cache_size=(1024 * 1024), mount_check=False)
     self.mgr = DiskFileManager(self.conf, self.lg)