From: Patrick Donnelly Date: Wed, 15 Aug 2018 19:33:33 +0000 (-0700) Subject: qa: add cephfs-shell skeleton test case X-Git-Tag: v14.0.1~578^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F23597%2Fhead;p=ceph.git qa: add cephfs-shell skeleton test case Right now just tests that "help" works. Signed-off-by: Patrick Donnelly --- diff --git a/qa/cephfs/begin.yaml b/qa/cephfs/begin.yaml index 9829253795a5..58099a3a4dd3 100644 --- a/qa/cephfs/begin.yaml +++ b/qa/cephfs/begin.yaml @@ -1,5 +1,6 @@ tasks: - install: extra_packages: - - python3-cephfs + rpm: ['python3-cephfs'] + deb: ['python3-cephfs', 'cephfs-shell'] - ceph: diff --git a/qa/suites/fs/basic_functional/tasks/cephfs-shell/+ b/qa/suites/fs/basic_functional/tasks/cephfs-shell/+ new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/qa/suites/fs/basic_functional/tasks/cephfs-shell/py-3.yaml b/qa/suites/fs/basic_functional/tasks/cephfs-shell/py-3.yaml new file mode 100644 index 000000000000..9bd4a922626c --- /dev/null +++ b/qa/suites/fs/basic_functional/tasks/cephfs-shell/py-3.yaml @@ -0,0 +1,2 @@ +overrides: + python: python3 diff --git a/qa/suites/fs/basic_functional/tasks/cephfs-shell/test.yaml b/qa/suites/fs/basic_functional/tasks/cephfs-shell/test.yaml new file mode 100644 index 000000000000..b4f0d4ab057c --- /dev/null +++ b/qa/suites/fs/basic_functional/tasks/cephfs-shell/test.yaml @@ -0,0 +1,15 @@ +# Right now, cephfs-shell is only available as a package on Ubuntu +# This overrides the random distribution that's chosen in the other yaml fragments. +os_type: ubuntu +os_version: "18.04" + +overrides: + ceph: + conf: + global: + ms type: simple + +tasks: + - cephfs_test_runner: + modules: + - tasks.cephfs.test_cephfs_shell diff --git a/qa/tasks/cephfs/test_cephfs_shell.py b/qa/tasks/cephfs/test_cephfs_shell.py new file mode 100644 index 000000000000..0aad5dd4ca90 --- /dev/null +++ b/qa/tasks/cephfs/test_cephfs_shell.py @@ -0,0 +1,35 @@ +import logging +from StringIO import StringIO +from tasks.cephfs.cephfs_test_case import CephFSTestCase +from tasks.cephfs.fuse_mount import FuseMount +from teuthology.exceptions import CommandFailedError + +log = logging.getLogger(__name__) + + +class TestCephFSShell(CephFSTestCase): + CLIENTS_REQUIRED = 1 + py_version = 'python' + + def setUp(self): + CephFSTestCase.setUp(self) + self.py_version = self.ctx.config.get('overrides', {}).get('python', 'python') + log.info("using python version: {}".format(self.py_version)) + + def _cephfs_shell(self, cmd, opts=None): + args = ["cephfs-shell", "-c", self.mount_a.config_path] + if opts is not None: + args.extend(opts) + args.extend(("--", cmd)) + log.info("Running command: {}".format(" ".join(args))) + status = self.mount_a.client_remote.run(args=args, stdout=StringIO()) + return status.stdout.getvalue().strip() + + def test_help(self): + """ + Test that help outputs commands. + """ + + o = self._cephfs_shell("help") + + log.info("output:\n{}".format(o))