FAFT: Lazy unmount filesystem for probling an USB disk on servo
It happens to fail to unmount the filesystem when running FAFT on a
desktop Ubuntu machine. Ubuntu may auto-mount the filesystem and
pop-up the file browser that interferes the unmount call. Using lazy
unmount helps. It unmounts the filsystem as soon as it is not busy.
BUG=None
TEST=Run FAFT tests requiring an USB disk.
Change-Id: I5dea442f8eef4bd4c89b4a7fe95cae634f48f4cb
Reviewed-on: https://chromium-review.googlesource.com/479639
Commit-Ready: Wai-Hong Tam <waihong@google.com>
Tested-by: Wai-Hong Tam <waihong@google.com>
Reviewed-by: Tyler Reid <twreid@google.com>
diff --git a/server/cros/faft/firmware_test.py b/server/cros/faft/firmware_test.py
index fdefd4c4..43cb0d2 100644
--- a/server/cros/faft/firmware_test.py
+++ b/server/cros/faft/firmware_test.py
@@ -380,7 +380,7 @@
raise error.TestError('USB stick in servo contains a %s '
'image, but DUT is a %s' % (usb_board, dut_board))
finally:
- for cmd in ('umount %s' % rootfs, 'sync', 'rm -rf %s' % tmpd):
+ for cmd in ('umount -l %s' % rootfs, 'sync', 'rm -rf %s' % tmpd):
self.servo.system(cmd)
self.mark_setup_done('usb_check')