| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 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 # Runs a given test case under a VM. | 7 # Runs a given test case under a VM. |
| 8 | 8 |
| 9 # --- BEGIN COMMON.SH BOILERPLATE --- | 9 # --- BEGIN COMMON.SH BOILERPLATE --- |
| 10 # Load common CrOS utilities. Inside the chroot this file is installed in | 10 # Load common CrOS utilities. Inside the chroot this file is installed in |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 . "${SCRIPT_ROOT}/lib/cros_vm_lib.sh" || die "Unable to load cros_vm_lib.sh" | 30 . "${SCRIPT_ROOT}/lib/cros_vm_lib.sh" || die "Unable to load cros_vm_lib.sh" |
| 31 . "${SCRIPT_ROOT}/lib/cros_vm_constants.sh" || \ | 31 . "${SCRIPT_ROOT}/lib/cros_vm_constants.sh" || \ |
| 32 die "Unable to load cros_vm_constants.sh" | 32 die "Unable to load cros_vm_constants.sh" |
| 33 | 33 |
| 34 MAX_RETRIES=3 | 34 MAX_RETRIES=3 |
| 35 | 35 |
| 36 get_default_board | 36 get_default_board |
| 37 | 37 |
| 38 DEFINE_string board "$DEFAULT_BOARD" \ | 38 DEFINE_string board "$DEFAULT_BOARD" \ |
| 39 "The board for which you built autotest." b | 39 "The board for which you built autotest." |
| 40 DEFINE_boolean build ${FLAGS_FALSE} "Build tets while running" b |
| 40 DEFINE_string image_path "" "Full path of the VM image" | 41 DEFINE_string image_path "" "Full path of the VM image" |
| 41 DEFINE_string results_dir_root "" "alternate root results directory" | 42 DEFINE_string results_dir_root "" "alternate root results directory" |
| 42 DEFINE_string test_case "" "Name of the test case to run" | 43 DEFINE_string test_case "" "Name of the test case to run" |
| 43 DEFINE_boolean use_emerged ${FLAGS_FALSE} \ | 44 DEFINE_boolean use_emerged ${FLAGS_FALSE} \ |
| 44 "Force use of emerged autotest packages" | 45 "Force use of emerged autotest packages" |
| 45 DEFINE_string verify_chrome_version "" \ | 46 DEFINE_string verify_chrome_version "" \ |
| 46 "Verify that this chrome version matches that on vm." | 47 "Verify that this chrome version matches that on vm." |
| 47 | 48 |
| 48 set -e | 49 set -e |
| 49 | 50 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 chrome_version_on_vm=$("${SCRIPTS_DIR}/bin/cros_get_chrome_version" \ | 98 chrome_version_on_vm=$("${SCRIPTS_DIR}/bin/cros_get_chrome_version" \ |
| 98 --remote=127.0.0.1 \ | 99 --remote=127.0.0.1 \ |
| 99 --ssh_port=${FLAGS_ssh_port}) | 100 --ssh_port=${FLAGS_ssh_port}) |
| 100 [[ ${chrome_version_on_vm} == ${FLAGS_verify_chrome_version} ]] || \ | 101 [[ ${chrome_version_on_vm} == ${FLAGS_verify_chrome_version} ]] || \ |
| 101 warn "CHROME_VERSION is no longer set.This check will be removed" | 102 warn "CHROME_VERSION is no longer set.This check will be removed" |
| 102 else | 103 else |
| 103 warn "${FLAGS_verify_chrome_version} is not a valid Chrome version" | 104 warn "${FLAGS_verify_chrome_version} is not a valid Chrome version" |
| 104 fi | 105 fi |
| 105 fi | 106 fi |
| 106 | 107 |
| 108 # Set the build flag for run_remote_tests. |
| 109 BUILD_FLAG="" |
| 110 [ ${FLAGS_build}-eq ${FLAGS_true} ] && BUILD_FLAG="--build" |
| 111 |
| 107 "${SCRIPTS_DIR}/run_remote_tests.sh" \ | 112 "${SCRIPTS_DIR}/run_remote_tests.sh" \ |
| 108 --board=${FLAGS_board} \ | 113 --board=${FLAGS_board} \ |
| 114 ${BUILD_FLAG} \ |
| 109 --ssh_port=${FLAGS_ssh_port} \ | 115 --ssh_port=${FLAGS_ssh_port} \ |
| 110 --remote=127.0.0.1 \ | 116 --remote=127.0.0.1 \ |
| 111 --results_dir_root="${FLAGS_results_dir_root}" \ | 117 --results_dir_root="${FLAGS_results_dir_root}" \ |
| 112 ${USE_EMERGED} \ | 118 ${USE_EMERGED} \ |
| 113 "${tests[@]}" | 119 "${tests[@]}" |
| OLD | NEW |