From 6d6be8b41c990acf2d9c08f35eb382996d59d5a7 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Sat, 12 Oct 2024 00:33:29 +0530 Subject: [PATCH] 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 --- qa/tasks/cephfs/test_volumes.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/qa/tasks/cephfs/test_volumes.py b/qa/tasks/cephfs/test_volumes.py index 94f9a35e9a9..09da5a67245 100644 --- a/qa/tasks/cephfs/test_volumes.py +++ b/qa/tasks/cephfs/test_volumes.py @@ -330,9 +330,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): -- 2.39.5