mirror of https://github.com/borgbackup/borg.git
fuse tests: catch ENOTSUP on freebsd
seems like fuse does not support xattrs there at all.
This commit is contained in:
parent
ede3b4a354
commit
02ecf04780
|
@ -1089,19 +1089,26 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
||||||
sto = os.stat(out_fn)
|
sto = os.stat(out_fn)
|
||||||
assert stat.S_ISFIFO(sto.st_mode)
|
assert stat.S_ISFIFO(sto.st_mode)
|
||||||
# list/read xattrs
|
# list/read xattrs
|
||||||
in_fn = 'input/fusexattr'
|
try:
|
||||||
out_fn = os.path.join(mountpoint, 'input', 'fusexattr')
|
in_fn = 'input/fusexattr'
|
||||||
if not xattr.XATTR_FAKEROOT and xattr.is_enabled(self.input_path):
|
out_fn = os.path.join(mountpoint, 'input', 'fusexattr')
|
||||||
assert no_selinux(xattr.listxattr(out_fn)) == ['user.foo', ]
|
if not xattr.XATTR_FAKEROOT and xattr.is_enabled(self.input_path):
|
||||||
assert xattr.getxattr(out_fn, 'user.foo') == b'bar'
|
assert no_selinux(xattr.listxattr(out_fn)) == ['user.foo', ]
|
||||||
else:
|
assert xattr.getxattr(out_fn, 'user.foo') == b'bar'
|
||||||
assert xattr.listxattr(out_fn) == []
|
|
||||||
try:
|
|
||||||
xattr.getxattr(out_fn, 'user.foo')
|
|
||||||
except OSError as e:
|
|
||||||
assert e.errno == llfuse.ENOATTR
|
|
||||||
else:
|
else:
|
||||||
assert False, "expected OSError(ENOATTR), but no error was raised"
|
assert xattr.listxattr(out_fn) == []
|
||||||
|
try:
|
||||||
|
xattr.getxattr(out_fn, 'user.foo')
|
||||||
|
except OSError as e:
|
||||||
|
assert e.errno == llfuse.ENOATTR
|
||||||
|
else:
|
||||||
|
assert False, "expected OSError(ENOATTR), but no error was raised"
|
||||||
|
except OSError as err:
|
||||||
|
if sys.platform.startswith(('freebsd', )) and err.errno == errno.ENOTSUP:
|
||||||
|
# some systems have no xattr support on FUSE
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
@unittest.skipUnless(has_llfuse, 'llfuse not installed')
|
@unittest.skipUnless(has_llfuse, 'llfuse not installed')
|
||||||
def test_fuse_allow_damaged_files(self):
|
def test_fuse_allow_damaged_files(self):
|
||||||
|
|
Loading…
Reference in New Issue