test: selftest for cephfs-top utility

Signed-off-by: Venky Shankar <vshankar@redhat.com>
This commit is contained in:
Venky Shankar 2020-11-16 06:45:48 -05:00
parent d5062c60f6
commit 0329d9b884
16 changed files with 53 additions and 0 deletions

View 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:

0
qa/suites/fs/top/% Normal file
View File

1
qa/suites/fs/top/.qa Symbolic link
View File

@ -0,0 +1 @@
../.qa

1
qa/suites/fs/top/begin.yaml Symbolic link
View File

@ -0,0 +1 @@
.qa/cephfs/begin.yaml

View File

View File

@ -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

1
qa/suites/fs/top/mount/.qa Symbolic link
View File

@ -0,0 +1 @@
../.qa

View File

@ -0,0 +1 @@
.qa/cephfs/mount/fuse.yaml

View File

@ -0,0 +1 @@
../.qa

View File

@ -0,0 +1 @@
.qa/objectstore/bluestore-bitmap.yaml

View File

@ -0,0 +1 @@
../.qa

View File

@ -0,0 +1 @@
./.qa/cephfs/overrides/whitelist_health.yaml

View File

@ -0,0 +1 @@
.qa/distros/supported-random-distro$

1
qa/suites/fs/top/tasks/.qa Symbolic link
View File

@ -0,0 +1 @@
../.qa

View File

@ -0,0 +1,4 @@
tasks:
- cephfs_test_runner:
modules:
- tasks.cephfs.test_fstop

View File

@ -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")