From: Patrick Donnelly Date: Wed, 18 Jan 2023 02:21:08 +0000 (-0500) Subject: qa/tasks: allow specifying timeout command prefix to ceph X-Git-Tag: v16.2.13~55^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=317817eb61725ae7b8595b1f4cfe4e9898966331;p=ceph.git qa/tasks: allow specifying timeout command prefix to ceph Signed-off-by: Patrick Donnelly (cherry picked from commit dbf1a402c9626bcb2d1b3363f871c569860a0921) Conflicts: qa/tasks/ceph_manager.py --- diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index bb1abfd51bb..c04dcc11c5b 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -1564,23 +1564,33 @@ class CephManager: Accepts arguments same as that of teuthology.orchestra.run.run() """ + + prefixcmd = [] + timeoutcmd = kwargs.pop('timeoutcmd', None) + if timeoutcmd is not None: + prefixcmd += ['timeout', str(timeoutcmd)] + if self.cephadm: + prefixcmd += ['ceph'] + cmd = prefixcmd + list(kwargs['args']) return shell(self.ctx, self.cluster, self.controller, - args=['ceph'] + list(kwargs['args']), + args=cmd, stdout=StringIO(), check_status=kwargs.get('check_status', True)) - if self.rook: + elif self.rook: + prefixcmd += ['ceph'] + cmd = prefixcmd + list(kwargs['args']) return toolbox(self.ctx, self.cluster, - args=['ceph'] + list(kwargs['args']), + args=cmd, stdout=StringIO(), check_status=kwargs.get('check_status', True)) - - testdir = teuthology.get_testdir(self.ctx) - prefix = ['sudo', 'adjust-ulimits', 'ceph-coverage', - f'{testdir}/archive/coverage', 'timeout', '120', 'ceph', - '--cluster', self.cluster] - kwargs['args'] = prefix + list(kwargs['args']) - return self.controller.run(**kwargs) + else: + testdir = teuthology.get_testdir(self.ctx) + prefix = prefixcmd + ['sudo', 'adjust-ulimits', 'ceph-coverage', + f'{testdir}/archive/coverage', 'timeout', '120', 'ceph', + '--cluster', self.cluster] + kwargs['args'] = prefix + list(kwargs['args']) + return self.controller.run(**kwargs) def raw_cluster_cmd(self, *args, **kwargs) -> str: """