mirror of https://github.com/borgbackup/borg.git
Merge pull request #4171 from ThomasWaldmann/eisdir-fix
fix EISDIR issues
This commit is contained in:
commit
29cbf5cd53
|
@ -13,11 +13,6 @@ if [[ "$(uname -s)" == "Darwin" ]]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
source ~/.venv/bin/activate
|
# do not use fakeroot, but run as root on travis.
|
||||||
|
# avoids the dreaded EISDIR sporadic failures. see #2482.
|
||||||
if [[ "$(uname -s)" == "Darwin" ]]; then
|
sudo bash -c "source ~/.venv/bin/activate ; tox -e $TOXENV -r"
|
||||||
# no fakeroot on OS X
|
|
||||||
sudo tox -e $TOXENV -r
|
|
||||||
else
|
|
||||||
fakeroot -u tox -r
|
|
||||||
fi
|
|
||||||
|
|
|
@ -1255,14 +1255,14 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
||||||
raise OSError(errno.EACCES, 'EACCES')
|
raise OSError(errno.EACCES, 'EACCES')
|
||||||
|
|
||||||
self.create_regular_file('file')
|
self.create_regular_file('file')
|
||||||
xattr.setxattr(b'input/file', b'attribute', b'value')
|
xattr.setxattr(b'input/file', b'user.attribute', b'value')
|
||||||
self.cmd('init', self.repository_location, '-e' 'none')
|
self.cmd('init', self.repository_location, '-e' 'none')
|
||||||
self.cmd('create', self.repository_location + '::test', 'input')
|
self.cmd('create', self.repository_location + '::test', 'input')
|
||||||
with changedir('output'):
|
with changedir('output'):
|
||||||
input_abspath = os.path.abspath('input/file')
|
input_abspath = os.path.abspath('input/file')
|
||||||
with patch.object(xattr, 'setxattr', patched_setxattr_E2BIG):
|
with patch.object(xattr, 'setxattr', patched_setxattr_E2BIG):
|
||||||
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
|
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
|
||||||
assert '>: Value or key of extended attribute attribute is too big for this filesystem\n' in out
|
assert '>: Value or key of extended attribute user.attribute is too big for this filesystem\n' in out
|
||||||
os.remove(input_abspath)
|
os.remove(input_abspath)
|
||||||
with patch.object(xattr, 'setxattr', patched_setxattr_ENOTSUP):
|
with patch.object(xattr, 'setxattr', patched_setxattr_ENOTSUP):
|
||||||
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
|
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
|
||||||
|
@ -1270,7 +1270,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
||||||
os.remove(input_abspath)
|
os.remove(input_abspath)
|
||||||
with patch.object(xattr, 'setxattr', patched_setxattr_EACCES):
|
with patch.object(xattr, 'setxattr', patched_setxattr_EACCES):
|
||||||
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
|
out = self.cmd('extract', self.repository_location + '::test', exit_code=EXIT_WARNING)
|
||||||
assert '>: Permission denied when setting extended attribute attribute\n' in out
|
assert '>: Permission denied when setting extended attribute user.attribute\n' in out
|
||||||
assert os.path.isfile(input_abspath)
|
assert os.path.isfile(input_abspath)
|
||||||
|
|
||||||
def test_path_normalization(self):
|
def test_path_normalization(self):
|
||||||
|
|
|
@ -6,6 +6,7 @@ import pytest
|
||||||
|
|
||||||
from ..platform.xattr import buffer, split_lstring
|
from ..platform.xattr import buffer, split_lstring
|
||||||
from ..xattr import is_enabled, getxattr, setxattr, listxattr
|
from ..xattr import is_enabled, getxattr, setxattr, listxattr
|
||||||
|
from ..platformflags import is_linux
|
||||||
from . import BaseTestCase
|
from . import BaseTestCase
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,15 +37,19 @@ class XattrTestCase(BaseTestCase):
|
||||||
setxattr(tmp_fn, b'user.foo', b'bar')
|
setxattr(tmp_fn, b'user.foo', b'bar')
|
||||||
setxattr(tmp_fd, b'user.bar', b'foo')
|
setxattr(tmp_fd, b'user.bar', b'foo')
|
||||||
setxattr(tmp_fn, b'user.empty', b'')
|
setxattr(tmp_fn, b'user.empty', b'')
|
||||||
setxattr(tmp_lfn, b'user.linkxattr', b'baz')
|
if not is_linux:
|
||||||
|
# linux does not allow setting user.* xattrs on symlinks
|
||||||
|
setxattr(tmp_lfn, b'user.linkxattr', b'baz')
|
||||||
self.assert_equal_se(listxattr(tmp_fn), [b'user.foo', b'user.bar', b'user.empty'])
|
self.assert_equal_se(listxattr(tmp_fn), [b'user.foo', b'user.bar', b'user.empty'])
|
||||||
self.assert_equal_se(listxattr(tmp_fd), [b'user.foo', b'user.bar', b'user.empty'])
|
self.assert_equal_se(listxattr(tmp_fd), [b'user.foo', b'user.bar', b'user.empty'])
|
||||||
self.assert_equal_se(listxattr(tmp_lfn, follow_symlinks=True), [b'user.foo', b'user.bar', b'user.empty'])
|
self.assert_equal_se(listxattr(tmp_lfn, follow_symlinks=True), [b'user.foo', b'user.bar', b'user.empty'])
|
||||||
self.assert_equal_se(listxattr(tmp_lfn), [b'user.linkxattr'])
|
if not is_linux:
|
||||||
|
self.assert_equal_se(listxattr(tmp_lfn), [b'user.linkxattr'])
|
||||||
self.assert_equal(getxattr(tmp_fn, b'user.foo'), b'bar')
|
self.assert_equal(getxattr(tmp_fn, b'user.foo'), b'bar')
|
||||||
self.assert_equal(getxattr(tmp_fd, b'user.foo'), b'bar')
|
self.assert_equal(getxattr(tmp_fd, b'user.foo'), b'bar')
|
||||||
self.assert_equal(getxattr(tmp_lfn, b'user.foo', follow_symlinks=True), b'bar')
|
self.assert_equal(getxattr(tmp_lfn, b'user.foo', follow_symlinks=True), b'bar')
|
||||||
self.assert_equal(getxattr(tmp_lfn, b'user.linkxattr'), b'baz')
|
if not is_linux:
|
||||||
|
self.assert_equal(getxattr(tmp_lfn, b'user.linkxattr'), b'baz')
|
||||||
self.assert_equal(getxattr(tmp_fn, b'user.empty'), b'')
|
self.assert_equal(getxattr(tmp_fn, b'user.empty'), b'')
|
||||||
|
|
||||||
def test_listxattr_buffer_growth(self):
|
def test_listxattr_buffer_growth(self):
|
||||||
|
|
Loading…
Reference in New Issue