tests: fix cleanup after reflink tests

First make the directory accessible again, otherwise os.path.ismount may
not detect it (so umount would not be called) and then rmdir will fail.
This commit is contained in:
Marek Marczykowski-Górecki 2019-03-16 03:21:16 +01:00
父節點 aa7c0b71a7
當前提交 4234fe5112
沒有發現已知的金鑰在資料庫的簽署中
GPG 金鑰 ID: 063938BA42CFA724

查看文件

@ -130,6 +130,8 @@ def mkdir_fs(directory, fs_type,
cleanup_via(rmtree_fs, directory)
def rmtree_fs(directory):
cmd('sudo', 'chattr', '-i', directory)
cmd('sudo', 'chmod', '777', directory)
if os.path.ismount(directory):
try:
cmd('sudo', 'umount', directory)
@ -137,8 +139,6 @@ def rmtree_fs(directory):
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)
shutil.rmtree(directory)
def get_blockdev_size(dev):