From bbc4f4461ff8c043b10ab68c582a02ffec5c8816 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Wed, 5 Jan 2022 13:25:55 +0800 Subject: [PATCH] qa: add test for dumpping subtrees Fixes: https://tracker.ceph.com/issues/53726 Signed-off-by: Xiubo Li --- qa/tasks/cephfs/test_admin.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/qa/tasks/cephfs/test_admin.py b/qa/tasks/cephfs/test_admin.py index d7a083d72ec..ff6cd761e3c 100644 --- a/qa/tasks/cephfs/test_admin.py +++ b/qa/tasks/cephfs/test_admin.py @@ -1071,3 +1071,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'])