浏览代码

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.
Marek Marczykowski-Górecki 5 年之前
父节点
当前提交
b6f77ebfa1
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      qubes/tests/storage_reflink.py

+ 5 - 1
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)