From: Venky Shankar Date: Mon, 16 Nov 2020 11:45:48 +0000 (-0500) Subject: test: selftest for `cephfs-top` utility X-Git-Tag: v16.1.0~84^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0329d9b8843f123e1cdef367606c5931a22fb5ee;p=ceph.git test: selftest for `cephfs-top` utility Signed-off-by: Venky Shankar --- diff --git a/qa/cephfs/begin.yaml b/qa/cephfs/begin.yaml index 082f29540670..d63591f974e7 100644 --- a/qa/cephfs/begin.yaml +++ b/qa/cephfs/begin.yaml @@ -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 index 000000000000..e69de29bb2d1 diff --git a/qa/suites/fs/top/.qa b/qa/suites/fs/top/.qa new file mode 120000 index 000000000000..fea2489fdf6d --- /dev/null +++ b/qa/suites/fs/top/.qa @@ -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 index 000000000000..311d404f7c27 --- /dev/null +++ b/qa/suites/fs/top/begin.yaml @@ -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 index 000000000000..e69de29bb2d1 diff --git a/qa/suites/fs/top/cluster/1-node.yaml b/qa/suites/fs/top/cluster/1-node.yaml new file mode 100644 index 000000000000..c5313bb0492a --- /dev/null +++ b/qa/suites/fs/top/cluster/1-node.yaml @@ -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 index 000000000000..fea2489fdf6d --- /dev/null +++ b/qa/suites/fs/top/mount/.qa @@ -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 index 000000000000..0e55da9fb7ab --- /dev/null +++ b/qa/suites/fs/top/mount/fuse.yaml @@ -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 index 000000000000..fea2489fdf6d --- /dev/null +++ b/qa/suites/fs/top/objectstore/.qa @@ -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 index 000000000000..a59cf5175069 --- /dev/null +++ b/qa/suites/fs/top/objectstore/bluestore-bitmap.yaml @@ -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 index 000000000000..fea2489fdf6d --- /dev/null +++ b/qa/suites/fs/top/overrides/.qa @@ -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 index 000000000000..3f8d0af872a4 --- /dev/null +++ b/qa/suites/fs/top/overrides/whitelist_health.yaml @@ -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 index 000000000000..0862b4457b37 --- /dev/null +++ b/qa/suites/fs/top/supported-random-distros$ @@ -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 index 000000000000..fea2489fdf6d --- /dev/null +++ b/qa/suites/fs/top/tasks/.qa @@ -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 index 000000000000..406f6804f036 --- /dev/null +++ b/qa/suites/fs/top/tasks/fstop.yaml @@ -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 index 000000000000..08617807eb66 --- /dev/null +++ b/qa/tasks/cephfs/test_fstop.py @@ -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")