]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: add cephfs-shell skeleton test case 23597/head
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 15 Aug 2018 19:33:33 +0000 (12:33 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 16 Aug 2018 16:13:36 +0000 (09:13 -0700)
Right now just tests that "help" works.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
qa/cephfs/begin.yaml
qa/suites/fs/basic_functional/tasks/cephfs-shell/+ [new file with mode: 0644]
qa/suites/fs/basic_functional/tasks/cephfs-shell/py-3.yaml [new file with mode: 0644]
qa/suites/fs/basic_functional/tasks/cephfs-shell/test.yaml [new file with mode: 0644]
qa/tasks/cephfs/test_cephfs_shell.py [new file with mode: 0644]

index 9829253795a5e1f6a3c03543dd19e6c59ef04722..58099a3a4dd39d75fc901705ec0dde39d0e486d2 100644 (file)
@@ -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 (file)
index 0000000..e69de29
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 (file)
index 0000000..9bd4a92
--- /dev/null
@@ -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 (file)
index 0000000..b4f0d4a
--- /dev/null
@@ -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 (file)
index 0000000..0aad5dd
--- /dev/null
@@ -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))