run_remote_tests.sh: allow testing with offline remote hosts

Useful for tests that do not require SSH access, such as those that use
servo for initializing the DUT. An SSH initialization is still
attempted, but is not required to succeed if --allow_offline_remote is
used.

BUG=None
TEST=Test continues in the presence of SSH connection timeout

Change-Id: I632bbb6fc37b9e9692c7bdac0fd986e22ab240c5
Reviewed-on: https://gerrit.chromium.org/gerrit/31664
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
diff --git a/run_remote_tests.sh b/run_remote_tests.sh
index 7410ee1..2865b0a 100755
--- a/run_remote_tests.sh
+++ b/run_remote_tests.sh
@@ -35,6 +35,8 @@
 DEFINE_integer verbose 1 "{0,1,2} Max verbosity shows autoserv debug output." v
 DEFINE_boolean whitelist_chrome_crashes ${FLAGS_FALSE} \
     "Treat Chrome crashes as non-fatal."
+DEFINE_boolean allow_offline_remote ${FLAGS_FALSE} \
+    "Proceed with testing even if remote is offline; useful when using servo"
 
 # The prefix to look for in an argument that determines we're talking about a
 # new-style suite.
@@ -355,7 +357,7 @@
 
   trap cleanup EXIT
 
-  remote_access_init
+  remote_access_init || [ ${FLAGS_allow_offline_remote} -eq ${FLAGS_TRUE} ]
   # autotest requires that an ssh-agent already be running
   start_ssh_agent >/dev/null