aboutsummaryrefslogtreecommitdiff
path: root/binary_search_tool/bisect.py
diff options
context:
space:
mode:
authorCassidy Burden <cburden@google.com>2016-06-30 15:24:20 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-07-01 11:58:13 -0700
commitc4671bdd601ff945b2cccbfe1aee9f931dc908c7 (patch)
tree4cdec6fd367b6f8a9162f4c56f18d3232a494b63 /binary_search_tool/bisect.py
parent63f13489b1a02bbbc75b46fec6ae7a817442df94 (diff)
downloadtoolchain-utils-c4671bdd601ff945b2cccbfe1aee9f931dc908c7.tar.gz
binary search tool: (Refactor) Extract common scripts into common folder
Refactor warning! Move install.sh, boot_test.sh, and interactive_test.sh into common folder so they can be shared by both package and object bisectors. To allow this sharing, sysroot_wrapper now has a setup script similar to cros_pkg. All scripts now source common/common.sh. TEST=Run unit tests, run system tests, run couple iterations of install script for both bisectors. Change-Id: I9e164b4e6b842ff321c2400201e6ac0984f99088 Reviewed-on: https://chrome-internal-review.googlesource.com/268027 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
Diffstat (limited to 'binary_search_tool/bisect.py')
-rwxr-xr-xbinary_search_tool/bisect.py26
1 files changed, 15 insertions, 11 deletions
diff --git a/binary_search_tool/bisect.py b/binary_search_tool/bisect.py
index 8e454f62..4ce87cd2 100755
--- a/binary_search_tool/bisect.py
+++ b/binary_search_tool/bisect.py
@@ -168,7 +168,8 @@ class BisectPackage(Bisector):
class BisectObject(Bisector):
"""The class for object bisection steps."""
- sysroot_wrapper_files = ['bad/_LIST', 'good/_LIST']
+ sysroot_wrapper_setup = 'sysroot_wrapper/setup.sh'
+ sysroot_wrapper_cleanup = 'sysroot_wrapper/cleanup.sh'
def __init__(self, options, overrides):
super(BisectObject, self).__init__(options, overrides)
@@ -191,22 +192,25 @@ class BisectObject(Bisector):
self.ArgOverride(self.default_kwargs, overrides)
def PreRun(self):
- for f in self.sysroot_wrapper_files:
- full_path = os.path.join(self.options.dir, f)
- if not os.path.exists(full_path):
- self.logger.LogError('Object bisector setup failed, %s does not exist' %
- full_path)
- return 1
-
- os.environ['BISECT_BOARD'] = self.options.board
- os.environ['BISECT_REMOTE'] = self.options.remote
- os.environ['BISECT_PACKAGE'] = self.options.package
+ cmd = ('%s %s %s %s' % (self.sysroot_wrapper_setup, self.options.board,
+ self.options.remote, self.options.package))
+ ret, _, _ = self.ce.RunCommandWExceptionCleanup(cmd, print_to_console=True)
+ if ret:
+ self.logger.LogError('Object bisector setup failed w/ error %d' % ret)
+ return 1
+
+ os.environ['BISECT_STAGE'] = 'TRIAGE'
return 0
def Run(self):
return binary_search_state.Run(**self.default_kwargs)
def PostRun(self):
+ cmd = self.sysroot_wrapper_cleanup
+ ret, _, _ = self.ce.RunCommandWExceptionCleanup(cmd, print_to_console=True)
+ if ret:
+ self.logger.LogError('Object bisector cleanup failed w/ error %d' % ret)
+ return 1
return 0