From: Yan, Zheng Date: Tue, 15 Mar 2016 08:24:51 +0000 (+0800) Subject: cephfs/test_client_limits.py: trim cache when mounting into subdir X-Git-Tag: v10.2.6~165^2^2~129^2~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4a65da596216d95f44bc71e0f46f6dae4807aea9;p=ceph.git cephfs/test_client_limits.py: trim cache when mounting into subdir Signed-off-by: Yan, Zheng --- diff --git a/tasks/cephfs/test_client_limits.py b/tasks/cephfs/test_client_limits.py index ad96c5e29f2d..c6bce4414117 100644 --- a/tasks/cephfs/test_client_limits.py +++ b/tasks/cephfs/test_client_limits.py @@ -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)