]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: selftest for `cephfs-top` utility
authorVenky Shankar <vshankar@redhat.com>
Mon, 16 Nov 2020 11:45:48 +0000 (06:45 -0500)
committerVenky Shankar <vshankar@redhat.com>
Mon, 11 Jan 2021 11:15:53 +0000 (06:15 -0500)
Signed-off-by: Venky Shankar <vshankar@redhat.com>
16 files changed:
qa/cephfs/begin.yaml
qa/suites/fs/top/% [new file with mode: 0644]
qa/suites/fs/top/.qa [new symlink]
qa/suites/fs/top/begin.yaml [new symlink]
qa/suites/fs/top/cluster/+ [new file with mode: 0644]
qa/suites/fs/top/cluster/1-node.yaml [new file with mode: 0644]
qa/suites/fs/top/mount/.qa [new symlink]
qa/suites/fs/top/mount/fuse.yaml [new symlink]
qa/suites/fs/top/objectstore/.qa [new symlink]
qa/suites/fs/top/objectstore/bluestore-bitmap.yaml [new symlink]
qa/suites/fs/top/overrides/.qa [new symlink]
qa/suites/fs/top/overrides/whitelist_health.yaml [new symlink]
qa/suites/fs/top/supported-random-distros$ [new symlink]
qa/suites/fs/top/tasks/.qa [new symlink]
qa/suites/fs/top/tasks/fstop.yaml [new file with mode: 0644]
qa/tasks/cephfs/test_fstop.py [new file with mode: 0644]

index 082f295406700c0380fdeaea7e5e1a4ed1756266..d63591f974e7ddae61986c15d23495d363713aed 100644 (file)
@@ -6,9 +6,11 @@ tasks:
       extra_packages:
         rpm:
         - python3-cephfs
+        - cephfs-top
         deb:
         - python3-cephfs
         - cephfs-shell
+        - cephfs-top
       # For kernel_untar_build workunit
       extra_system_packages:
         deb:
diff --git a/qa/suites/fs/top/% b/qa/suites/fs/top/%
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/qa/suites/fs/top/.qa b/qa/suites/fs/top/.qa
new file mode 120000 (symlink)
index 0000000..fea2489
--- /dev/null
@@ -0,0 +1 @@
+../.qa
\ No newline at end of file
diff --git a/qa/suites/fs/top/begin.yaml b/qa/suites/fs/top/begin.yaml
new file mode 120000 (symlink)
index 0000000..311d404
--- /dev/null
@@ -0,0 +1 @@
+.qa/cephfs/begin.yaml
\ No newline at end of file
diff --git a/qa/suites/fs/top/cluster/+ b/qa/suites/fs/top/cluster/+
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/qa/suites/fs/top/cluster/1-node.yaml b/qa/suites/fs/top/cluster/1-node.yaml
new file mode 100644 (file)
index 0000000..c5313bb
--- /dev/null
@@ -0,0 +1,10 @@
+meta:
+- desc: 1 ceph cluster with 1 mon, 1 mgr, 3 osds, 1 mds
+roles:
+- - mon.a
+  - mgr.x
+  - mds.a
+  - osd.0
+  - osd.1
+  - osd.2
+  - client.0
diff --git a/qa/suites/fs/top/mount/.qa b/qa/suites/fs/top/mount/.qa
new file mode 120000 (symlink)
index 0000000..fea2489
--- /dev/null
@@ -0,0 +1 @@
+../.qa
\ No newline at end of file
diff --git a/qa/suites/fs/top/mount/fuse.yaml b/qa/suites/fs/top/mount/fuse.yaml
new file mode 120000 (symlink)
index 0000000..0e55da9
--- /dev/null
@@ -0,0 +1 @@
+.qa/cephfs/mount/fuse.yaml
\ No newline at end of file
diff --git a/qa/suites/fs/top/objectstore/.qa b/qa/suites/fs/top/objectstore/.qa
new file mode 120000 (symlink)
index 0000000..fea2489
--- /dev/null
@@ -0,0 +1 @@
+../.qa
\ No newline at end of file
diff --git a/qa/suites/fs/top/objectstore/bluestore-bitmap.yaml b/qa/suites/fs/top/objectstore/bluestore-bitmap.yaml
new file mode 120000 (symlink)
index 0000000..a59cf51
--- /dev/null
@@ -0,0 +1 @@
+.qa/objectstore/bluestore-bitmap.yaml
\ No newline at end of file
diff --git a/qa/suites/fs/top/overrides/.qa b/qa/suites/fs/top/overrides/.qa
new file mode 120000 (symlink)
index 0000000..fea2489
--- /dev/null
@@ -0,0 +1 @@
+../.qa
\ No newline at end of file
diff --git a/qa/suites/fs/top/overrides/whitelist_health.yaml b/qa/suites/fs/top/overrides/whitelist_health.yaml
new file mode 120000 (symlink)
index 0000000..3f8d0af
--- /dev/null
@@ -0,0 +1 @@
+./.qa/cephfs/overrides/whitelist_health.yaml
\ No newline at end of file
diff --git a/qa/suites/fs/top/supported-random-distros$ b/qa/suites/fs/top/supported-random-distros$
new file mode 120000 (symlink)
index 0000000..0862b44
--- /dev/null
@@ -0,0 +1 @@
+.qa/distros/supported-random-distro$
\ No newline at end of file
diff --git a/qa/suites/fs/top/tasks/.qa b/qa/suites/fs/top/tasks/.qa
new file mode 120000 (symlink)
index 0000000..fea2489
--- /dev/null
@@ -0,0 +1 @@
+../.qa
\ No newline at end of file
diff --git a/qa/suites/fs/top/tasks/fstop.yaml b/qa/suites/fs/top/tasks/fstop.yaml
new file mode 100644 (file)
index 0000000..406f680
--- /dev/null
@@ -0,0 +1,4 @@
+tasks:
+  - cephfs_test_runner:
+      modules:
+        - tasks.cephfs.test_fstop
diff --git a/qa/tasks/cephfs/test_fstop.py b/qa/tasks/cephfs/test_fstop.py
new file mode 100644 (file)
index 0000000..0861780
--- /dev/null
@@ -0,0 +1,27 @@
+import logging
+
+from tasks.cephfs.cephfs_test_case import CephFSTestCase
+from teuthology.exceptions import CommandFailedError
+
+log = logging.getLogger(__name__)
+
+class TestFSTop(CephFSTestCase):
+    def test_fstop_non_existent_cluster(self):
+        self.mgr_cluster.mon_manager.raw_cluster_cmd("mgr", "module", "enable", "stats")
+        try:
+            self.mount_a.run_shell(['cephfs-top',
+                                    '--cluster=hpec',
+                                    '--id=admin',
+                                    '--selftest'])
+        except CommandFailedError:
+            pass
+        else:
+            raise RuntimeError('expected cephfs-top command to fail.')
+        self.mgr_cluster.mon_manager.raw_cluster_cmd("mgr", "module", "disable", "stats")
+
+    def test_fstop(self):
+        self.mgr_cluster.mon_manager.raw_cluster_cmd("mgr", "module", "enable", "stats")
+        self.mount_a.run_shell(['cephfs-top',
+                                '--id=admin',
+                                '--selftest'])
+        self.mgr_cluster.mon_manager.raw_cluster_cmd("mgr", "module", "disable", "stats")