]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/cephfs: test for request caps during lookup/open
authorYan, Zheng <zyan@redhat.com>
Tue, 15 Mar 2016 12:59:50 +0000 (20:59 +0800)
committerGreg Farnum <gfarnum@redhat.com>
Fri, 25 Mar 2016 00:47:53 +0000 (17:47 -0700)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
suites/fs/multiclient/tasks/cephfs_misc_tests.yaml [new file with mode: 0644]
tasks/cephfs/test_misc.py [new file with mode: 0644]

diff --git a/suites/fs/multiclient/tasks/cephfs_misc_tests.yaml b/suites/fs/multiclient/tasks/cephfs_misc_tests.yaml
new file mode 100644 (file)
index 0000000..d168490
--- /dev/null
@@ -0,0 +1,5 @@
+tasks:
+- ceph-fuse:
+- cephfs_test_runner:
+    modules:
+      - tasks.cephfs.test_misc
diff --git a/tasks/cephfs/test_misc.py b/tasks/cephfs/test_misc.py
new file mode 100644 (file)
index 0000000..bd8ba64
--- /dev/null
@@ -0,0 +1,33 @@
+
+from unittest import SkipTest
+from tasks.cephfs.fuse_mount import FuseMount
+from tasks.cephfs.cephfs_test_case import CephFSTestCase
+
+class TestMisc(CephFSTestCase):
+    CLIENTS_REQUIRED = 2
+    def test_getattr_caps(self):
+        """
+        Check if MDS recognizes the 'mask' parameter of open request.
+        The paramter allows client to request caps when opening file
+        """
+
+        if not isinstance(self.mount_a, FuseMount):
+            raise SkipTest("Require FUSE client")
+
+        # Enable debug. Client will requests CEPH_CAP_XATTR_SHARED
+        # on lookup/open
+        self.mount_b.umount_wait()
+        self.set_conf('client', 'client debug getattr caps', 'true')
+        self.mount_b.mount()
+        self.mount_b.wait_until_mounted()
+
+        # create a file and hold it open. MDS will issue CEPH_CAP_EXCL_*
+        # to mount_a
+        p = self.mount_a.open_background("testfile")
+        self.mount_b.wait_for_visible("testfile")
+
+        # this tiggers a lookup request and an open request. The debug
+        # code will check if lookup/open reply contains xattrs
+        self.mount_b.run_shell(["cat", "testfile"])
+
+        self.mount_a.kill_background(p)