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

Unified Diff: bin/cbuildbot.py

Issue 3591002: Add ability to run smoke_Suite on x86-pre-flight-queue. (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: Fix no_graphics Created 10 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | bin/cbuildbot_config.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/cbuildbot.py
diff --git a/bin/cbuildbot.py b/bin/cbuildbot.py
index a077c115f1d30b89deeaa4b94acd207bf6411f48..794bf15013d5555aab2fc92415e72751c6fc2dd7 100755
--- a/bin/cbuildbot.py
+++ b/bin/cbuildbot.py
@@ -208,6 +208,20 @@ def _UprevAllPackages(buildroot):
'--tracking_branch="cros/master"'],
cwd=cwd, enter_chroot=True)
+
+def _GetVMConstants(buildroot):
+ """Returns minimum (vdisk_size, statefulfs_size) recommended for VM's."""
+ cwd = os.path.join(buildroot, 'src', 'scripts', 'lib')
+ source_cmd = 'source %s/cros_vm_constants.sh' % cwd
+ vdisk_size = RunCommand([
+ '/bin/bash', '-c', '%s && echo $MIN_VDISK_SIZE_FULL' % source_cmd],
+ redirect_stdout=True)
+ statefulfs_size = RunCommand([
+ '/bin/bash', '-c', '%s && echo $MIN_STATEFUL_FS_SIZE_FULL' % source_cmd],
+ redirect_stdout=True)
+ return (vdisk_size.strip(), statefulfs_size.strip())
+
+
# =========================== Main Commands ===================================
def _FullCheckout(buildroot, rw_checkout=True, retries=_DEFAULT_RETRIES):
@@ -244,20 +258,43 @@ def _Build(buildroot):
cwd = os.path.join(buildroot, 'src', 'scripts')
RunCommand(['./build_packages'], cwd=cwd, enter_chroot=True)
+
def _WipeOldOutput(buildroot):
RunCommand(['rm', '-rf', 'src/build/images'], cwd=buildroot)
+
def _BuildImage(buildroot):
_WipeOldOutput(buildroot)
cwd = os.path.join(buildroot, 'src', 'scripts')
RunCommand(['./build_image', '--replace'], cwd=cwd, enter_chroot=True)
+
+def _BuildVMImageForTesting(buildroot):
+ (vdisk_size, statefulfs_size) = _GetVMConstants(buildroot)
+ cwd = os.path.join(buildroot, 'src', 'scripts')
+ RunCommand(['./image_to_vm.sh',
+ '--test_image',
+ '--full',
+ '--vdisk_size %s' % vdisk_size,
+ '--statefulfs_size %s' % statefulfs_size,
+ ], cwd=cwd, enter_chroot=True)
+
+
def _RunUnitTests(buildroot):
cwd = os.path.join(buildroot, 'src', 'scripts')
RunCommand(['./cros_run_unit_tests'], cwd=cwd, enter_chroot=True)
+def _RunSmokeSuite(buildroot):
+ cwd = os.path.join(buildroot, 'src', 'scripts')
+ RunCommand(['bin/cros_run_vm_test',
+ '--no_graphics',
+ '--test_case',
+ 'suite_Smoke',
+ ], cwd=cwd, error_ok=True)
+
+
def _UprevPackages(buildroot, revisionfile, board):
"""Uprevs a package based on given revisionfile.
@@ -383,6 +420,11 @@ def main():
_RunUnitTests(buildroot)
_BuildImage(buildroot)
+
+ if buildconfig['smoke_bvt']:
+ _BuildVMImageForTesting(buildroot)
+ _RunSmokeSuite(buildroot)
+
if buildconfig['uprev']:
if buildconfig['master']:
# Master bot needs to check if the other slaves completed.
« no previous file with comments | « no previous file | bin/cbuildbot_config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698