Support installing Autotest dependency after boot.
It is for the cases of recovery mode test. The test boots a USB/SD image
instead of an internal image. The previous installed Autotest dependency
on the internal image is lost. So we need to install it again.
A configuration of FAFT_STEP, install_deps_after_boot, is supported for
this purpose.
BUG=chromium-os:19710
TEST=run_remote_tests.sh --remote=$REMOTE_IP -a \
"servo_vid=0x18d1 servo_pid=0x5001" firmware_TryFwB
More test using this config is in a comming CL, firmware_UserRequestRecovery.
Change-Id: I7e3e68c2e15597cdf27979ddbdf5e6e2ed63d745
Reviewed-on: https://gerrit.chromium.org/gerrit/10696
Reviewed-by: Todd Broch <tbroch@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/servo_test.py b/server/cros/servo_test.py
index 6e1ce4f..89b571d 100644
--- a/server/cros/servo_test.py
+++ b/server/cros/servo_test.py
@@ -237,10 +237,13 @@
assert succeed, 'Timed out connecting to client RPC server.'
- def wait_for_client(self):
+ def wait_for_client(self, install_deps=False):
"""Wait for the client to come back online.
New remote processes will be launched if their used flags are enabled.
+
+ Args:
+ install_deps: If True, install the Autotest dependency when ready.
"""
timeout = 10
# Ensure old ssh connections are terminated.
@@ -258,6 +261,10 @@
# TODO(waihong) Investigate pinging port via netcat or nmap
# to interrogate client for when sshd has launched.
time.sleep(5)
+ if install_deps:
+ if not self._autotest_client:
+ self._autotest_client = autotest.Autotest(self._client)
+ self._autotest_client.run_test(info['client_test'])
self.launch_client(info)
logging.info('Server: Relaunched remote %s.' % name)