From: Rishabh Dave Date: Fri, 11 Oct 2024 19:03:29 +0000 (+0530) Subject: qa/cephfs: extend wait for trash empty X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b4257de079ed7e2c5d933c839ef9b3202c1f7fcc;p=ceph.git qa/cephfs: extend wait for trash empty Trash directory for a volume is not created by default. If _wait_for_trash_empty() in test_volumes.py encounters absence of trash directory, return true. Signed-off-by: Rishabh Dave (cherry picked from commit 6d6be8b41c990acf2d9c08f35eb382996d59d5a7) --- diff --git a/qa/tasks/cephfs/test_volumes.py b/qa/tasks/cephfs/test_volumes.py index 6dbc9dbaebc..8931b346b2f 100644 --- a/qa/tasks/cephfs/test_volumes.py +++ b/qa/tasks/cephfs/test_volumes.py @@ -297,9 +297,16 @@ class TestVolumesHelper(CephFSTestCase): self.mount_a.run_shell(["sudo", "chown", "-h", "65534:65534", sym_path2], omit_sudo=False) def _wait_for_trash_empty(self, timeout=60): - # XXX: construct the trash dir path (note that there is no mgr - # [sub]volume interface for this). - trashdir = os.path.join("./", "volumes", "_deleting") + trashdir = 'volumes/_deleting' + + try: + self.mount_a.stat(trashdir) + except CommandFailedError as e: + if e.exitstatus == errno.ENOENT: + return + else: + raise + self.mount_a.wait_for_dir_empty(trashdir, timeout=timeout) def _wait_for_subvol_trash_empty(self, subvol, group="_nogroup", timeout=30):