| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 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 | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # Script to sync your checkout, build a Chromium OS image, and test it all | 7 # Script to sync your checkout, build a Chromium OS image, and test it all |
| 8 # with one command. Can also check out a new Chromium OS checkout and | 8 # with one command. Can also check out a new Chromium OS checkout and |
| 9 # perform a subset of the above operations. | 9 # perform a subset of the above operations. |
| 10 # | 10 # |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 local withdev="" | 217 local withdev="" |
| 218 local jobs=" single job (slow but safe)" | 218 local jobs=" single job (slow but safe)" |
| 219 if [[ ${FLAGS_jobs} -gt 1 ]]; then | 219 if [[ ${FLAGS_jobs} -gt 1 ]]; then |
| 220 jobs=" ${FLAGS_jobs} jobs (may cause build failure)" | 220 jobs=" ${FLAGS_jobs} jobs (may cause build failure)" |
| 221 fi | 221 fi |
| 222 if [[ ${FLAGS_withdev} -eq ${FLAGS_TRUE} ]]; then | 222 if [[ ${FLAGS_withdev} -eq ${FLAGS_TRUE} ]]; then |
| 223 withdev=" with dev packages" | 223 withdev=" with dev packages" |
| 224 fi | 224 fi |
| 225 echo " * Build image${withdev}${jobs}" | 225 echo " * Build image${withdev}${jobs}" |
| 226 set_passwd=${FLAGS_TRUE} | 226 set_passwd=${FLAGS_TRUE} |
| 227 if [[ ${FLAGS_build_autotest} -eq ${FLAGS_TRUE} ]]; then |
| 228 echo " * Cross-build autotest client tests (build_autotest)" |
| 229 fi |
| 227 fi | 230 fi |
| 228 if [[ ${FLAGS_master} -eq ${FLAGS_TRUE} ]]; then | 231 if [[ ${FLAGS_master} -eq ${FLAGS_TRUE} ]]; then |
| 229 echo " * Master image (build_image)" | 232 echo " * Master image (build_image)" |
| 230 fi | 233 fi |
| 231 if [[ -n "${FLAGS_grab_buildbot}" ]]; then | 234 if [[ -n "${FLAGS_grab_buildbot}" ]]; then |
| 232 if [[ "${FLAGS_grab_buildbot}" == "LATEST" ]]; then | 235 if [[ "${FLAGS_grab_buildbot}" == "LATEST" ]]; then |
| 233 echo " * Grab latest buildbot image under ${FLAGS_buildbot_uri}" | 236 echo " * Grab latest buildbot image under ${FLAGS_buildbot_uri}" |
| 234 else | 237 else |
| 235 echo " * Grab buildbot image zip at URI ${FLAGS_grab_buildbot}" | 238 echo " * Grab buildbot image zip at URI ${FLAGS_grab_buildbot}" |
| 236 fi | 239 fi |
| 237 fi | 240 fi |
| 238 if [[ ${FLAGS_mod_image_for_test} -eq ${FLAGS_TRUE} ]]; then | 241 if [[ ${FLAGS_mod_image_for_test} -eq ${FLAGS_TRUE} ]]; then |
| 239 echo " * Make image able to run tests (mod_image_for_test)" | 242 echo " * Make image able to run tests (mod_image_for_test)" |
| 240 set_passwd=${FLAGS_TRUE} | 243 set_passwd=${FLAGS_TRUE} |
| 241 fi | 244 fi |
| 242 if [[ ${set_passwd} -eq ${FLAGS_TRUE} ]]; then | 245 if [[ ${set_passwd} -eq ${FLAGS_TRUE} ]]; then |
| 243 if [[ -n "${FLAGS_chronos_passwd}" ]]; then | 246 if [[ -n "${FLAGS_chronos_passwd}" ]]; then |
| 244 echo " * Set chronos password to ${FLAGS_chronos_passwd}" | 247 echo " * Set chronos password to ${FLAGS_chronos_passwd}" |
| 245 else | 248 else |
| 246 echo " * Set chronos password randomly" | 249 echo " * Set chronos password randomly" |
| 247 fi | 250 fi |
| 248 fi | 251 fi |
| 249 if [[ ${FLAGS_build_autotest} -eq ${FLAGS_TRUE} ]]; then | |
| 250 echo " * Cross-build autotest client tests (build_autotest)" | |
| 251 fi | |
| 252 if [[ -n "${FLAGS_image_to_usb}" ]]; then | 252 if [[ -n "${FLAGS_image_to_usb}" ]]; then |
| 253 echo " * Write the image to USB device ${FLAGS_image_to_usb}" | 253 echo " * Write the image to USB device ${FLAGS_image_to_usb}" |
| 254 fi | 254 fi |
| 255 if [[ ${FLAGS_image_to_live} -eq ${FLAGS_TRUE} ]]; then | 255 if [[ ${FLAGS_image_to_live} -eq ${FLAGS_TRUE} ]]; then |
| 256 echo " * Reimage live test Chromium OS instance at ${FLAGS_remote}" | 256 echo " * Reimage live test Chromium OS instance at ${FLAGS_remote}" |
| 257 fi | 257 fi |
| 258 if [[ -n "${FLAGS_test}" ]]; then | 258 if [[ -n "${FLAGS_test}" ]]; then |
| 259 echo " * Run tests (${FLAGS_test}) on machine at ${FLAGS_remote}" | 259 echo " * Run tests (${FLAGS_test}) on machine at ${FLAGS_remote}" |
| 260 fi | 260 fi |
| 261 } | 261 } |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 "--chroot=${FLAGS_chroot}" ${jobs_param} | 485 "--chroot=${FLAGS_chroot}" ${jobs_param} |
| 486 fi | 486 fi |
| 487 | 487 |
| 488 if [[ ${FLAGS_build} -eq ${FLAGS_TRUE} ]]; then | 488 if [[ ${FLAGS_build} -eq ${FLAGS_TRUE} ]]; then |
| 489 chdir_relative src/scripts | 489 chdir_relative src/scripts |
| 490 # Only setup board target if the directory does not exist | 490 # Only setup board target if the directory does not exist |
| 491 if [[ ! -d "${FLAGS_top}/chroot/build/${FLAGS_board}" ]]; then | 491 if [[ ! -d "${FLAGS_top}/chroot/build/${FLAGS_board}" ]]; then |
| 492 run_phase_in_chroot "Setting up board target" \ | 492 run_phase_in_chroot "Setting up board target" \ |
| 493 ./setup_board "${board_param}" | 493 ./setup_board "${board_param}" |
| 494 fi | 494 fi |
| 495 local build_autotest_param="" |
| 496 if [[ ${FLAGS_build_autotest} -eq ${FLAGS_TRUE} ]]; then |
| 497 build_autotest_param="--withautotest" |
| 498 fi |
| 499 |
| 495 run_phase_in_chroot "Building packages" \ | 500 run_phase_in_chroot "Building packages" \ |
| 496 ./build_packages "${board_param}" \ | 501 ./build_packages "${board_param}" \ |
| 497 ${jobs_param} ${withdev_param} | 502 ${jobs_param} ${withdev_param} ${build_autotest_param} |
| 498 | 503 |
| 499 # TODO(kmixter): Enable this once build_tests works, but even | 504 # TODO(kmixter): Enable this once build_tests works, but even |
| 500 # then only do it when not cross compiling. | 505 # then only do it when not cross compiling. |
| 501 if [[ '' ]]; then | 506 if [[ '' ]]; then |
| 502 run_phase_in_chroot "Building and running unit tests" \ | 507 run_phase_in_chroot "Building and running unit tests" \ |
| 503 "./build_tests.sh && ./run_tests.sh" | 508 "./build_tests.sh && ./run_tests.sh" |
| 504 fi | 509 fi |
| 505 fi | 510 fi |
| 506 | 511 |
| 507 if [[ ${FLAGS_master} -eq ${FLAGS_TRUE} ]]; then | 512 if [[ ${FLAGS_master} -eq ${FLAGS_TRUE} ]]; then |
| (...skipping 19 matching lines...) Expand all Loading... |
| 527 run_phase "Installing image to USB" \ | 532 run_phase "Installing image to USB" \ |
| 528 ./image_to_usb.sh --yes "--to=${FLAGS_image_to_usb}" "${board_param}" | 533 ./image_to_usb.sh --yes "--to=${FLAGS_image_to_usb}" "${board_param}" |
| 529 fi | 534 fi |
| 530 | 535 |
| 531 if [[ ${FLAGS_image_to_live} -eq ${FLAGS_TRUE} ]]; then | 536 if [[ ${FLAGS_image_to_live} -eq ${FLAGS_TRUE} ]]; then |
| 532 chdir_relative src/scripts | 537 chdir_relative src/scripts |
| 533 run_phase "Re-imaging live Chromium OS machine ${FLAGS_remote}" \ | 538 run_phase "Re-imaging live Chromium OS machine ${FLAGS_remote}" \ |
| 534 ./image_to_live.sh "--remote=${FLAGS_remote}" --update_known_hosts | 539 ./image_to_live.sh "--remote=${FLAGS_remote}" --update_known_hosts |
| 535 fi | 540 fi |
| 536 | 541 |
| 537 if [[ ${FLAGS_build_autotest} -eq ${FLAGS_TRUE} ]]; then | |
| 538 chdir_relative src/scripts | |
| 539 run_phase_in_chroot "Building autotest" "./build_autotest.sh" \ | |
| 540 --noprompt "${board_param}" | |
| 541 fi | |
| 542 | |
| 543 if [[ -n "${FLAGS_test}" ]]; then | 542 if [[ -n "${FLAGS_test}" ]]; then |
| 544 chdir_relative src/scripts | 543 chdir_relative src/scripts |
| 545 # We purposefully do not quote FLAGS_test below as we expect it may | 544 # We purposefully do not quote FLAGS_test below as we expect it may |
| 546 # have multiple parameters | 545 # have multiple parameters |
| 547 run_phase "Running tests on Chromium OS machine ${FLAGS_remote}" \ | 546 run_phase "Running tests on Chromium OS machine ${FLAGS_remote}" \ |
| 548 ./run_remote_tests.sh "--remote=${FLAGS_remote}" ${FLAGS_test} \ | 547 ./run_remote_tests.sh "--remote=${FLAGS_remote}" ${FLAGS_test} \ |
| 549 "${board_param}" | 548 "${board_param}" |
| 550 fi | 549 fi |
| 551 | 550 |
| 552 echo "Successfully used ${FLAGS_top} to:" | 551 echo "Successfully used ${FLAGS_top} to:" |
| 553 describe_steps | 552 describe_steps |
| 554 show_duration | 553 show_duration |
| 555 } | 554 } |
| 556 | 555 |
| 557 | 556 |
| 558 main $@ | 557 main $@ |
| OLD | NEW |