| 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 re | 10 import re |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 def _Build(buildroot): | 256 def _Build(buildroot): |
| 257 """Wrapper around build_packages.""" | 257 """Wrapper around build_packages.""" |
| 258 cwd = os.path.join(buildroot, 'src', 'scripts') | 258 cwd = os.path.join(buildroot, 'src', 'scripts') |
| 259 RunCommand(['./build_packages'], cwd=cwd, enter_chroot=True) | 259 RunCommand(['./build_packages'], cwd=cwd, enter_chroot=True) |
| 260 | 260 |
| 261 | 261 |
| 262 def _WipeOldOutput(buildroot): | 262 def _WipeOldOutput(buildroot): |
| 263 RunCommand(['rm', '-rf', 'src/build/images'], cwd=buildroot) | 263 RunCommand(['rm', '-rf', 'src/build/images'], cwd=buildroot) |
| 264 | 264 |
| 265 | 265 |
| 266 def _EnableLocalAccount(buildroot): |
| 267 cwd = os.path.join(buildroot, 'src', 'scripts') |
| 268 # Set local account for test images. |
| 269 RunCommand(['./enable_localaccount.sh', |
| 270 'chronos'], |
| 271 print_cmd=False, cwd=cwd) |
| 272 |
| 273 |
| 266 def _BuildImage(buildroot): | 274 def _BuildImage(buildroot): |
| 267 _WipeOldOutput(buildroot) | 275 _WipeOldOutput(buildroot) |
| 268 | 276 |
| 269 cwd = os.path.join(buildroot, 'src', 'scripts') | 277 cwd = os.path.join(buildroot, 'src', 'scripts') |
| 270 RunCommand(['./build_image', '--replace'], cwd=cwd, enter_chroot=True) | 278 RunCommand(['./build_image', '--replace'], cwd=cwd, enter_chroot=True) |
| 271 | 279 |
| 272 | 280 |
| 273 def _BuildVMImageForTesting(buildroot): | 281 def _BuildVMImageForTesting(buildroot): |
| 274 (vdisk_size, statefulfs_size) = _GetVMConstants(buildroot) | 282 (vdisk_size, statefulfs_size) = _GetVMConstants(buildroot) |
| 275 cwd = os.path.join(buildroot, 'src', 'scripts') | 283 cwd = os.path.join(buildroot, 'src', 'scripts') |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 if not os.path.isdir(chroot_path): | 416 if not os.path.isdir(chroot_path): |
| 409 _MakeChroot(buildroot) | 417 _MakeChroot(buildroot) |
| 410 | 418 |
| 411 boardpath = os.path.join(chroot_path, 'build', buildconfig['board']) | 419 boardpath = os.path.join(chroot_path, 'build', buildconfig['board']) |
| 412 if not os.path.isdir(boardpath): | 420 if not os.path.isdir(boardpath): |
| 413 _SetupBoard(buildroot, board=buildconfig['board']) | 421 _SetupBoard(buildroot, board=buildconfig['board']) |
| 414 | 422 |
| 415 if buildconfig['uprev']: | 423 if buildconfig['uprev']: |
| 416 _UprevPackages(buildroot, revisionfile, board=buildconfig['board']) | 424 _UprevPackages(buildroot, revisionfile, board=buildconfig['board']) |
| 417 | 425 |
| 426 _EnableLocalAccount(buildroot) |
| 418 _Build(buildroot) | 427 _Build(buildroot) |
| 419 if buildconfig['unittests']: | 428 if buildconfig['unittests']: |
| 420 _RunUnitTests(buildroot) | 429 _RunUnitTests(buildroot) |
| 421 | 430 |
| 422 _BuildImage(buildroot) | 431 _BuildImage(buildroot) |
| 423 | 432 |
| 424 if buildconfig['smoke_bvt']: | 433 if buildconfig['smoke_bvt']: |
| 425 _BuildVMImageForTesting(buildroot) | 434 _BuildVMImageForTesting(buildroot) |
| 426 _RunSmokeSuite(buildroot) | 435 _RunSmokeSuite(buildroot) |
| 427 | 436 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 444 except: | 453 except: |
| 445 # Send failure to master bot. | 454 # Send failure to master bot. |
| 446 if not buildconfig['master'] and buildconfig['important']: | 455 if not buildconfig['master'] and buildconfig['important']: |
| 447 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) | 456 cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED) |
| 448 | 457 |
| 449 raise | 458 raise |
| 450 | 459 |
| 451 | 460 |
| 452 if __name__ == '__main__': | 461 if __name__ == '__main__': |
| 453 main() | 462 main() |
| OLD | NEW |