Skip to content

Commit

Permalink
fix tests for new xattr exception handler, see #5583
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasWaldmann committed Dec 24, 2020
1 parent d53ecb3 commit 586351e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/borg/testsuite/archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1309,16 +1309,15 @@ def patched_setxattr_EACCES(*args, **kwargs):
input_abspath = os.path.abspath('input/file')
with patch.object(xattr, 'setxattr', patched_setxattr_E2BIG):
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
assert out == (input_abspath + ': Value or key of extended attribute user.attribute is too big for this '
'filesystem\n')
assert out == (input_abspath + ': when setting extended attribute user.attribute: too big for this filesystem\n')
os.remove(input_abspath)
with patch.object(xattr, 'setxattr', patched_setxattr_ENOTSUP):
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
assert out == (input_abspath + ': Extended attributes are not supported on this filesystem\n')
assert out == (input_abspath + ': when setting extended attribute user.attribute: xattrs not supported on this filesystem\n')
os.remove(input_abspath)
with patch.object(xattr, 'setxattr', patched_setxattr_EACCES):
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
assert out == (input_abspath + ': Permission denied when setting extended attribute user.attribute\n')
assert out == (input_abspath + ': when setting extended attribute user.attribute: Permission denied\n')
assert os.path.isfile(input_abspath)

def test_path_normalization(self):
Expand Down

0 comments on commit 586351e

Please sign in to comment.