| 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 # This can only run inside the chroot. |
| 8 . $(dirname "$(readlink -f "$0")")/outside_chroot_common.sh 2> /dev/null || | 8 CROSUTILS=/usr/lib/crosutils |
| 9 SCRIPT_ROOT=/usr/lib/crosutils | 9 . "${CROSUTILS}/common.sh" || exit 1 |
| 10 . "${SCRIPT_ROOT}/common.sh" || | 10 . "${CROSUTILS}/remote_access.sh" || die "Unable to load remote_access.sh" |
| 11 (echo "Unable to load common.sh" && false) || | |
| 12 exit 1 | |
| 13 . "${SCRIPT_ROOT}/remote_access.sh" || die "Unable to load remote_access.sh" | |
| 14 | 11 |
| 15 DEFINE_string args "" \ | 12 DEFINE_string args "" \ |
| 16 "Command line arguments for test. Quoted and space separated if multiple." a | 13 "Command line arguments for test. Quoted and space separated if multiple." a |
| 17 DEFINE_string autotest_dir "" \ | 14 DEFINE_string autotest_dir "" \ |
| 18 "Skip autodetection of autotest and use the specified location (must be in \ | 15 "Skip autodetection of autotest and use the specified location (must be in \ |
| 19 chroot)." | 16 chroot)." |
| 20 DEFINE_string board "" \ | 17 DEFINE_string board "" \ |
| 21 "The board for which you are building autotest" | 18 "The board for which you are building autotest" |
| 22 DEFINE_boolean build ${FLAGS_FALSE} "Build tests while running" b | 19 DEFINE_boolean build ${FLAGS_FALSE} "Build tests while running" b |
| 23 DEFINE_string chroot "${DEFAULT_CHROOT_DIR}" "alternate chroot location" c | |
| 24 DEFINE_boolean cleanup ${FLAGS_FALSE} "Clean up temp directory" | 20 DEFINE_boolean cleanup ${FLAGS_FALSE} "Clean up temp directory" |
| 25 DEFINE_integer iterations 1 "Iterations to run every top level test" i | 21 DEFINE_integer iterations 1 "Iterations to run every top level test" i |
| 26 DEFINE_string results_dir_root "" "alternate root results directory" | 22 DEFINE_string results_dir_root "" "alternate root results directory" |
| 27 DEFINE_boolean verbose ${FLAGS_FALSE} "Show verbose autoserv output" v | 23 DEFINE_boolean verbose ${FLAGS_FALSE} "Show verbose autoserv output" v |
| 28 DEFINE_boolean use_emerged ${FLAGS_FALSE} \ | 24 DEFINE_boolean use_emerged ${FLAGS_FALSE} \ |
| 29 "Force use of emerged autotest packages" | 25 "Force use of emerged autotest packages" |
| 30 | 26 |
| 31 RAN_ANY_TESTS=${FLAGS_FALSE} | 27 RAN_ANY_TESTS=${FLAGS_FALSE} |
| 32 | 28 |
| 33 function stop_ssh_agent() { | 29 function stop_ssh_agent() { |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 (. ${BUILD_ENV} && tc-export CC CXX PKG_CONFIG && | 315 (. ${BUILD_ENV} && tc-export CC CXX PKG_CONFIG && |
| 320 ./server/autoserv ${autoserv_args}) | 316 ./server/autoserv ${autoserv_args}) |
| 321 else | 317 else |
| 322 ./server/autoserv ${autoserv_args} | 318 ./server/autoserv ${autoserv_args} |
| 323 fi | 319 fi |
| 324 done | 320 done |
| 325 popd > /dev/null | 321 popd > /dev/null |
| 326 | 322 |
| 327 echo "" | 323 echo "" |
| 328 info "Test results:" | 324 info "Test results:" |
| 329 ./generate_test_report "${TMP}" --strip="${TMP}/" | 325 generate_test_report "${TMP}" --strip="${TMP}/" |
| 330 | 326 |
| 331 print_time_elapsed | 327 print_time_elapsed |
| 332 } | 328 } |
| 333 | 329 |
| 334 restart_in_chroot_if_needed "$@" | |
| 335 main "$@" | 330 main "$@" |
| OLD | NEW |