From: Rishabh Dave Date: Thu, 4 Jan 2024 22:15:04 +0000 (+0530) Subject: qa/cephfs: add method to run and get shell cmd stdout X-Git-Tag: v20.0.0~1215^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9f60848df49c03494646a5a38386f1e50a608ac8;p=ceph.git qa/cephfs: add method to run and get shell cmd stdout 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 --- diff --git a/qa/tasks/cephfs/mount.py b/qa/tasks/cephfs/mount.py index ce677c3812b..f7cc2b1a66c 100644 --- a/qa/tasks/cephfs/mount.py +++ b/qa/tasks/cephfs/mount.py @@ -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)