mirror of
https://github.com/borgbackup/borg.git
synced 2026-05-28 04:03:21 -04:00
fuse: test troublesome xattrs last
This commit is contained in:
parent
48fa449e39
commit
ede3b4a354
1 changed files with 14 additions and 14 deletions
|
|
@ -1069,20 +1069,6 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
|||
# read
|
||||
with open(in_fn, 'rb') as in_f, open(out_fn, 'rb') as out_f:
|
||||
assert in_f.read() == out_f.read()
|
||||
# list/read xattrs
|
||||
in_fn = 'input/fusexattr'
|
||||
out_fn = os.path.join(mountpoint, 'input', 'fusexattr')
|
||||
if not xattr.XATTR_FAKEROOT and xattr.is_enabled(self.input_path):
|
||||
assert no_selinux(xattr.listxattr(out_fn)) == ['user.foo', ]
|
||||
assert xattr.getxattr(out_fn, 'user.foo') == b'bar'
|
||||
else:
|
||||
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"
|
||||
# hardlink (to 'input/file1')
|
||||
in_fn = 'input/hardlink'
|
||||
out_fn = os.path.join(mountpoint, 'input', 'hardlink')
|
||||
|
|
@ -1102,6 +1088,20 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
|||
out_fn = os.path.join(mountpoint, 'input', 'fifo1')
|
||||
sto = os.stat(out_fn)
|
||||
assert stat.S_ISFIFO(sto.st_mode)
|
||||
# list/read xattrs
|
||||
in_fn = 'input/fusexattr'
|
||||
out_fn = os.path.join(mountpoint, 'input', 'fusexattr')
|
||||
if not xattr.XATTR_FAKEROOT and xattr.is_enabled(self.input_path):
|
||||
assert no_selinux(xattr.listxattr(out_fn)) == ['user.foo', ]
|
||||
assert xattr.getxattr(out_fn, 'user.foo') == b'bar'
|
||||
else:
|
||||
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"
|
||||
|
||||
@unittest.skipUnless(has_llfuse, 'llfuse not installed')
|
||||
def test_fuse_allow_damaged_files(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue