From d00425ef50f3957728d57edc98be1c1be9b560d0 Mon Sep 17 00:00:00 2001 From: Ken Mixter Date: Mon, 8 Feb 2010 19:26:07 -0800 Subject: [PATCH] Support multiple chroots this is necessary for portage-based builds which change the chroot. You must pass --chroot to the run_remote_tests in this case. Review URL: http://codereview.chromium.org/588010 --- autotest_lib.sh | 11 ++++++----- build_autotest.sh | 3 ++- run_remote_tests.sh | 7 +++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/autotest_lib.sh b/autotest_lib.sh index ac7be63156..b640a9ea70 100644 --- a/autotest_lib.sh +++ b/autotest_lib.sh @@ -8,11 +8,12 @@ # the given source directory. # args: # $1 - original source directory +# $2 - target directory function update_chroot_autotest() { local original=$1 - echo "Updating chroot Autotest from ${original}..." - local autotest_dir="${DEFAULT_CHROOT_DIR}/usr/local/autotest" - sudo mkdir -p "${autotest_dir}" - sudo chmod 777 "${autotest_dir}" - cp -fpru ${original}/{client,conmux,server,tko,utils,global_config.ini,shadow_config.ini} ${autotest_dir} + local target=$2 + echo "Updating chroot Autotest from ${original} to ${target}..." + sudo mkdir -p "${target}" + sudo chmod 777 "${target}" + cp -fpru ${original}/{client,conmux,server,tko,utils,global_config.ini,shadow_config.ini} ${target} } diff --git a/build_autotest.sh b/build_autotest.sh index 6e81a04d0a..540c3857ad 100755 --- a/build_autotest.sh +++ b/build_autotest.sh @@ -38,7 +38,8 @@ AUTOTEST_DEST="/usr/local/autotest" # Copy a local "installation" of autotest into the chroot, to avoid # polluting the src dir with tmp files, results, etc. -update_chroot_autotest "${CHROOT_TRUNK_DIR}/src/third_party/autotest/files" +update_chroot_autotest "${CHROOT_TRUNK_DIR}/src/third_party/autotest/files" \ + "${AUTOTEST_DEST}" # Create python package init files for top level test case dirs. function touchInitPy() { diff --git a/run_remote_tests.sh b/run_remote_tests.sh index 4801b8a556..4598a65545 100755 --- a/run_remote_tests.sh +++ b/run_remote_tests.sh @@ -22,7 +22,7 @@ DEFINE_boolean verbose ${FLAGS_FALSE} "Show verbose autoserv output" v DEFINE_boolean update_db ${FLAGS_FALSE} "Put results in autotest database" u DEFINE_string machine_desc "" "Machine description used in database" DEFINE_string build_desc "" "Build description used in database" -DEFINE_string chroot_dir "${DEFAULT_CHROOT_DIR}" "alternate chroot location" c +DEFINE_string chroot "${DEFAULT_CHROOT_DIR}" "alternate chroot location" c DEFINE_string results_dir_root "" "alternate root results directory" function cleanup() { @@ -104,8 +104,6 @@ function main() { set -e - local autotest_dir="${DEFAULT_CHROOT_DIR}/usr/local/autotest" - # Set global TMP for remote_access.sh's sake TMP=$(mktemp -d /tmp/run_remote_tests.XXXX) @@ -117,7 +115,8 @@ function main() { # is just modifying scripts, they take effect without having to wait # for the laborious build_autotest.sh command. local original="${GCLIENT_ROOT}/src/third_party/autotest/files" - update_chroot_autotest "${original}" + local autotest_dir="${FLAGS_chroot}/usr/local/autotest" + update_chroot_autotest "${original}" "${autotest_dir}" local autoserv="${autotest_dir}/server/autoserv"