]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: add test cases for vanilla ops commands 52976/head
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 27 Jul 2023 00:46:55 +0000 (20:46 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 9 Oct 2023 15:37:54 +0000 (11:37 -0400)
To test they work, not that the output is useful.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit ca4d0dc42b553352d64c0eb9a8be6487b59b03fe)

Conflicts:
    qa/tasks/cephfs/test_admin.py: dump_blocked_ops_count does not exist in quincy, introduced in 1ead2229aeb1f2cca0f4f4f328cb176443389760

qa/tasks/cephfs/cephfs_test_case.py
qa/tasks/cephfs/test_admin.py

index 129b84790e90371de84af87d11836e87f8a2c11e..d2688929cc37ff534d943dff23be92bfa6edccda 100644 (file)
@@ -13,6 +13,12 @@ from teuthology.exceptions import CommandFailedError
 
 log = logging.getLogger(__name__)
 
+def classhook(m):
+    def dec(cls):
+        getattr(cls, m)()
+        return cls
+    return dec
+
 def for_teuthology(f):
     """
     Decorator that adds an "is_for_teuthology" attribute to the wrapped function
index ff6cd761e3ca6cac980f4bb8cb1c5e8004bcae7e..baf9873b497510ec3c5bdeb79f886c65ce0f8aef 100644 (file)
@@ -9,7 +9,7 @@ from os.path import join as os_path_join
 from teuthology.orchestra.run import Raw
 from teuthology.exceptions import CommandFailedError
 
-from tasks.cephfs.cephfs_test_case import CephFSTestCase
+from tasks.cephfs.cephfs_test_case import CephFSTestCase, classhook
 from tasks.cephfs.filesystem import FileLayout, FSMissing
 from tasks.cephfs.fuse_mount import FuseMount
 from tasks.cephfs.caps_helper import CapsHelper
@@ -38,6 +38,33 @@ class TestAdminCommands(CephFSTestCase):
         if overwrites:
             self.fs.mon_manager.raw_cluster_cmd('osd', 'pool', 'set', n+"-data", 'allow_ec_overwrites', 'true')
 
+@classhook('_add_valid_tell')
+class TestValidTell(TestAdminCommands):
+    @classmethod
+    def _add_valid_tell(cls):
+        tells = [
+          ['cache', 'status'],
+          ['damage', 'ls'],
+          ['dump_blocked_ops'],
+          ['dump_historic_ops'],
+          ['dump_historic_ops_by_duration'],
+          ['dump_mempools'],
+          ['dump_ops_in_flight'],
+          ['flush', 'journal'],
+          ['get', 'subtrees'],
+          ['ops', 'locks'],
+          ['ops'],
+          ['status'],
+          ['version'],
+        ]
+        def test(c):
+            def f(self):
+                J = self.fs.rank_tell(c)
+                json.dumps(J)
+                log.debug("dumped:\n%s", str(J))
+            return f
+        for c in tells:
+            setattr(cls, 'test_valid_' + '_'.join(c), test(c))
 
 class TestFsStatus(TestAdminCommands):
     """