]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephfs: extend wait for trash empty
authorRishabh Dave <ridave@redhat.com>
Fri, 11 Oct 2024 19:03:29 +0000 (00:33 +0530)
committerRishabh Dave <ridave@redhat.com>
Wed, 12 Mar 2025 18:47:44 +0000 (00:17 +0530)
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 <ridave@redhat.com>
qa/tasks/cephfs/test_volumes.py

index 94f9a35e9a9d5a0f68a0ffdcab9e80d64546f05a..09da5a6724530aad20713d1859d67ce8791ab169 100644 (file)
@@ -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):