From 6f209d1333cead65f42b773c3b9f64f4623b8159 Mon Sep 17 00:00:00 2001 From: Eric Li Date: Fri, 19 Nov 2010 10:43:47 -0800 Subject: [PATCH] Remove the dependency to autotest_run.sh so I can get rid of it in next CL. Change-Id: Ieaa2553612aefd6161785185350d495cbf0dad81 BUG=9291 TEST=Run storageFio test since it need prebuild test and deps. w/wo emerge autotest w/wo cros_workon in/outside of chroot. w/wo --used_emerged w/wo --results_dir_root and all its combinations. Review URL: http://codereview.chromium.org/5212003 --- autotest_run.sh | 74 --------------------------------------------- run_remote_tests.sh | 22 +++++++------- 2 files changed, 11 insertions(+), 85 deletions(-) delete mode 100755 autotest_run.sh diff --git a/autotest_run.sh b/autotest_run.sh deleted file mode 100755 index 17774074e2..0000000000 --- a/autotest_run.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2010 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# This script is intended as a wrapper to execute autotest tests for a given -# board. - -# Load common constants. This should be the first executable line. -# The path to common.sh should be relative to your script's location. -. "$(dirname "$0")/common.sh" - -# Script must be run inside the chroot -restart_in_chroot_if_needed $* -get_default_board - -DEFINE_string board "${DEFAULT_BOARD}" \ - "The board to run tests for." - -FLAGS_HELP="usage: $0 " -FLAGS "$@" || exit 1 -eval set -- "${FLAGS_ARGV}" - -# Define a directory which will not be cleaned by portage automatically. So we -# could achieve incremental build between two autoserv runs. -BUILD_RUNTIME="/build/${FLAGS_board}/usr/local/autotest/" - -# Hack: set the CHROMEOS_ROOT variable by hand here -CHROMEOS_ROOT=/home/${USER}/trunk/ - -# Ensure the configures run by autotest pick up the right config.site -CONFIG_SITE=/usr/share/config.site - -[ -z "${FLAGS_board}" ] && \ - die "You must specify --board=" - -function setup_ssh() { - eval $(ssh-agent) > /dev/null - # TODO(jrbarnette): This is a temporary hack, slated for removal - # before it was ever created. It's a bug, and you should fix it - # right away! - chmod 400 \ - ${CHROMEOS_ROOT}/src/scripts/mod_for_test_scripts/ssh_keys/testing_rsa - ssh-add \ - ${CHROMEOS_ROOT}/src/scripts/mod_for_test_scripts/ssh_keys/testing_rsa -} - -function teardown_ssh() { - ssh-agent -k > /dev/null -} - -src_test() { - # TODO: These places currently need to be writeable but shouldn't be - sudo chmod a+w ${BUILD_RUNTIME}/server/{tests,site_tests} - - setup_ssh - cd "${BUILD_RUNTIME}" - - local args=() - if [[ -n ${AUTOSERV_TEST_ARGS} ]]; then - args=("-a" "${AUTOSERV_TEST_ARGS}") - fi - - local timestamp=$(date +%Y-%m-%d-%H.%M.%S) - - # Do not use sudo, it'll unset all your environment - LOGNAME=${USER} ./server/autoserv -r /tmp/results.${timestamp} \ - ${AUTOSERV_ARGS} "${args[@]}" - - teardown_ssh -} - -src_test diff --git a/run_remote_tests.sh b/run_remote_tests.sh index babbbdceb0..0c644d46f1 100755 --- a/run_remote_tests.sh +++ b/run_remote_tests.sh @@ -271,25 +271,24 @@ function main() { info "Running chrome autotest ${control_file}" fi - export AUTOSERV_TEST_ARGS="${FLAGS_args}" - export AUTOSERV_ARGS="-m ${FLAGS_remote} \ - --ssh-port ${FLAGS_ssh_port} \ + local autoserv_test_args="${FLAGS_args}" + if [ -n "${autoserv_test_args}" ]; then + autoserv_test_args="-a \"${autoserv_test_args}\"" + fi + local autoserv_args="-m ${FLAGS_remote} --ssh-port ${FLAGS_ssh_port} \ ${option} ${control_file} -r ${results_dir} ${verbose}" if [ ${FLAGS_build} -eq ${FLAGS_FALSE} ]; then cat > "${TMP}/run_test.sh" <&2 else cp "${BUILD_DIR}/environment" "${TMP}/run_test.sh" GRAPHICS_BACKEND=${GRAPHICS_BACKEND:-OPENGL} - if [ -n "${AUTOSERV_TEST_ARGS}" ]; then - AUTOSERV_TEST_ARGS="-a \"${AUTOSERV_TEST_ARGS}\"" - fi cat >> "${TMP}/run_test.sh" <