Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/bin/bash | |
| 2 | |
| 3 # Copyright (c) 2009 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 makes autotest client tests inside an Ubuntu chroot | |
| 8 # environment. The idea is to compile any platform-dependent autotest | |
| 9 # client tests in the build environment, since client systems under | |
| 10 # test lack the proper toolchain. | |
| 11 # | |
| 12 # The user can enter_chroot later and run autotest against an ssh | |
| 13 # enabled test client system, or install the compiled client tests | |
| 14 # directly onto the rootfs image, using mod_image_for_test. | |
| 15 | |
| 16 . "$(dirname "$0")/common.sh" | |
| 17 | |
| 18 # Script must be run inside the chroot | |
| 19 assert_inside_chroot | |
| 20 | |
| 21 # More useful help | |
| 22 FLAGS_HELP="usage: $0 [flags]" | |
| 23 | |
| 24 # parse the command-line | |
| 25 FLAGS "$@" || exit 1 | |
| 26 eval set -- "${FLAGS_ARGV}" | |
| 27 set -e | |
| 28 | |
| 29 AUTOTEST_SRC="${GCLIENT_ROOT}/src/third_party/autotest/files" | |
| 30 # Destination in chroot to install autotest. | |
| 31 AUTOTEST_DEST="/usr/local/autotest" | |
| 32 | |
| 33 # Copy a local "installation" of autotest into the chroot, to avoid | |
| 34 # polluting the src dir with tmp files, results, etc. | |
| 35 echo -n "Installing Autotest... " | |
| 36 sudo mkdir -p ${AUTOTEST_DEST} | |
| 37 sudo chmod 777 ${AUTOTEST_DEST} | |
| 38 cp -rpf ${CHROOT_TRUNK_DIR}/src/third_party/autotest/files/{client,server,tko,ut ils,global_config.ini,shadow_config.ini} ${AUTOTEST_DEST} | |
|
petkov
2010/01/13 20:13:41
80 characters
| |
| 39 | |
| 40 # Create python package init files for top level test case dirs. | |
| 41 function touchInitPy() { | |
| 42 local dirs=${1} | |
| 43 for base_dir in $dirs | |
| 44 do | |
| 45 local sub_dirs="$(find ${base_dir} -maxdepth 1 -type d)" | |
| 46 for sub_dir in ${sub_dirs} | |
| 47 do | |
| 48 touch ${sub_dir}/__init__.py | |
| 49 done | |
| 50 touch ${base_dir}/__init__.py | |
| 51 done | |
| 52 } | |
| 53 | |
| 54 cd ${AUTOTEST_DEST} | |
| 55 touchInitPy client/tests client/site_tests | |
| 56 touch __init__.py | |
| 57 | |
| 58 # run the magic test setup script. | |
| 59 client/bin/autotest client/site_tests/setup/control | |
| OLD | NEW |