mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-04 06:21:46 +00:00
fuse: add test for hardlinks in versions view
This commit is contained in:
parent
001500ab99
commit
c021cf466a
1 changed files with 7 additions and 0 deletions
|
@ -1453,6 +1453,9 @@ def has_noatime(some_file):
|
|||
def test_fuse_versions_view(self):
|
||||
self.cmd('init', self.repository_location)
|
||||
self.create_regular_file('test', contents=b'first')
|
||||
if are_hardlinks_supported():
|
||||
self.create_regular_file('hardlink1', contents=b'')
|
||||
os.link('input/hardlink1', 'input/hardlink2')
|
||||
self.cmd('create', self.repository_location + '::archive1', 'input')
|
||||
self.create_regular_file('test', contents=b'second')
|
||||
self.cmd('create', self.repository_location + '::archive2', 'input')
|
||||
|
@ -1463,6 +1466,10 @@ def test_fuse_versions_view(self):
|
|||
files = os.listdir(path)
|
||||
assert all(f.startswith('test.') for f in files) # ... with files test.xxxxxxxx in there
|
||||
assert {b'first', b'second'} == {open(os.path.join(path, f), 'rb').read() for f in files}
|
||||
if are_hardlinks_supported():
|
||||
st1 = os.stat(os.path.join(mountpoint, 'input', 'hardlink1', 'hardlink1.00000000'))
|
||||
st2 = os.stat(os.path.join(mountpoint, 'input', 'hardlink2', 'hardlink2.00000000'))
|
||||
assert st1.st_ino == st2.st_ino
|
||||
|
||||
@unittest.skipUnless(has_llfuse, 'llfuse not installed')
|
||||
def test_fuse_allow_damaged_files(self):
|
||||
|
|
Loading…
Reference in a new issue