浏览代码

fuse: test troublesome xattrs last

Thomas Waldmann 8 年之前
父节点
当前提交
ede3b4a354
共有 1 个文件被更改,包括 14 次插入14 次删除
  1. 14 14
      borg/testsuite/archiver.py

+ 14 - 14
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):