faft: Only reimaging the USB and internal disk OS on the first test
Only do it on the first test. Doing it on every test is not necessary and
wastes time.
BUG=chromium-os:34392,chromium-os:34400
TEST=run the following test with reimaging, see only the first test do so:
$ ./run_remote_tests.sh --board daisy --remote dut -a \
"image=/path/to/chromiumos_test_image.bin" control.faft_lv1
Change-Id: Ia8b2c92fc1f2800c4ceecefe7daf9c89a355f8a9
Reviewed-on: https://gerrit.chromium.org/gerrit/36313
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Ready: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
diff --git a/server/cros/faftsequence.py b/server/cros/faftsequence.py
index 9f96a71..fc96e34 100644
--- a/server/cros/faftsequence.py
+++ b/server/cros/faftsequence.py
@@ -137,6 +137,7 @@
# This variable is preserved across tests which inherit this class.
_global_setup_done = {
'gbb_flags': False,
+ 'reimage': False,
'usb_check': False,
}
@@ -407,6 +408,9 @@
image_path: An URL or a path on the host to the test image.
firmware_update: Also update the firmware after installing.
"""
+ if self.check_setup_done('reimage'):
+ return
+
if image_path.startswith(self._HTTP_PREFIX):
# TODO(waihong@chromium.org): Add the check of the URL to ensure
# it is a test image.
@@ -478,6 +482,7 @@
self.servo.enable_usb_hub(host=True)
# Mark usb_check done so it won't check a test image in USB anymore.
self.mark_setup_done('usb_check')
+ self.mark_setup_done('reimage')
def clear_set_gbb_flags(self, clear_mask, set_mask):