From: Rishabh Dave Date: Wed, 13 Mar 2019 18:40:16 +0000 (+0530) Subject: qa: add wrappers for vstart's run() with check_status as False X-Git-Tag: v15.1.0~2911^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=532670bd05266e7f6851ea48633907d262a73ac6;p=ceph-ci.git qa: add wrappers for vstart's run() with check_status as False Too often in tests it is required to run a command that we want to (or will probably) fail so that we can check if it failed for expected reason(s) (eg. a testcase where command must fail with "Permission denied"). Therefore, add few wrapper methods for vstart_runner.py's run() with check_status's default value as False so that we don't need to pass check_status's value at every call to run() or it's other wrappers. Signed-off-by: Rishabh Dave --- diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index f2dc0972a0c..2edc88d3d78 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -498,6 +498,27 @@ class LocalFuseMount(FuseMount): check_status=check_status, omit_sudo=False) + def testcmd(self, args, wait=True, stdin=None, omit_sudo=True): + # FIXME maybe should add a pwd arg to teuthology.orchestra so that + # the "cd foo && bar" shenanigans isn't needed to begin with and + # then we wouldn't have to special case this + return self.run_shell(args, wait=wait, stdin=stdin, check_status=False, + omit_sudo=omit_sudo) + + def testcmd_as_user(self, args, user, wait=True, stdin=None): + # FIXME maybe should add a pwd arg to teuthology.orchestra so that + # the "cd foo && bar" shenanigans isn't needed to begin with and + # then we wouldn't have to special case this + return self.run_as_user(args, user=user, wait=wait, stdin=stdin, + check_status=False) + + def testcmd_as_root(self, args, wait=True, stdin=None): + # FIXME maybe should add a pwd arg to teuthology.orchestra so that + # the "cd foo && bar" shenanigans isn't needed to begin with and + # then we wouldn't have to special case this + return self.run_as_root(args, wait=wait, stdin=stdin, + check_status=False) + def setupfs(self, name=None): if name is None and self.fs is not None: # Previous mount existed, reuse the old name