]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs/test_client_limits.py: trim cache when mounting into subdir
authorYan, Zheng <zyan@redhat.com>
Tue, 15 Mar 2016 08:24:51 +0000 (16:24 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 15 Mar 2016 11:48:01 +0000 (19:48 +0800)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
tasks/cephfs/test_client_limits.py

index ad96c5e29f2d84e7d42a6512dd92359c92024b7c..c6bce44141177a35f890c424082680985312e860 100644 (file)
@@ -159,8 +159,7 @@ class TestClientLimits(CephFSTestCase):
         # Wait for the health warnings. Assume mds can handle 10 request per second at least
         self.wait_for_health("failing to advance its oldest client/flush tid", max_requests / 10)
 
-    @needs_trimming
-    def test_client_cache_size(self):
+    def _test_client_cache_size(self, mount_subdir):
         """
         check if client invalidate kernel dcache according to its cache size config
         """
@@ -169,6 +168,19 @@ class TestClientLimits(CephFSTestCase):
         if not isinstance(self.mount_a, FuseMount):
             raise SkipTest("Require FUSE client to inject client release failure")
 
+        if mount_subdir:
+            # fuse assigns a fix inode number (1) to root inode. But in mounting into
+            # subdir case, the actual inode number of root is not 1. This mismatch
+            # confuses fuse_lowlevel_notify_inval_entry() when invalidating dentries
+            # in root directory.
+            self.mount_a.run_shell(["mkdir", "subdir"])
+            self.mount_a.umount_wait()
+            self.set_conf('client', 'client mountpoint', '/subdir')
+            self.mount_a.mount()
+            self.mount_a.wait_until_mounted()
+            root_ino = self.mount_a.path_to_ino(".")
+            self.assertEqual(root_ino, 1);
+
         dir_path = os.path.join(self.mount_a.mountpoint, "testdir")
 
         mkdir_script = dedent("""
@@ -200,3 +212,8 @@ class TestClientLimits(CephFSTestCase):
             return True
 
         self.wait_until_true(trimmed, 30)
+
+    @needs_trimming
+    def test_client_cache_size(self):
+        self._test_client_cache_size(False)
+        self._test_client_cache_size(True)