mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-25 12:31:34 +01:00
Change run_remote_tests from portage build env.
Review URL: http://codereview.chromium.org/606054
This commit is contained in:
parent
944281ff8b
commit
cbbb239570
@ -4,6 +4,35 @@
|
|||||||
#
|
#
|
||||||
# Provides common commands for dealing running/building autotest
|
# Provides common commands for dealing running/building autotest
|
||||||
|
|
||||||
|
DEFINE_string board "" "The board for which you are building autotest"
|
||||||
|
|
||||||
|
function check_board() {
|
||||||
|
local board_names=""
|
||||||
|
local index=1
|
||||||
|
local found=0
|
||||||
|
for board in ../overlays/overlay-*
|
||||||
|
do
|
||||||
|
board_names[index]=${board:20}
|
||||||
|
index+=1
|
||||||
|
if [ "${FLAGS_board}" == "${board:20}" ]
|
||||||
|
then
|
||||||
|
found=1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ${found} -eq 0 ]
|
||||||
|
then
|
||||||
|
echo "You are required to specify a supported board from the command line."
|
||||||
|
echo "Supported boards are:"
|
||||||
|
for board in ${board_names[@]}
|
||||||
|
do
|
||||||
|
echo ${board}
|
||||||
|
done
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Populates the chroot's /usr/local/autotest/$FLAGS_board directory based on
|
# Populates the chroot's /usr/local/autotest/$FLAGS_board directory based on
|
||||||
# the given source directory.
|
# the given source directory.
|
||||||
# args:
|
# args:
|
||||||
|
|||||||
@ -12,14 +12,13 @@
|
|||||||
# install the compiled client tests directly onto the rootfs image.
|
# install the compiled client tests directly onto the rootfs image.
|
||||||
|
|
||||||
. "$(dirname "$0")/common.sh"
|
. "$(dirname "$0")/common.sh"
|
||||||
|
. "$(dirname $0)/autotest_lib.sh"
|
||||||
|
|
||||||
# Script must be run inside the chroot
|
# Script must be run inside the chroot
|
||||||
assert_inside_chroot
|
assert_inside_chroot
|
||||||
|
|
||||||
DEFAULT_TESTS_LIST="all"
|
DEFAULT_TESTS_LIST="all"
|
||||||
|
|
||||||
DEFINE_string board "" \
|
|
||||||
"The board for which you are building autotest"
|
|
||||||
DEFINE_string build "${DEFAULT_TESTS_LIST}" \
|
DEFINE_string build "${DEFAULT_TESTS_LIST}" \
|
||||||
"a comma seperated list of autotest client tests to be prebuilt." b
|
"a comma seperated list of autotest client tests to be prebuilt." b
|
||||||
DEFINE_boolean prompt $FLAGS_TRUE "Prompt user when building all tests"
|
DEFINE_boolean prompt $FLAGS_TRUE "Prompt user when building all tests"
|
||||||
@ -32,18 +31,7 @@ FLAGS "$@" || exit 1
|
|||||||
eval set -- "${FLAGS_ARGV}"
|
eval set -- "${FLAGS_ARGV}"
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
check_board
|
||||||
if [ -z ${FLAGS_board} ]
|
|
||||||
then
|
|
||||||
echo "You are required to specify a board name from the command line."
|
|
||||||
echo "Supported boards are:"
|
|
||||||
for board in ../overlays/overlay-*
|
|
||||||
do
|
|
||||||
echo ${board:20}
|
|
||||||
done
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# build default pre-compile client tests list.
|
# build default pre-compile client tests list.
|
||||||
ALL_TESTS="compilebench,dbench,disktest,ltp,unixbench"
|
ALL_TESTS="compilebench,dbench,disktest,ltp,unixbench"
|
||||||
@ -59,7 +47,7 @@ if [ ${FLAGS_build} == ${DEFAULT_TESTS_LIST} ]
|
|||||||
then
|
then
|
||||||
if [ ${FLAGS_prompt} -eq ${FLAGS_TRUE} ]
|
if [ ${FLAGS_prompt} -eq ${FLAGS_TRUE} ]
|
||||||
then
|
then
|
||||||
echo -n "You want to prebuild all client tests and it may take a long time "
|
echo -n "You want to pre-build all client tests and it may take a long time"
|
||||||
echo " to finish. "
|
echo " to finish. "
|
||||||
read -p "Are you sure you want to continue?(N/y)" answer
|
read -p "Are you sure you want to continue?(N/y)" answer
|
||||||
answer=${answer:0:1}
|
answer=${answer:0:1}
|
||||||
|
|||||||
@ -24,7 +24,6 @@ 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 "${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"
|
||||||
DEFINE_string board "" "Desired board you are running the test against"
|
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
if [[ $FLAGS_cleanup -eq ${FLAGS_TRUE} ]]; then
|
if [[ $FLAGS_cleanup -eq ${FLAGS_TRUE} ]]; then
|
||||||
@ -96,6 +95,8 @@ function main() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
check_board
|
||||||
|
|
||||||
local parse_cmd="$(dirname $0)/../third_party/autotest/files/tko/parse.py"
|
local parse_cmd="$(dirname $0)/../third_party/autotest/files/tko/parse.py"
|
||||||
|
|
||||||
if [[ ${FLAGS_update_db} -eq ${FLAGS_TRUE} && ! -x "${parse_cmd}" ]]; then
|
if [[ ${FLAGS_update_db} -eq ${FLAGS_TRUE} && ! -x "${parse_cmd}" ]]; then
|
||||||
@ -116,7 +117,7 @@ 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"
|
||||||
local autotest_dir="${FLAGS_chroot}/usr/local/autotest/${FLAGS_board}"
|
local autotest_dir="${FLAGS_chroot}/build/${FLAGS_board}/usr/local/autotest"
|
||||||
update_chroot_autotest "${original}" "${autotest_dir}"
|
update_chroot_autotest "${original}" "${autotest_dir}"
|
||||||
|
|
||||||
local autoserv="${autotest_dir}/server/autoserv"
|
local autoserv="${autotest_dir}/server/autoserv"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user