OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
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 """CBuildbot is wrapper around the build process used by the pre-flight queue""" | 7 """CBuildbot is wrapper around the build process used by the pre-flight queue""" |
8 | 8 |
9 import errno | 9 import errno |
10 import heapq | 10 import heapq |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 shutil.rmtree(results_dir_in_chroot) | 408 shutil.rmtree(results_dir_in_chroot) |
409 | 409 |
410 cwd = os.path.join(buildroot, 'src', 'scripts') | 410 cwd = os.path.join(buildroot, 'src', 'scripts') |
411 RunCommand(['bin/cros_run_vm_test', | 411 RunCommand(['bin/cros_run_vm_test', |
412 '--no_graphics', | 412 '--no_graphics', |
413 '--results_dir_root=%s' % results_dir, | 413 '--results_dir_root=%s' % results_dir, |
414 'suite_Smoke', | 414 'suite_Smoke', |
415 ], cwd=cwd, error_ok=False) | 415 ], cwd=cwd, error_ok=False) |
416 | 416 |
417 | 417 |
| 418 def _RunAUTest(buildroot, board): |
| 419 """Runs a basic update test from the au test harness.""" |
| 420 cwd = os.path.join(buildroot, 'src', 'scripts') |
| 421 image_path = os.path.join(buildroot, 'src', 'build', 'images', board, |
| 422 'latest', 'chromiumos_test_image.bin') |
| 423 RunCommand(['bin/cros_au_test_harness', |
| 424 '--no_graphics', |
| 425 '--no_delta', |
| 426 '--board=%s' % board, |
| 427 '--test_prefix=SimpleTest', |
| 428 '--verbose', |
| 429 '--base_image=%s' % image_path, |
| 430 '--target_image=%s' % image_path, |
| 431 ], cwd=cwd, error_ok=False) |
| 432 |
| 433 |
418 def _UprevPackages(buildroot, tracking_branch, revisionfile, board, overlays): | 434 def _UprevPackages(buildroot, tracking_branch, revisionfile, board, overlays): |
419 """Uprevs a package based on given revisionfile. | 435 """Uprevs a package based on given revisionfile. |
420 | 436 |
421 If revisionfile is set to None or does not resolve to an actual file, this | 437 If revisionfile is set to None or does not resolve to an actual file, this |
422 function will uprev all packages. | 438 function will uprev all packages. |
423 | 439 |
424 Keyword arguments: | 440 Keyword arguments: |
425 revisionfile -- string specifying a file that contains a list of revisions to | 441 revisionfile -- string specifying a file that contains a list of revisions to |
426 uprev. | 442 uprev. |
427 """ | 443 """ |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 buildconfig['board'], rev_overlays) | 704 buildconfig['board'], rev_overlays) |
689 | 705 |
690 _EnableLocalAccount(buildroot) | 706 _EnableLocalAccount(buildroot) |
691 _Build(buildroot, emptytree) | 707 _Build(buildroot, emptytree) |
692 | 708 |
693 if buildconfig['unittests'] and options.tests: | 709 if buildconfig['unittests'] and options.tests: |
694 _RunUnitTests(buildroot) | 710 _RunUnitTests(buildroot) |
695 | 711 |
696 _BuildImage(buildroot) | 712 _BuildImage(buildroot) |
697 | 713 |
698 if buildconfig['smoke_bvt'] and options.tests: | 714 if buildconfig['tests'] and options.tests: |
699 _BuildVMImageForTesting(buildroot) | 715 _BuildVMImageForTesting(buildroot) |
700 test_results_dir = '/tmp/run_remote_tests.%s' % options.buildnumber | 716 test_results_dir = '/tmp/run_remote_tests.%s' % options.buildnumber |
701 try: | 717 try: |
702 _RunSmokeSuite(buildroot, test_results_dir) | 718 _RunSmokeSuite(buildroot, test_results_dir) |
| 719 _RunAUTest(buildroot, buildconfig['board']) |
703 finally: | 720 finally: |
704 if not options.debug: | 721 if not options.debug: |
705 archive_full_path = os.path.join(options.gsutil_archive, | 722 archive_full_path = os.path.join(options.gsutil_archive, |
706 str(options.buildnumber)) | 723 str(options.buildnumber)) |
707 _ArchiveTestResults(buildroot, buildconfig['board'], | 724 _ArchiveTestResults(buildroot, buildconfig['board'], |
708 test_results_dir=test_results_dir, | 725 test_results_dir=test_results_dir, |
709 gsutil=options.gsutil, | 726 gsutil=options.gsutil, |
710 archive_dir=archive_full_path, | 727 archive_dir=archive_full_path, |
711 acl=options.acl) | 728 acl=options.acl) |
712 | 729 |
713 if buildconfig['uprev']: | 730 if buildconfig['uprev']: |
714 # Don't push changes for developers. | 731 # Don't push changes for developers. |
715 if buildconfig['master']: | 732 if buildconfig['master']: |
716 # Master bot needs to check if the other slaves completed. | 733 # Master bot needs to check if the other slaves completed. |
(...skipping 14 matching lines...) Expand all Loading... |
731 except: | 748 except: |
732 # Send failure to master bot. | 749 # Send failure to master bot. |
733 if not buildconfig['master'] and buildconfig['important']: | 750 if not buildconfig['master'] and buildconfig['important']: |
734 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) | 751 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) |
735 | 752 |
736 raise | 753 raise |
737 | 754 |
738 | 755 |
739 if __name__ == '__main__': | 756 if __name__ == '__main__': |
740 main() | 757 main() |
OLD | NEW |