Do not initialize remote access if not needed

The run_remote_tests.sh script accepts a command line flag
(--allow_offline_remote) which makes it possible to run the tests even
if the DUT is offline. What happens is that the script still tries to
initialize remote access when this option is given, which forces the
operator to wait for the ssh connection timeout to expire in case the
DUT is indeed down.

With this change DUT connection is not even attempted if the
--allow_offline_remote flag is given.

BUG=None
TEST=manual
     . tried using the script while the DUT is offline:

     $  ~/trunk/src/platform/crostestutils/run_remote_tests.sh --use_emerged\
      --board=daisy --servo --remote=192.168.1.6 --allow_offline_remote fwupdate \
      --args 'fwurl=file:///tmp/daisy.tar.bz2 board=snow'

      observed the script proceeding to test right away without waiting
      for the ssh connection attempt to timeout

Change-Id: I9611cbd97e8a729cf27172813a26fde6f70e98db
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43334
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
1 file changed