Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: autotest_run.sh

Issue 2854062: autotest: create a candidate script for replacement ebuild test (running the tests) (Closed) Base URL: ssh://gitrw.chromium.org/crosutils
Patch Set: Also took care of whitespace warnings :/ Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | autotest_workon » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/bash
2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 # This script is intended as a wrapper to execute autotest tests for a given
8 # board.
9
10 # Load common constants. This should be the first executable line.
11 # The path to common.sh should be relative to your script's location.
12 . "$(dirname "$0")/common.sh"
13
14 # Script must be run inside the chroot
15 restart_in_chroot_if_needed $*
16 get_default_board
17
18 DEFINE_string board "${DEFAULT_BOARD}" \
19 "The board to run tests for."
20
21 FLAGS_HELP="usage: $0 <flags>"
22 FLAGS "$@" || exit 1
23 eval set -- "${FLAGS_ARGV}"
24
25 # Define a directory which will not be cleaned by portage automatically. So we
26 # could achieve incremental build between two autoserv runs.
27 BUILD_RUNTIME="/build/${FLAGS_board}/usr/local/autotest/"
28
29 # Hack: set the CHROMEOS_ROOT variable by hand here
30 CHROMEOS_ROOT=/home/${USER}/trunk/
31
32 # Ensure the configures run by autotest pick up the right config.site
33 CONFIG_SITE=/usr/share/config.site
34 AUTOTEST_SRC="${CHROMEOS_ROOT}/src/third_party/autotest/files"
35
36 [ -z "${FLAGS_board}" ] && \
37 die "You must specify --board="
38
39 function setup_ssh() {
40 eval $(ssh-agent) > /dev/null
41 ssh-add \
42 ${CHROMEOS_ROOT}/src/scripts/mod_for_test_scripts/ssh_keys/testing_rsa
43 }
44
45 function teardown_ssh() {
46 ssh-agent -k > /dev/null
47 }
48
49 function copy_src() {
50 local dst=$1
51 mkdir -p "${dst}"
52 cp -fpru "${AUTOTEST_SRC}"/{client,conmux,server,tko,utils} "${dst}" || die
53 cp -fpru "${AUTOTEST_SRC}/shadow_config.ini" "${dst}" || die
54 }
55
56 src_test() {
57 # claim ownership of the staging area
58 sudo chown -R ${USER} "${BUILD_RUNTIME}"
59 sudo chmod -R 755 "${BUILD_RUNTIME}"
60
61 local third_party="${CHROMEOS_ROOT}/src/third_party"
62 copy_src "${BUILD_RUNTIME}"
63 cp -fpru "${AUTOTEST_SRC}/global_config.ini" "${BUILD_RUNTIME}"
64
65 # ensure that no tests are ever built
66 sed -e 's/enable_server_prebuild: .*/enable_server_prebuild: False/' -i \
67 "${BUILD_RUNTIME}"/global_config.ini
68
69 setup_ssh
70 cd "${BUILD_RUNTIME}"
71
72 local args=()
73 if [[ -n ${AUTOSERV_TEST_ARGS} ]]; then
74 args=("-a" "${AUTOSERV_TEST_ARGS}")
75 fi
76
77 local timestamp=$(date +%Y-%m-%d-%H.%M.%S)
78
79 # Do not use sudo, it'll unset all your environment
80 LOGNAME=${USER} ./server/autoserv -r /tmp/results.${timestamp} \
81 ${AUTOSERV_ARGS} "${args[@]}"
82
83 teardown_ssh
84 }
85
86 src_test
OLDNEW
« no previous file with comments | « no previous file | autotest_workon » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698