From 0329d9b8843f123e1cdef367606c5931a22fb5ee Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Mon, 16 Nov 2020 06:45:48 -0500 Subject: [PATCH] test: selftest for `cephfs-top` utility Signed-off-by: Venky Shankar --- qa/cephfs/begin.yaml | 2 ++ qa/suites/fs/top/% | 0 qa/suites/fs/top/.qa | 1 + qa/suites/fs/top/begin.yaml | 1 + qa/suites/fs/top/cluster/+ | 0 qa/suites/fs/top/cluster/1-node.yaml | 10 +++++++ qa/suites/fs/top/mount/.qa | 1 + qa/suites/fs/top/mount/fuse.yaml | 1 + qa/suites/fs/top/objectstore/.qa | 1 + .../fs/top/objectstore/bluestore-bitmap.yaml | 1 + qa/suites/fs/top/overrides/.qa | 1 + .../fs/top/overrides/whitelist_health.yaml | 1 + qa/suites/fs/top/supported-random-distros$ | 1 + qa/suites/fs/top/tasks/.qa | 1 + qa/suites/fs/top/tasks/fstop.yaml | 4 +++ qa/tasks/cephfs/test_fstop.py | 27 +++++++++++++++++++ 16 files changed, 53 insertions(+) create mode 100644 qa/suites/fs/top/% create mode 120000 qa/suites/fs/top/.qa create mode 120000 qa/suites/fs/top/begin.yaml create mode 100644 qa/suites/fs/top/cluster/+ create mode 100644 qa/suites/fs/top/cluster/1-node.yaml create mode 120000 qa/suites/fs/top/mount/.qa create mode 120000 qa/suites/fs/top/mount/fuse.yaml create mode 120000 qa/suites/fs/top/objectstore/.qa create mode 120000 qa/suites/fs/top/objectstore/bluestore-bitmap.yaml create mode 120000 qa/suites/fs/top/overrides/.qa create mode 120000 qa/suites/fs/top/overrides/whitelist_health.yaml create mode 120000 qa/suites/fs/top/supported-random-distros$ create mode 120000 qa/suites/fs/top/tasks/.qa create mode 100644 qa/suites/fs/top/tasks/fstop.yaml create mode 100644 qa/tasks/cephfs/test_fstop.py diff --git a/qa/cephfs/begin.yaml b/qa/cephfs/begin.yaml index 082f295406700..d63591f974e7d 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 0000000000000..e69de29bb2d1d diff --git a/qa/suites/fs/top/.qa b/qa/suites/fs/top/.qa new file mode 120000 index 0000000000000..fea2489fdf6d9 --- /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 0000000000000..311d404f7c276 --- /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 0000000000000..e69de29bb2d1d 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 0000000000000..c5313bb0492a8 --- /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 0000000000000..fea2489fdf6d9 --- /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 0000000000000..0e55da9fb7ab9 --- /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 0000000000000..fea2489fdf6d9 --- /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 0000000000000..a59cf5175069a --- /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 0000000000000..fea2489fdf6d9 --- /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 0000000000000..3f8d0af872a49 --- /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 0000000000000..0862b4457b37a --- /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 0000000000000..fea2489fdf6d9 --- /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 0000000000000..406f6804f0363 --- /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 0000000000000..08617807eb665 --- /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") -- 2.39.5