1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-24 16:55:36 +00:00

Make fuse fs work on OS X

This commit is contained in:
Jonas Borgström 2013-07-27 14:31:28 +02:00
parent beed6b368b
commit 626777405d
2 changed files with 18 additions and 3 deletions

View file

@ -54,6 +54,18 @@ def allocate_inode(self):
self._inode_count += 1
return self._inode_count
def statfs(self):
stat_ = llfuse.StatvfsData()
stat_.f_bsize = 512
stat_.f_frsize = 512
stat_.f_blocks = 0
stat_.f_bfree = 0
stat_.f_bavail = 0
stat_.f_files = 0
stat_.f_ffree = 0
stat_.f_favail = 0
return stat_
def _find_inode(self, path):
segments = os.fsencode(os.path.normpath(path)).split(b'/')
inode = 1
@ -142,7 +154,7 @@ def readlink(self, inode):
return os.fsencode(self.items[inode][b'source'])
def mount(self, mountpoint):
llfuse.init(self, mountpoint, ['fsname=atticfs', 'nonempty', 'ro'])
llfuse.init(self, mountpoint, ['fsname=atticfs', 'ro'])
try:
llfuse.main(single=True)
except:

View file

@ -111,7 +111,7 @@ def create_test_files(self):
os.chown('input/file1', 100, 200)
# File mode
os.chmod('input/file1', 0o7755)
os.chmod('input/dir2', 0o700)
os.chmod('input/dir2', 0o555)
# Block device
os.mknod('input/bdev', 0o600 | stat.S_IFBLK, os.makedev(10, 20))
# Char device
@ -226,7 +226,10 @@ def test_mount(self):
self.wait_for_mount(mountpoint)
self.assert_dirs_equal(self.input_path, os.path.join(mountpoint, 'input'), fuse=True)
finally:
os.system('fusermount -u ' + mountpoint)
if sys.platform.startswith('linux'):
os.system('fusermount -u ' + mountpoint)
else:
os.system('umount ' + mountpoint)
os.rmdir(mountpoint)
# Give the daemon some time to exit
time.sleep(.2)