From: Rishabh Dave Date: Mon, 25 Mar 2024 12:01:01 +0000 (+0530) Subject: qa/cephfs: pass confirmation flag to fs fail in tear down code X-Git-Tag: v18.2.5~619^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=61bd3e5be6b4f249552a63cfef8c2ea28de5f1d8;p=ceph.git qa/cephfs: pass confirmation flag to fs fail in tear down code Since "ceph fs fail" command now requires the confirmation flag when Ceph cluster has either health warning MDS_TRIM or MDS_CACHE_OVERSIZE, update tear down in QA code. During the teardown, the CephFS should be failed, regardless of whether or not Ceph cluster has health warnings, since it is teardown. Signed-off-by: Rishabh Dave (cherry picked from commit a1af1bf538a20ae7d021098f5787534ce61dbd7c) --- diff --git a/qa/tasks/cephfs/filesystem.py b/qa/tasks/cephfs/filesystem.py index 7ad53c81d1fb..b236c6710cde 100644 --- a/qa/tasks/cephfs/filesystem.py +++ b/qa/tasks/cephfs/filesystem.py @@ -587,7 +587,12 @@ class Filesystem(MDSCluster): self.run_ceph_cmd("fs", "reset", str(self.name), '--yes-i-really-mean-it') def fail(self): - self.run_ceph_cmd("fs", "fail", str(self.name)) + cmd = ["fs", "fail", str(self.name)] + try: + self.run_ceph_cmd(cmd) + except CommandFailedError: + cmd.append("--yes-i-really-mean-it") + self.run_ceph_cmd(cmd) def set_flag(self, var, *args): a = map(lambda x: str(x).lower(), args)