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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 264 |
265 RAN_ANY_TESTS=${FLAGS_TRUE} | 265 RAN_ANY_TESTS=${FLAGS_TRUE} |
266 | 266 |
267 # Remove chrome autotest location prefix from control_file if needed | 267 # Remove chrome autotest location prefix from control_file if needed |
268 if [[ ${control_file:0:${#chrome_autotests}} == \ | 268 if [[ ${control_file:0:${#chrome_autotests}} == \ |
269 "${chrome_autotests}" ]]; then | 269 "${chrome_autotests}" ]]; then |
270 control_file="${control_file:${#chrome_autotests}+1}" | 270 control_file="${control_file:${#chrome_autotests}+1}" |
271 info "Running chrome autotest ${control_file}" | 271 info "Running chrome autotest ${control_file}" |
272 fi | 272 fi |
273 | 273 |
274 export AUTOSERV_TEST_ARGS="${FLAGS_args}" | 274 local autoserv_args="-m ${FLAGS_remote} \ |
275 export AUTOSERV_ARGS="-m ${FLAGS_remote} \ | |
276 --ssh-port ${FLAGS_ssh_port} \ | 275 --ssh-port ${FLAGS_ssh_port} \ |
277 ${option} ${control_file} -r ${results_dir} ${verbose}" | 276 ${option} ${control_file} -r ${results_dir} ${verbose}" |
| 277 if [ -n "${FLAGS_args}" ]; then |
| 278 autoserv_args="${autoserv_args} -a \"${FLAGS_args}\"" |
| 279 fi |
278 if [ ${FLAGS_build} -eq ${FLAGS_FALSE} ]; then | 280 if [ ${FLAGS_build} -eq ${FLAGS_FALSE} ]; then |
279 cat > "${TMP}/run_test.sh" <<EOF | 281 cat > "${TMP}/run_test.sh" <<EOF |
280 export AUTOSERV_TEST_ARGS="${AUTOSERV_TEST_ARGS}" | 282 cd ${autotest_dir} |
281 export AUTOSERV_ARGS="${AUTOSERV_ARGS}" | 283 ./server/autoserv ${AUTOSERV_ARGS} |
282 cd /home/${USER}/trunk/src/scripts | |
283 ./autotest_run.sh --board "${FLAGS_board}" | |
284 EOF | 284 EOF |
285 chmod a+rx "${TMP}/run_test.sh" | 285 chmod a+rx "${TMP}/run_test.sh" |
286 ${ENTER_CHROOT} ${TMP_INSIDE_CHROOT}/run_test.sh >&2 | 286 ${ENTER_CHROOT} ${TMP_INSIDE_CHROOT}/run_test.sh >&2 |
287 else | 287 else |
288 cp "${BUILD_DIR}/environment" "${TMP}/run_test.sh" | 288 cp "${BUILD_DIR}/environment" "${TMP}/run_test.sh" |
289 GRAPHICS_BACKEND=${GRAPHICS_BACKEND:-OPENGL} | 289 GRAPHICS_BACKEND=${GRAPHICS_BACKEND:-OPENGL} |
290 if [ -n "${AUTOSERV_TEST_ARGS}" ]; then | |
291 AUTOSERV_TEST_ARGS="-a \"${AUTOSERV_TEST_ARGS}\"" | |
292 fi | |
293 cat >> "${TMP}/run_test.sh" <<EOF | 290 cat >> "${TMP}/run_test.sh" <<EOF |
294 export GCLIENT_ROOT=/home/${USER}/trunk | 291 export GCLIENT_ROOT=/home/${USER}/trunk |
295 export GRAPHICS_BACKEND=${GRAPHICS_BACKEND} | 292 export GRAPHICS_BACKEND=${GRAPHICS_BACKEND} |
296 export SSH_AUTH_SOCK=${SSH_AUTH_SOCK} TMPDIR=/tmp SSH_AGENT_PID=${SSH_AGENT_PID} | 293 export SSH_AUTH_SOCK=${SSH_AUTH_SOCK} TMPDIR=/tmp SSH_AGENT_PID=${SSH_AGENT_PID} |
297 export SYSROOT=/build/${FLAGS_board} | 294 export SYSROOT=/build/${FLAGS_board} |
298 tc-export CC CXX PKG_CONFIG | 295 tc-export CC CXX PKG_CONFIG |
299 cd ${INSIDE_BUILD_DIR} | 296 cd ${INSIDE_BUILD_DIR} |
300 ./server/autoserv ${AUTOSERV_ARGS} ${AUTOSERV_TEST_ARGS} | 297 ./server/autoserv ${autoserv_args} |
301 EOF | 298 EOF |
302 sudo cp "${TMP}/run_test.sh" "${BUILD_DIR}" | 299 sudo cp "${TMP}/run_test.sh" "${BUILD_DIR}" |
303 sudo chmod a+rx "${BUILD_DIR}/run_test.sh" | 300 sudo chmod a+rx "${BUILD_DIR}/run_test.sh" |
304 ${ENTER_CHROOT} sudo bash -c "${INSIDE_BUILD_DIR}/run_test.sh" >&2 | 301 ${ENTER_CHROOT} sudo bash -c "${INSIDE_BUILD_DIR}/run_test.sh" >&2 |
305 fi | 302 fi |
306 done | 303 done |
307 | 304 |
308 echo "" | 305 echo "" |
309 info "Test results:" | 306 info "Test results:" |
310 ./generate_test_report "${TMP}" --strip="${TMP}/" | 307 ./generate_test_report "${TMP}" --strip="${TMP}/" |
311 | 308 |
312 print_time_elapsed | 309 print_time_elapsed |
313 } | 310 } |
314 | 311 |
315 main "$@" | 312 main "$@" |
OLD | NEW |