]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: add test for dumpping subtrees 44622/head
authorXiubo Li <xiubli@redhat.com>
Wed, 5 Jan 2022 05:25:55 +0000 (13:25 +0800)
committerXiubo Li <xiubli@redhat.com>
Tue, 18 Jan 2022 01:51:50 +0000 (09:51 +0800)
Fixes: https://tracker.ceph.com/issues/53726
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit bbc4f4461ff8c043b10ab68c582a02ffec5c8816)

qa/tasks/cephfs/test_admin.py

index e9bb48718014f42561ea37db3a6860f9a499739a..bbf069066e335d16ec71a371da91a21f774d295d 100644 (file)
@@ -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'])