| 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 16 matching lines...) Expand all Loading... |
| 27 . "${SCRIPT_ROOT}/common.sh" || (echo "Unable to load common.sh" && exit 1) | 27 . "${SCRIPT_ROOT}/common.sh" || (echo "Unable to load common.sh" && exit 1) |
| 28 # --- END COMMON.SH BOILERPLATE --- | 28 # --- END COMMON.SH BOILERPLATE --- |
| 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 get_default_board | 34 get_default_board |
| 35 | 35 |
| 36 DEFINE_string board "$DEFAULT_BOARD" \ | 36 DEFINE_string board "$DEFAULT_BOARD" \ |
| 37 "The board for which you built autotest." | 37 "The board for which you built autotest." b |
| 38 DEFINE_boolean build ${FLAGS_FALSE} "Build tets while running" b | |
| 39 DEFINE_string image_path "" "Full path of the VM image" | 38 DEFINE_string image_path "" "Full path of the VM image" |
| 40 DEFINE_string results_dir_root "" "alternate root results directory" | 39 DEFINE_string results_dir_root "" "alternate root results directory" |
| 41 DEFINE_string test_case "" "Name of the test case to run" | 40 DEFINE_string test_case "" "Name of the test case to run" |
| 42 DEFINE_boolean use_emerged ${FLAGS_FALSE} \ | 41 DEFINE_boolean use_emerged ${FLAGS_FALSE} \ |
| 43 "Force use of emerged autotest packages" | 42 "Force use of emerged autotest packages" |
| 44 DEFINE_string verify_chrome_version "" \ | 43 DEFINE_string verify_chrome_version "" \ |
| 45 "Verify that this chrome version matches that on vm." | 44 "Verify that this chrome version matches that on vm." |
| 46 | 45 |
| 47 set -e | 46 set -e |
| 48 | 47 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 chrome_version_on_vm=$("${SCRIPTS_DIR}/bin/cros_get_chrome_version" \ | 94 chrome_version_on_vm=$("${SCRIPTS_DIR}/bin/cros_get_chrome_version" \ |
| 96 --remote=127.0.0.1 \ | 95 --remote=127.0.0.1 \ |
| 97 --ssh_port=${FLAGS_ssh_port}) | 96 --ssh_port=${FLAGS_ssh_port}) |
| 98 [[ ${chrome_version_on_vm} == ${FLAGS_verify_chrome_version} ]] || \ | 97 [[ ${chrome_version_on_vm} == ${FLAGS_verify_chrome_version} ]] || \ |
| 99 warn "CHROME_VERSION is no longer set.This check will be removed" | 98 warn "CHROME_VERSION is no longer set.This check will be removed" |
| 100 else | 99 else |
| 101 warn "${FLAGS_verify_chrome_version} is not a valid Chrome version" | 100 warn "${FLAGS_verify_chrome_version} is not a valid Chrome version" |
| 102 fi | 101 fi |
| 103 fi | 102 fi |
| 104 | 103 |
| 105 # Set the build flag for run_remote_tests. | |
| 106 BUILD_FLAG="" | |
| 107 [ ${FLAGS_build}-eq ${FLAGS_true} ] && BUILD_FLAG="--build" | |
| 108 | |
| 109 "${SCRIPTS_DIR}/run_remote_tests.sh" \ | 104 "${SCRIPTS_DIR}/run_remote_tests.sh" \ |
| 110 --board=${FLAGS_board} \ | 105 --board=${FLAGS_board} \ |
| 111 ${BUILD_FLAG} \ | |
| 112 --ssh_port=${FLAGS_ssh_port} \ | 106 --ssh_port=${FLAGS_ssh_port} \ |
| 113 --remote=127.0.0.1 \ | 107 --remote=127.0.0.1 \ |
| 114 --results_dir_root="${FLAGS_results_dir_root}" \ | 108 --results_dir_root="${FLAGS_results_dir_root}" \ |
| 115 ${USE_EMERGED} \ | 109 ${USE_EMERGED} \ |
| 116 "${tests[@]}" | 110 "${tests[@]}" |
| OLD | NEW |