Skip to content

Commit

Permalink
split hardlinks extraction test into 2, see borgbackup#4350
Browse files Browse the repository at this point in the history
let's see if it always hangs in test 2 now.
  • Loading branch information
ThomasWaldmann committed May 2, 2019
1 parent 8825bd9 commit 942ab35
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/borg/testsuite/archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,18 @@ def test_mount_hardlinks(self):
assert open('input/dir1/subdir/hardlink', 'rb').read() == b'123456'

@requires_hardlinks
def test_extract_hardlinks(self):
def test_extract_hardlinks1(self):
self._extract_hardlinks_setup()
with changedir('output'):
self.cmd('extract', self.repository_location + '::test')
assert os.stat('input/source').st_nlink == 4
assert os.stat('input/abba').st_nlink == 4
assert os.stat('input/dir1/hardlink').st_nlink == 4
assert os.stat('input/dir1/subdir/hardlink').st_nlink == 4
assert open('input/dir1/subdir/hardlink', 'rb').read() == b'123456'

@requires_hardlinks
def test_extract_hardlinks2(self):
self._extract_hardlinks_setup()
with changedir('output'):
self.cmd('extract', self.repository_location + '::test', '--strip-components', '2')
Expand All @@ -840,13 +851,6 @@ def test_extract_hardlinks(self):
assert open('input/dir1/subdir/hardlink', 'rb').read() == b'123456'
assert os.stat('input/dir1/aaaa').st_nlink == 2
assert os.stat('input/dir1/source2').st_nlink == 2
with changedir('output'):
self.cmd('extract', self.repository_location + '::test')
assert os.stat('input/source').st_nlink == 4
assert os.stat('input/abba').st_nlink == 4
assert os.stat('input/dir1/hardlink').st_nlink == 4
assert os.stat('input/dir1/subdir/hardlink').st_nlink == 4
assert open('input/dir1/subdir/hardlink', 'rb').read() == b'123456'

def test_extract_include_exclude(self):
self.cmd('init', '--encryption=repokey', self.repository_location)
Expand Down

0 comments on commit 942ab35

Please sign in to comment.