]> git-server-git.apps.pok.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>
Thu, 25 Sep 2025 03:13:05 +0000 (08:43 +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>
(cherry picked from commit 6d6be8b41c990acf2d9c08f35eb382996d59d5a7)

qa/tasks/cephfs/test_volumes.py

index 6dbc9dbaebcdf04f26ab71407fd155624d171580..8931b346b2f8dc29a5fcb3f6c5dfcee0069c3085 100644 (file)
@@ -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):