firmware_TouchMTB: handle exceptions when creating .version file

When running the version.sh script to create and scp the .version
file to the remote machine, it may fail sometimes. I conjecture
that when performing scp, there are many situations that may arise,
including the issues associated with accessing .ssh/known_hosts,
network may timeout, network may lose connection for whatever
reasons, etc.

This patch adds more exceptions handling in the expect_scp script,
and prints the error messages to stderr to ensure that the error
messages could be included in the output log when executing
run_remote_tests.sh. Besides, the flags StrictHostKeyChecking=no
and UserKnownHostsFile="/tmp/null" are added to scp command to
reduce the unnecessary warning/error messages.

BUG=chromium:375374
TEST=Setup the autotest from chroot, and make sure all tests PASSED
in various platforms.
(cr) run_remote_tests.sh --autotest_dir ~/trunk/src/third_party/autotest/files
     --remote=$MACHINE_IP firmware_TouchMTBSetup

Change-Id: Ica650f50ef4e3b6c186eaf5e7e472f998bd2c9d2
Reviewed-on: https://chromium-review.googlesource.com/201061
Reviewed-by: Charles Mooney <charliemooney@chromium.org>
Tested-by: Charles Mooney <charliemooney@chromium.org>
Commit-Queue: Shyh-In Hwang <josephsih@chromium.org>
2 files changed