[crosutils] Propagate use_emerged flag up from run_remote_tests

BUG=8544
TEST=build chrome with build_tests, cros_workon start autotest, and then run desktopui_BrowserTest with cros_run_parallel_vm_tests

Change-Id: I19e181238fd75450d41f6debb3a8f7d0c17d15dc

Review URL: http://codereview.chromium.org/4669007
This commit is contained in:
Chris Masone 2010-11-09 14:23:29 -08:00
parent d11ce17167
commit f8513d84fe
2 changed files with 16 additions and 3 deletions

View File

@ -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()

View File

@ -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[@]}"