]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephfs: add method to run and get shell cmd stdout
authorRishabh Dave <ridave@redhat.com>
Thu, 4 Jan 2024 22:15:04 +0000 (03:45 +0530)
committerRishabh Dave <ridave@redhat.com>
Wed, 14 Aug 2024 09:35:46 +0000 (15:05 +0530)
Add a helper method that accepts command arguments (along with rest of
paramters accepted by the method run_shell()) and return the stdout of
the command.

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

index ce677c3812bfd4948872de86b5e90f13e5036a56..f7cc2b1a66c76391c2842bd6b47ac008b21b18b5 100644 (file)
@@ -775,6 +775,10 @@ class CephFSMountBase(object):
 
         return self.client_remote.run(args=args, **kwargs)
 
+    def get_shell_stdout(self, args, timeout=300, **kwargs):
+        return self.run_shell(args=args, timeout=timeout, **kwargs).stdout.\
+            getvalue().strip()
+
     def run_shell_payload(self, payload, wait=True, timeout=900, **kwargs):
         kwargs.setdefault('cwd', self.mountpoint)
         kwargs.setdefault('omit_sudo', False)