]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: add test cases for vanilla ops commands 52547/head
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 27 Jul 2023 00:46:55 +0000 (20:46 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 8 Aug 2023 12:58:42 +0000 (08:58 -0400)
To test they work, not that the output is useful.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
qa/tasks/cephfs/cephfs_test_case.py
qa/tasks/cephfs/test_admin.py

index 968bce4093fce16bd3c926c047365064ccdb90a7..7c9cb6aae472ef0c55f5068ddd4e78a7b91c9722 100644 (file)
@@ -12,6 +12,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 76614fff7f0715dd65720b637e6b7ccaf5b4449b..69ac3b56cca0990df5c7f3c9f2a8a96649e710c1 100644 (file)
@@ -8,7 +8,7 @@ from os.path import join as os_path_join
 
 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 CapTester
@@ -37,6 +37,34 @@ class TestAdminCommands(CephFSTestCase):
         if overwrites:
             self.run_ceph_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_blocked_ops_count'],
+          ['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):
     """