From: Xiubo Li Date: Wed, 5 Jan 2022 05:25:55 +0000 (+0800) Subject: qa: add test for dumpping subtrees X-Git-Tag: v16.2.8~236^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F44622%2Fhead;p=ceph.git qa: add test for dumpping subtrees Fixes: https://tracker.ceph.com/issues/53726 Signed-off-by: Xiubo Li (cherry picked from commit bbc4f4461ff8c043b10ab68c582a02ffec5c8816) --- diff --git a/qa/tasks/cephfs/test_admin.py b/qa/tasks/cephfs/test_admin.py index e9bb48718014f..bbf069066e335 100644 --- a/qa/tasks/cephfs/test_admin.py +++ b/qa/tasks/cephfs/test_admin.py @@ -884,3 +884,29 @@ class TestAdminCommandIdempotency(CephFSTestCase): p = self.fs.rm() self.assertIn("does not exist", p.stderr.getvalue()) self.fs.remove_pools(data_pools) + + +class TestAdminCommandDumpTree(CephFSTestCase): + """ + Tests for administration command subtrees. + """ + + CLIENTS_REQUIRED = 0 + MDSS_REQUIRED = 1 + + def test_dump_subtrees(self): + """ + Dump all the subtrees to make sure the MDS daemon won't crash. + """ + + subtrees = self.fs.mds_asok(['get', 'subtrees']) + log.info(f"dumping {len(subtrees)} subtrees:") + for subtree in subtrees: + log.info(f" subtree: '{subtree['dir']['path']}'") + self.fs.mds_asok(['dump', 'tree', subtree['dir']['path']]) + + log.info("dumping 2 special subtrees:") + log.info(" subtree: '/'") + self.fs.mds_asok(['dump', 'tree', '/']) + log.info(" subtree: '~mdsdir'") + self.fs.mds_asok(['dump', 'tree', '~mdsdir'])