Skip to content

Commit 6d6be8b

Browse files
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 <[email protected]>
1 parent f38fcbc commit 6d6be8b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

qa/tasks/cephfs/test_volumes.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,16 @@ def _do_subvolume_io_mixed(self, subvolume, subvolume_group=None):
330330
self.mount_a.run_shell(["sudo", "chown", "-h", "65534:65534", sym_path2], omit_sudo=False)
331331

332332
def _wait_for_trash_empty(self, timeout=60):
333-
# XXX: construct the trash dir path (note that there is no mgr
334-
# [sub]volume interface for this).
335-
trashdir = os.path.join("./", "volumes", "_deleting")
333+
trashdir = 'volumes/_deleting'
334+
335+
try:
336+
self.mount_a.stat(trashdir)
337+
except CommandFailedError as e:
338+
if e.exitstatus == errno.ENOENT:
339+
return
340+
else:
341+
raise
342+
336343
self.mount_a.wait_for_dir_empty(trashdir, timeout=timeout)
337344

338345
def _wait_for_subvol_trash_empty(self, subvol, group="_nogroup", timeout=30):

0 commit comments

Comments
 (0)