From: Rishabh Dave Date: Mon, 18 Apr 2022 16:29:02 +0000 (+0530) Subject: qa/cephfs: print cmd debug info when it fails X-Git-Tag: v18.0.0~908^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d3b95436247da375c4e10a3f64056dc3bb67cd98;p=ceph.git qa/cephfs: print cmd debug info when it fails Print return code, stdout and stderr for the command that launches xfstests-dev tests against CephFS when it fails. Signed-off-by: Rishabh Dave --- diff --git a/qa/tasks/cephfs/test_acls.py b/qa/tasks/cephfs/test_acls.py index 87c95e1329fe..03665d4dad59 100644 --- a/qa/tasks/cephfs/test_acls.py +++ b/qa/tasks/cephfs/test_acls.py @@ -3,8 +3,10 @@ from logging import getLogger from io import StringIO from tasks.cephfs.xfstests_dev import XFSTestsDev + log = getLogger(__name__) + class TestACLs(XFSTestsDev): def test_acls(self): @@ -21,7 +23,18 @@ class TestACLs(XFSTestsDev): elif isinstance(self.mount_a, KernelMount): log.info('client is kernel mounted') - self.mount_a.client_remote.run(args=['sudo', './check', + # XXX: check_status is set to False so that we can check for command's + # failure on our own (since this command doesn't set right error code + # and error message in some cases) and print custom log messages + # accordingly. + proc = self.mount_a.client_remote.run(args=['sudo', './check', 'generic/099'], cwd=self.repo_path, stdout=StringIO(), - stderr=StringIO(), timeout=30, check_status=True, omit_sudo=False, + stderr=StringIO(), timeout=30, check_status=False,omit_sudo=False, label='running tests for ACLs from xfstests-dev') + + if proc.returncode != 0: + log.info('Command failed.') + log.info(f'Command return value: {proc.returncode}') + stdout, stderr = proc.stdout.getvalue(), proc.stderr.getvalue() + log.info(f'Command stdout -\n{stdout}') + log.info(f'Command stderr -\n{stderr}')