From ffd6d51b2c0ff09271f31f5026f14ceddd3a9029 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 24 Dec 2022 15:20:44 +0100 Subject: [PATCH] fix xattr tests while fixing #6988, some strings were changed, but the tests not adapted: https://github.com/borgbackup/borg/commit/a758fda0899f4654d6274db1b3c59427b6042dac --- src/borg/testsuite/archiver.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/borg/testsuite/archiver.py b/src/borg/testsuite/archiver.py index 2e6f4e0ae..e4f293be0 100644 --- a/src/borg/testsuite/archiver.py +++ b/src/borg/testsuite/archiver.py @@ -1399,8 +1399,8 @@ class ArchiverTestCase(ArchiverTestCaseBase): def patched_setxattr_E2BIG(*args, **kwargs): raise OSError(errno.E2BIG, 'E2BIG') - def patched_setxattr_ENOTSUP(*args, **kwargs): - raise OSError(errno.ENOTSUP, 'ENOTSUP') + def patched_setxattr_ENOSPC(*args, **kwargs): + raise OSError(errno.ENOSPC, 'ENOSPC') def patched_setxattr_EACCES(*args, **kwargs): raise OSError(errno.EACCES, 'EACCES') @@ -1413,15 +1413,15 @@ class ArchiverTestCase(ArchiverTestCaseBase): 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 ': when setting extended attribute user.attribute: too big for this filesystem\n' in out + assert 'when setting extended attribute user.attribute: too big for this filesystem' in out os.remove(input_abspath) - with patch.object(xattr, 'setxattr', patched_setxattr_ENOTSUP): + with patch.object(xattr, 'setxattr', patched_setxattr_ENOSPC): out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING) - assert ': when setting extended attribute user.attribute: xattrs not supported on this filesystem\n' in out + assert 'when setting extended attribute user.attribute: fs full or xattr too big?' in out 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 ': when setting extended attribute user.attribute: Permission denied\n' in out + assert 'when setting extended attribute user.attribute:' in out assert os.path.isfile(input_abspath) def test_path_normalization(self):