diff --git a/bin/cros_run_parallel_vm_tests.py b/bin/cros_run_parallel_vm_tests.py index 0c0b08b88a..2ca51a3afa 100755 --- a/bin/cros_run_parallel_vm_tests.py +++ b/bin/cros_run_parallel_vm_tests.py @@ -27,7 +27,8 @@ class ParallelTestRunner(object): """ def __init__(self, tests, base_ssh_port=_DEFAULT_BASE_SSH_PORT, board=None, - image_path=None, order_output=False, results_dir_root=None): + image_path=None, order_output=False, results_dir_root=None, + use_emerged=False): """Constructs and initializes the test runner class. Args: @@ -50,6 +51,7 @@ class ParallelTestRunner(object): self._image_path = image_path self._order_output = order_output self._results_dir_root = results_dir_root + self._use_emerged = use_emerged def _SpawnTests(self): """Spawns VMs and starts the test runs on them. @@ -75,6 +77,7 @@ class ParallelTestRunner(object): if self._results_dir_root: args.append('--results_dir_root=%s/%s.%d' % (self._results_dir_root, test, ssh_port)) + if self._use_emerged: args.append('--use_emerged') Info('Running %r...' % args) output = None if self._order_output: @@ -142,6 +145,8 @@ def main(): parser.add_option('--results_dir_root', help='Root results directory. If none specified, each test ' 'will store its results in a separate /tmp directory.') + parser.add_option('--use_emerged', action='store_true', default=False, + help='Force use of emerged autotest packages') (options, args) = parser.parse_args() if not args: @@ -150,7 +155,7 @@ def main(): runner = ParallelTestRunner(args, options.base_ssh_port, options.board, options.image_path, options.order_output, - options.results_dir_root) + options.results_dir_root, options.use_emerged) runner.Run() diff --git a/bin/cros_run_vm_test b/bin/cros_run_vm_test index 6f5ded2f72..fbbee23c7c 100755 --- a/bin/cros_run_vm_test +++ b/bin/cros_run_vm_test @@ -15,10 +15,12 @@ MAX_RETRIES=3 get_default_board DEFINE_string board "$DEFAULT_BOARD" \ - "The board for which you built autotest." + "The board for which you built autotest." b DEFINE_string image_path "" "Full path of the VM image" DEFINE_string results_dir_root "" "alternate root results directory" DEFINE_string test_case "" "Name of the test case to run" +DEFINE_boolean use_emerged ${FLAGS_FALSE} \ + "Force use of emerged autotest packages" set -e @@ -44,6 +46,11 @@ if [ -z "${FLAGS_test_case}" ] && [ -z "${FLAGS_ARGV}" ]; then die "You must specify a test case." fi +USE_EMERGED= +if [[ ${FLAGS_use_emerged} -eq ${FLAGS_TRUE} ]]; then + USE_EMERGED="--use_emerged" +fi + tests=( ) [ -n "${FLAGS_test_case}" ] && tests=( "${FLAGS_test_case}" ) for test in ${FLAGS_ARGV}; do @@ -59,4 +66,5 @@ retry_until_ssh ${MAX_RETRIES} --ssh_port=${FLAGS_ssh_port} \ --remote=127.0.0.1 \ --results_dir_root="${FLAGS_results_dir_root}" \ + ${USE_EMERGED} \ "${tests[@]}"