From ede3b4a3549cc1f71e47a2a0e213d94a55e6135d Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Mon, 24 Oct 2016 00:49:03 +0200 Subject: [PATCH] fuse: test troublesome xattrs last --- borg/testsuite/archiver.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/borg/testsuite/archiver.py b/borg/testsuite/archiver.py index cbda687b5..3a1478563 100644 --- a/borg/testsuite/archiver.py +++ b/borg/testsuite/archiver.py @@ -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):