OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Wrapper script around run_remote_tests.sh that knows how to find | 7 # Wrapper script around run_remote_tests.sh that knows how to find |
8 # device test cells. | 8 # device test cells. |
9 | 9 |
| 10 # --- BEGIN COMMON.SH BOILERPLATE --- |
| 11 # Load common CrOS utilities. Inside the chroot this file is installed in |
| 12 # /usr/lib/crosutils. Outside the chroot we find it relative to the script's |
| 13 # location. |
| 14 find_common_sh() { |
| 15 local common_paths=(/usr/lib/crosutils "$(dirname "$(readlink -f "$0")")/..") |
| 16 local path |
10 | 17 |
11 # TODO(pstew): Apparently the script files are in transition from | 18 SCRIPT_ROOT= |
12 # src/scripts to src/scripts/bin. However this state has existed | 19 for path in "${common_paths[@]}"; do |
13 # for months now, therefore we need to look for the common libs in | 20 if [ -r "${path}/common.sh" ]; then |
14 # both places | 21 SCRIPT_ROOT=${path} |
15 script_root=$(dirname $0) | 22 break |
16 if [ -f ${script_root}/../common.sh ] ; then | 23 fi |
17 script_root=${script_root}/.. | 24 done |
18 fi | 25 } |
19 | 26 |
20 . "${script_root}/common.sh" | 27 find_common_sh |
| 28 . "${SCRIPT_ROOT}/common.sh" || (echo "Unable to load common.sh" && exit 1) |
| 29 # --- END COMMON.SH BOILERPLATE --- |
21 | 30 |
22 # Figure out the default chromelab server name. In order for this to | 31 # Figure out the default chromelab server name. In order for this to |
23 # work correctly, you have to: | 32 # work correctly, you have to: |
24 # | 33 # |
25 # - Put the hostname into "scripts/.default_wifi_test_lab" | 34 # - Put the hostname into "scripts/.default_wifi_test_lab" |
26 # - Create an /etc/hosts entry in your chroot for that hostname | 35 # - Create an /etc/hosts entry in your chroot for that hostname |
27 # (if it isn't findable via DNS) | 36 # (if it isn't findable via DNS) |
28 # - Make sure you have created a wifi_testbed_${lab} file in the | 37 # - Make sure you have created a wifi_testbed_${lab} file in the |
29 # ${autotest}/files/client/config/ directory | 38 # ${autotest}/files/client/config/ directory |
30 if [ -f "$GCLIENT_ROOT/src/scripts/.default_wifi_test_lab" ] ; then | 39 if [ -f "$GCLIENT_ROOT/src/scripts/.default_wifi_test_lab" ] ; then |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 done) | 147 done) |
139 | 148 |
140 if [ -z "$ret" ] ; then | 149 if [ -z "$ret" ] ; then |
141 echo ">>> Cell or host not found at $lab_url" | 150 echo ">>> Cell or host not found at $lab_url" |
142 exit 1 | 151 exit 1 |
143 fi | 152 fi |
144 | 153 |
145 set $ret | 154 set $ret |
146 remote=$1 | 155 remote=$1 |
147 shift | 156 shift |
148 for arg in $*; do | 157 for arg in "$@"; do |
149 append_arg $arg | 158 append_arg $arg |
150 done | 159 done |
151 | 160 |
152 eval "exec ${script_root}/run_remote_tests.sh \ | 161 eval "exec ${SCRIPTS_DIR}/run_remote_tests.sh \ |
153 --args=\"${run_remote_args}\" --remote=${remote} $run_remote_flags \ | 162 --args=\"${run_remote_args}\" --remote=${remote} $run_remote_flags \ |
154 $FLAGS_ARGV" | 163 $FLAGS_ARGV" |
OLD | NEW |