Added --test_args parameter that passes its value as -a flag to autoserv.

Review URL: http://codereview.chromium.org/1794004
This commit is contained in:
Anton (whywhat) Vayvod 2010-04-28 21:51:16 +04:00
parent d036780bd1
commit 9ffc3b32a3
2 changed files with 17 additions and 4 deletions

View File

@ -57,6 +57,9 @@ parser.allow_interspersed_args = True
DEFAULT_BOARD = os.environ.get('DEFAULT_BOARD', '')
parser.add_option('--args', dest='args', action='store',
default='',
help='The arguments to pass to the test control file.')
parser.add_option('--autox', dest='autox', action='store_true',
default=True,
help='Build autox along with autotest [default].')
@ -188,12 +191,14 @@ def build_autotest(options):
return run(emerge_cmd)
def run_autoserv(board, args):
def run_autoserv(options, args):
environ = os.environ
environ['AUTOSERV_TEST_ARGS'] = options.args
environ['AUTOSERV_ARGS'] = ' '.join(args)
environ['FEATURES'] = ('%s -buildpkg -digest noauto' %
environ.get('FEATURES', ''))
ebuild_cmd = ['ebuild-%s' % board,
ebuild_cmd = ['ebuild-%s' % options.board,
'../third_party/chromiumos-overlay/chromeos-base/'
'autotest/autotest-0.0.1.ebuild',
'clean', 'unpack', 'test']
@ -216,7 +221,7 @@ def main():
ssh_key_file = os.path.join(os.path.dirname(me),
'mod_for_test_scripts/ssh_keys/testing_rsa')
os.chmod(ssh_key_file, 0400)
run_autoserv(options.board, args)
run_autoserv(options, args)
if __name__ == '__main__':

View File

@ -14,6 +14,7 @@
get_default_board
DEFINE_string args "" "Command line arguments for test, separated with comma" a
DEFINE_string board "$DEFAULT_BOARD" \
"The board for which you are building autotest"
DEFINE_string chroot "${DEFAULT_CHROOT_DIR}" "alternate chroot location" c
@ -242,6 +243,12 @@ function main() {
if [[ ${FLAGS_verbose} -eq $FLAGS_TRUE ]]; then
verbose="--verbose"
fi
local args=()
if [[ -n "${FLAGS_args}" ]]; then
local with_spaces=""
with_spaces=${FLAGS_args//,/ }
args=("-a" "${with_spaces}")
fi
RAN_ANY_TESTS=${FLAGS_TRUE}
@ -253,7 +260,8 @@ function main() {
fi
${enter_chroot} ${autotest} --board "${FLAGS_board}" -m "${FLAGS_remote}" \
"${option}" "${control_file}" -r "${results_dir}" ${verbose}
"${option}" "${control_file}" -r "${results_dir}" ${verbose} \
"${args[@]}"
results_dir="${TMP}/${results_dir_name}"
local test_status="${results_dir}/status.log"