Revert "Revert "[telemetry_runner] Connect SSH host with non-default port.""
Reland it again after fixing bug (in servo_hsot.py).
BUG=chromium:783780
TEST=Verify by running enterprise_CFM_Sanity.
Change-Id: I90c67a767577e6927cc2396f642503ee656a1a2b
Reviewed-on: https://chromium-review.googlesource.com/767831
Commit-Ready: Shuo-Peng Liao <deanliao@chromium.org>
Tested-by: Shuo-Peng Liao <deanliao@chromium.org>
Reviewed-by: Denis Tosic <dtosic@chromium.org>
diff --git a/server/hosts/servo_host.py b/server/hosts/servo_host.py
index 4067f6a..580d6ac 100644
--- a/server/hosts/servo_host.py
+++ b/server/hosts/servo_host.py
@@ -201,7 +201,8 @@
def make_ssh_command(self, user='root', port=22, opts='', hosts_file=None,
- connect_timeout=None, alive_interval=None):
+ connect_timeout=None, alive_interval=None,
+ alive_count_max=None, connection_attempts=None):
"""Override default make_ssh_command to use tuned options.
Tuning changes:
@@ -227,16 +228,17 @@
@param hosts_file Ignored.
@param connect_timeout Ignored.
@param alive_interval Ignored.
+ @param alive_count_max Ignored.
+ @param connection_attempts Ignored.
@returns: An ssh command with the requested settings.
"""
- base_command = ('/usr/bin/ssh -a -x %s -o StrictHostKeyChecking=no'
- ' -o UserKnownHostsFile=/dev/null -o BatchMode=yes'
- ' -o ConnectTimeout=30 -o ServerAliveInterval=180'
- ' -o ServerAliveCountMax=3 -o ConnectionAttempts=4'
- ' -o Protocol=2 -l %s -p %d')
- return base_command % (opts, user, port)
+ options = ' '.join([opts, '-o Protocol=2'])
+ return super(ServoHost, self).make_ssh_command(
+ user=user, port=port, opts=options, hosts_file='/dev/null',
+ connect_timeout=30, alive_interval=180, alive_count_max=3,
+ connection_attempts=4)
def _make_scp_cmd(self, sources, dest):