From b6f77ebfa104df519fe271814d16073de109f282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sat, 16 Mar 2019 03:05:07 +0100 Subject: [PATCH] tests: do not use lazy unmount If unmount is going to fail, let it do so explicitly, instead of hiding the failure now, and observing it later at rmdir. And if it fails, lets report what process is using that mount point. --- qubes/tests/storage_reflink.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qubes/tests/storage_reflink.py b/qubes/tests/storage_reflink.py index fff26144..1fd510ab 100644 --- a/qubes/tests/storage_reflink.py +++ b/qubes/tests/storage_reflink.py @@ -131,7 +131,11 @@ def mkdir_fs(directory, fs_type, def rmtree_fs(directory): if os.path.ismount(directory): - cmd('sudo', 'umount', '-l', directory) + try: + cmd('sudo', 'umount', directory) + except: + cmd('sudo', 'fuser', '-vm', directory) + raise # loop device and backing file are garbage collected automatically cmd('sudo', 'chattr', '-i', directory) cmd('sudo', 'chmod', '777', directory)