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
This commit is contained in:
Ken Mixter 2010-02-08 19:26:07 -08:00
parent fdda89f49f
commit d00425ef50
3 changed files with 11 additions and 10 deletions

View File

@ -8,11 +8,12 @@
# the given source directory. # the given source directory.
# args: # args:
# $1 - original source directory # $1 - original source directory
# $2 - target directory
function update_chroot_autotest() { function update_chroot_autotest() {
local original=$1 local original=$1
echo "Updating chroot Autotest from ${original}..." local target=$2
local autotest_dir="${DEFAULT_CHROOT_DIR}/usr/local/autotest" echo "Updating chroot Autotest from ${original} to ${target}..."
sudo mkdir -p "${autotest_dir}" sudo mkdir -p "${target}"
sudo chmod 777 "${autotest_dir}" sudo chmod 777 "${target}"
cp -fpru ${original}/{client,conmux,server,tko,utils,global_config.ini,shadow_config.ini} ${autotest_dir} cp -fpru ${original}/{client,conmux,server,tko,utils,global_config.ini,shadow_config.ini} ${target}
} }

View File

@ -38,7 +38,8 @@ AUTOTEST_DEST="/usr/local/autotest"
# Copy a local "installation" of autotest into the chroot, to avoid # Copy a local "installation" of autotest into the chroot, to avoid
# polluting the src dir with tmp files, results, etc. # 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. # Create python package init files for top level test case dirs.
function touchInitPy() { function touchInitPy() {

View File

@ -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_boolean update_db ${FLAGS_FALSE} "Put results in autotest database" u
DEFINE_string machine_desc "" "Machine description used in database" DEFINE_string machine_desc "" "Machine description used in database"
DEFINE_string build_desc "" "Build 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" DEFINE_string results_dir_root "" "alternate root results directory"
function cleanup() { function cleanup() {
@ -104,8 +104,6 @@ function main() {
set -e set -e
local autotest_dir="${DEFAULT_CHROOT_DIR}/usr/local/autotest"
# Set global TMP for remote_access.sh's sake # Set global TMP for remote_access.sh's sake
TMP=$(mktemp -d /tmp/run_remote_tests.XXXX) 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 # is just modifying scripts, they take effect without having to wait
# for the laborious build_autotest.sh command. # for the laborious build_autotest.sh command.
local original="${GCLIENT_ROOT}/src/third_party/autotest/files" 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" local autoserv="${autotest_dir}/server/autoserv"