]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephfs: allow passing conf to methods that runs shell command
authorRishabh Dave <ridave@redhat.com>
Tue, 10 Sep 2019 12:04:21 +0000 (17:34 +0530)
committerRishabh Dave <ridave@redhat.com>
Fri, 6 Dec 2019 03:24:06 +0000 (08:54 +0530)
Add an argument to the methods that issues CephFS shell command to
accept path to the ceph.conf file.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
qa/tasks/cephfs/test_cephfs_shell.py

index f4ab63f19a7bb947cfbc1a296b372e801a09e004..4a7b723c7f18ede3b3bd52ffe0850a24a92e24b4 100644 (file)
@@ -31,14 +31,17 @@ def humansize(nbytes):
 class TestCephFSShell(CephFSTestCase):
     CLIENTS_REQUIRED = 1
 
-    def run_cephfs_shell_cmd(self, cmd, mount_x=None, opts=None, stdin=None):
+    def run_cephfs_shell_cmd(self, cmd, mount_x=None, opts=None, stdin=None, config_path=None):
         if mount_x is None:
             mount_x = self.mount_a
+        if config_path is None:
+            config_path = self.mount_a.config_path
 
         if isinstance(cmd, list):
             cmd = " ".join(cmd)
 
-        args = ["cephfs-shell", "-c", mount_x.config_path]
+        args = ["cephfs-shell", "-c", config_path]
+
         if opts is not None:
             args.extend(opts)
 
@@ -54,9 +57,10 @@ class TestCephFSShell(CephFSTestCase):
             getvalue().strip()
 
     def get_cephfs_shell_cmd_output(self, cmd, mount_x=None, opts=None,
-                                    stdin=None):
-        return self.run_cephfs_shell_cmd(cmd, mount_x, opts, stdin).stdout.\
-            getvalue().strip()
+                                    stdin=None, config_path=None):
+        return self.run_cephfs_shell_cmd(cmd, mount_x, opts, stdin,
+                                         config_path).\
+            stdout.getvalue().strip()
 
     def get_cephfs_shell_script_output(self, script, mount_x=None, stdin=None):
         return self.run_cephfs_shell_script(script, mount_x, stdin).stdout.\