Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: remote_access.sh

Issue 2845002: added support for an alternative ssh port for autotest (Closed) Base URL: ssh://gitrw.chromium.org/crosutils.git
Patch Set: minor fixes Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | run_remote_tests.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 1 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # Library for setting up remote access and running remote commands. 5 # Library for setting up remote access and running remote commands.
6 6
7 DEFAULT_PRIVATE_KEY="${GCLIENT_ROOT}/src/scripts/mod_for_test_scripts/\ 7 DEFAULT_PRIVATE_KEY="${GCLIENT_ROOT}/src/scripts/mod_for_test_scripts/\
8 ssh_keys/testing_rsa" 8 ssh_keys/testing_rsa"
9 9
10 DEFINE_string remote "" "remote hostname/IP of running Chromium OS instance" 10 DEFINE_string remote "" "remote hostname/IP of running Chromium OS instance"
11 DEFINE_string private_key "$DEFAULT_PRIVATE_KEY" \ 11 DEFINE_string private_key "$DEFAULT_PRIVATE_KEY" \
12 "Private key of root account on remote host" 12 "Private key of root account on remote host"
13 DEFINE_integer ssh_port 22 \
14 "SSH port of the remote machine running Chromium OS instance"
13 15
14 # Copies $1 to $2 on remote host 16 # Copies $1 to $2 on remote host
15 function remote_cp() { 17 function remote_cp() {
16 REMOTE_OUT=$(scp -o StrictHostKeyChecking=no -o \ 18 REMOTE_OUT=$(scp -o StrictHostKeyChecking=no -o \
17 UserKnownHostsFile=$TMP_KNOWN_HOSTS $1 root@$FLAGS_remote:$2) 19 UserKnownHostsFile=$TMP_KNOWN_HOSTS $1 root@$FLAGS_remote:$2)
18 return ${PIPESTATUS[0]} 20 return ${PIPESTATUS[0]}
19 } 21 }
20 22
21 function remote_sh() { 23 function remote_sh() {
22 REMOTE_OUT=$(ssh -o StrictHostKeyChecking=no -o \ 24 REMOTE_OUT=$(ssh -p ${FLAGS_ssh_port} -o StrictHostKeyChecking=no -o \
23 UserKnownHostsFile=$TMP_KNOWN_HOSTS root@$FLAGS_remote "$@") 25 UserKnownHostsFile=$TMP_KNOWN_HOSTS root@$FLAGS_remote "$@")
24 return ${PIPESTATUS[0]} 26 return ${PIPESTATUS[0]}
25 } 27 }
26 28
27 function remote_sh_allow_changed_host_key() { 29 function remote_sh_allow_changed_host_key() {
28 rm -f $TMP_KNOWN_HOSTS 30 rm -f $TMP_KNOWN_HOSTS
29 remote_sh "$@" 31 remote_sh "$@"
30 } 32 }
31 33
32 function set_up_remote_access() { 34 function set_up_remote_access() {
(...skipping 26 matching lines...) Expand all
59 61
60 function remote_access_init() { 62 function remote_access_init() {
61 TMP_PRIVATE_KEY=$TMP/private_key 63 TMP_PRIVATE_KEY=$TMP/private_key
62 TMP_KNOWN_HOSTS=$TMP/known_hosts 64 TMP_KNOWN_HOSTS=$TMP/known_hosts
63 if [ -z "$FLAGS_remote" ]; then 65 if [ -z "$FLAGS_remote" ]; then
64 echo "Please specify --remote=<IP-or-hostname> of the Chromium OS instance" 66 echo "Please specify --remote=<IP-or-hostname> of the Chromium OS instance"
65 exit 1 67 exit 1
66 fi 68 fi
67 set_up_remote_access 69 set_up_remote_access
68 } 70 }
OLDNEW
« no previous file with comments | « no previous file | run_remote_tests.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698