| 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 # Script to run client or server tests on a live remote image. | 7 # Script to run client or server tests on a live remote image. |
| 8 | 8 |
| 9 # Load common constants. This should be the first executable line. | 9 # Load common constants. This should be the first executable line. |
| 10 # The path to common.sh should be relative to your script's location. | 10 # The path to common.sh should be relative to your script's location. |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 echo "" | 231 echo "" |
| 232 echo_color "yellow" ">>> Running ${type} test " ${control_file} | 232 echo_color "yellow" ">>> Running ${type} test " ${control_file} |
| 233 local short_name=$(basename $(dirname "${control_file}")) | 233 local short_name=$(basename $(dirname "${control_file}")) |
| 234 local results_dir_name="${short_name}" | 234 local results_dir_name="${short_name}" |
| 235 local results_dir="${TMP_INSIDE_CHROOT}/${results_dir_name}" | 235 local results_dir="${TMP_INSIDE_CHROOT}/${results_dir_name}" |
| 236 rm -rf "${results_dir}" | 236 rm -rf "${results_dir}" |
| 237 local verbose="" | 237 local verbose="" |
| 238 if [[ ${FLAGS_verbose} -eq $FLAGS_TRUE ]]; then | 238 if [[ ${FLAGS_verbose} -eq $FLAGS_TRUE ]]; then |
| 239 verbose="--verbose" | 239 verbose="--verbose" |
| 240 fi | 240 fi |
| 241 local args=() | |
| 242 if [[ -n "${FLAGS_args}" ]]; then | |
| 243 local with_spaces="" | |
| 244 with_spaces=${FLAGS_args//,/ } | |
| 245 args=("-a" "${with_spaces}") | |
| 246 fi | |
| 247 | 241 |
| 248 RAN_ANY_TESTS=${FLAGS_TRUE} | 242 RAN_ANY_TESTS=${FLAGS_TRUE} |
| 249 | 243 |
| 250 # HACK: Temporary hack for cros-workon conversion | 244 # HACK: Temporary hack for cros-workon conversion |
| 251 [[ -n "${CROS_WORKON_SRCROOT}" ]] && WORKON_SUFFIX=_workon | 245 [[ -n "${CROS_WORKON_SRCROOT}" ]] && WORKON_SUFFIX=_workon |
| 252 | 246 |
| 253 local enter_chroot="" | 247 local enter_chroot="" |
| 254 local autotest="${GCLIENT_ROOT}/src/scripts/autotest${WORKON_SUFFIX}" | 248 local autotest="${GCLIENT_ROOT}/src/scripts/autotest${WORKON_SUFFIX}" |
| 255 if [[ ${INSIDE_CHROOT} -eq 0 ]]; then | 249 if [[ ${INSIDE_CHROOT} -eq 0 ]]; then |
| 256 enter_chroot="./enter_chroot.sh --chroot ${FLAGS_chroot} --" | 250 enter_chroot="./enter_chroot.sh --chroot ${FLAGS_chroot} --" |
| 257 autotest="./autotest${WORKON_SUFFIX}" | 251 autotest="./autotest${WORKON_SUFFIX}" |
| 258 fi | 252 fi |
| 259 | 253 |
| 260 # Remove chrome autotest location prefix from control_file if needed | 254 # Remove chrome autotest location prefix from control_file if needed |
| 261 if [[ ${control_file:0:${#chrome_autotests}} == \ | 255 if [[ ${control_file:0:${#chrome_autotests}} == \ |
| 262 "${chrome_autotests}" ]]; then | 256 "${chrome_autotests}" ]]; then |
| 263 control_file="${control_file:${#chrome_autotests}+1}" | 257 control_file="${control_file:${#chrome_autotests}+1}" |
| 264 echo_color "yellow" ">>> Running chrome autotest " ${control_file} | 258 echo_color "yellow" ">>> Running chrome autotest " ${control_file} |
| 265 fi | 259 fi |
| 260 if [[ -n "${FLAGS_args}" ]]; then |
| 261 passthrough_args="--args=${FLAGS_args}" |
| 262 fi |
| 266 | 263 |
| 267 ${enter_chroot} ${autotest} --board "${FLAGS_board}" -m "${FLAGS_remote}" \ | 264 ${enter_chroot} ${autotest} --board "${FLAGS_board}" -m "${FLAGS_remote}" \ |
| 268 --ssh-port ${FLAGS_ssh_port} \ | 265 --ssh-port ${FLAGS_ssh_port} \ |
| 269 "${option}" "${control_file}" -r "${results_dir}" ${verbose} \ | 266 "${option}" "${control_file}" -r "${results_dir}" ${verbose} \ |
| 270 "${args[@]}" | 267 "${passthrough_args}" |
| 271 done | 268 done |
| 272 | 269 |
| 273 echo "" | 270 echo "" |
| 274 echo_color "yellow" ">>> Test results:" | 271 echo_color "yellow" ">>> Test results:" |
| 275 ./generate_test_report "${TMP}" --strip="${TMP}/" | 272 ./generate_test_report "${TMP}" --strip="${TMP}/" |
| 276 } | 273 } |
| 277 | 274 |
| 278 main "$@" | 275 main "$@" |
| OLD | NEW |