aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-07-29binary search tool: Add file locking to compiler wrapperCassidy Burden
Because make can run with arbitrary number of jobs, there's potential race conditions with the compiler wrapper's file operations. Replace all open calls with function that locks files using fnctl module. Additionally fix small formatting errors CQ-DEPEND=CL:*270783 Change-Id: I4b94bfe3c0a5d7203f78e87130b7c4d71bc8e1c0 Reviewed-on: https://chrome-internal-review.googlesource.com/271747 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Luis Lozano <llozano@chromium.org>
2016-07-29binary search tool: Add compiler wrapper for Android bisectionCassidy Burden
Add compiler wrapper similar to ChromeOS object bisector's compiler wrapper. bisect_driver.py is a modified version of bisect.py from the ChromeOS sysroot_wrapper. compiler_wrapper.py is a simple skeleton script used to invoke bisect_driver, and it is meant to be replaced by a more robust compiler wrapper. TEST=Populated android objects and triaged CQ-DEPEND=CL:*270730 Change-Id: I4dfc676f6b659c2da8dbd01fd858c477ffbdeb9f Reviewed-on: https://chrome-internal-review.googlesource.com/270783 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Luis Lozano <llozano@chromium.org>
2016-07-28binary search tool: Add android test scriptsCassidy Burden
Add android test scripts: boot test and interactive test. Boot test waits for device to boot up and reach homescreen. Interactive test waits for device to boot and asks user if the image is good or bad. TEST=Run full bisection with boot test, test code paths with interactive test Change-Id: I04490da381964ca157f72f70cca49213e0e827c0 Reviewed-on: https://chrome-internal-review.googlesource.com/271975 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com> Reviewed-by: Han Shen <shenhan@google.com>
2016-07-28binary search tool: Add android get_initial_items scriptCassidy Burden
This script will simply output the list of all files in the good object cache. TEST=Used with test android bisection Change-Id: I5caa7b3d1372d0b5ee046f2ceb814c88122d5ec6 Reviewed-on: https://chrome-internal-review.googlesource.com/271947 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com> Reviewed-by: Han Shen <shenhan@google.com>
2016-07-28binary search tool: Add android switch scriptsCassidy Burden
Add switch scripts for android bisector. Each script hardlinks files from GOOD/BAD cache into working tree. ln/touch are invoked via xargs to allow easier input parsing and parallel execution. TEST=Tested various code paths and tried with prototype bisector Change-Id: I9f52358737e8d18486287eb9e4d30bf3e1ad13ea Reviewed-on: https://chrome-internal-review.googlesource.com/271725 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com> Reviewed-by: Han Shen <shenhan@google.com>
2016-07-28binary search tool: Add android install scriptCassidy Burden
Add install script for android bisector. This script will build android and attempt to flash the newly built image. If flashing fails, the install script will ask the user for help. TEST=Tested each code path Change-Id: I89845edd8a2bafedc9e6cabffe7bf92f2f48bc0d Reviewed-on: https://chrome-internal-review.googlesource.com/271482 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com> Reviewed-by: Han Shen <shenhan@google.com>
2016-07-27binary search tool: Alert user if --file_args requiredCassidy Burden
Check for OS Error E2BIG when running switch script. If this happens that means that --file_args is required. TEST=Test with list of android objects, properly fails Change-Id: If795ea5f45956ed0e5dd5eb6a9852f02d9f5978f Reviewed-on: https://chrome-internal-review.googlesource.com/271688 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com> Reviewed-by: Han Shen <shenhan@google.com>
2016-07-27Remove "--remove_trailing_comma" option from tc_pyformatCassidy Burden
pyformat recently removed the "--remove_trailing_comma" option. Remove this from tc_pyformat to prevent tool from crashing. Change-Id: I899ae005230ef3de6f72fd69c963697bda5c53e0 Reviewed-on: https://chrome-internal-review.googlesource.com/271686 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-07-27binary search tool: Fix linting errorCassidy Burden
TEST=Run unit tests Change-Id: I235148ca88e3f86f8bb00467a2b01ebfa99b0a88 Reviewed-on: https://chrome-internal-review.googlesource.com/271528 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-07-27[crosperf] Clean up exceptions.Caroline Tice
Found all instances of 'raise Exception' and changed them to raise something slightly more specific. Changed a few 'except Exception' statements appropriately as well. BUG=chromium:566255 TEST=None Change-Id: If2666bd55838342bc71431e5e6ab2157c2c9e125 Reviewed-on: https://chrome-internal-review.googlesource.com/270731 Commit-Ready: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Yunlian Jiang <yunlian@google.com>
2016-07-26binary search tool: Add setup script for android bisectorCassidy Burden
Add setup script for android bisector. This setup script will: 1. Generate all necessary variables for the switch/test/etc. scripts and put them in a common.sh file. 2. Ensure the GOOD/BAD object caches exist, and have the same objects lists 3. Make sure that the android build environment is properly configured (with build/envsetup.sh and lunch) Change-Id: Id2343b5d4bbc51b06fab261863ccbe7c507c33b4 Reviewed-on: https://chrome-internal-review.googlesource.com/270976 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-07-26binary search tool: Fix edge case with noincremental and pruneCassidy Burden
Fix edge case where not all items were sent to switch_to_good script when noincremental and prune were both set. Pruning progressively narrows down the total number of items being searched across because some items can be assumed good. This fix ensures that these "known good" items are also sent to the switch script if noincremental is set. TEST=Add unit test for this case, run other tests Change-Id: I1145f6eea224f06ceb2352ec77e17e849d489606 Reviewed-on: https://chrome-internal-review.googlesource.com/270718 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-07-26binary search tool: Provide temp files that hold GOOD/BAD setsCassidy Burden
Provide temp files to scripts ($BISECT_GOOD_SET, $BISECT_BAD_SET) that provide a full listing of the items in the good set and items in the bad set. This can be used for debugging purposes or so scripts can analyze the state of the current binary search iteration. TEST=Add unit test that utilizes these files Change-Id: I32bc393644f1cb998c2d818a9026486ef83cc4b8 Reviewed-on: https://chrome-internal-review.googlesource.com/270730 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com> Reviewed-by: Han Shen <shenhan@google.com>
2016-07-25[crosperf] Change flags to cbuildbot.Caroline Tice
The command for cbuildbot it buildbot_utils had hardcoded the '--notests' options; this was right for the normal nightly jobs, but not for the rotating tests. This CL makes that option a variable, and also allows for users to be able to add other custom flags to their cbuildbot invocations. BUG=chromium:631149 TEST=none Change-Id: Ifd2abd42808d99a28c3f7860f67a2eb2c9cd0118 Reviewed-on: https://chrome-internal-review.googlesource.com/271005 Commit-Ready: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Yunlian Jiang <yunlian@google.com>
2016-07-25[crosperf] Get telemetry results from file instead of stdout.Caroline Tice
This CL fixes crosperf to read the telemetry json results file for getting its results, rather than parsing stdout. BUG=chromium:620464 TEST=Successfully got results for octane, kraken & speedometer on daisy. Change-Id: I5bf8cf143688d83ca38c6453006360a45e945544 Reviewed-on: https://chrome-internal-review.googlesource.com/270698 Commit-Ready: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Yunlian Jiang <yunlian@google.com>
2016-07-25[toolchain-utils] Finish switching utils/ to cros_utils/.Caroline Tice
This CL finishes switching the subdirectory from 'utils' to 'cros_utils'. It changes all the remaining import statements to use 'cros_utils'; it removes the 'cros_utils' symlink, and it renames the 'utils' subdirectory to 'cros_utils'. BUG=chromium:568195 TEST=ran crosperf & binary search tool unittests. Change-Id: I7427f8bfb2ddac3a4b6108e46782039059684382 Reviewed-on: https://chrome-internal-review.googlesource.com/270396 Commit-Ready: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Cassidy Burden <cburden@google.com> Reviewed-by: Luis Lozano <llozano@chromium.org>
2016-07-22binary search tool: Print out elapsed time every iterationCassidy Burden
Print out time since execution has begun every progress update. Also give final execution time after tool completes. Change-Id: Ibba29feac42c8b637b1d3595a381ad3b4e9e974d Reviewed-on: https://chrome-internal-review.googlesource.com/270695 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-07-19binary search tool: Add new common hash_test.shCassidy Burden
Add new test script for all bisecting tools. This test simply runs a checksum on a given file. If the checksum fails the image is "bad", otherwise the image is "good". This test replaces the less generic system test for cros_pkg (cros_pkg/testing_test.sh). TEST=Run system test for package bisector with hash_test.sh Change-Id: Ie1358101386ec2a04a077c8d81e73706f28112c0 Reviewed-on: https://chrome-internal-review.googlesource.com/270095 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-07-18toolchain-utils: Fix use before defined error, cleanup linting errorsCassidy Burden
If an exception was raised during the POpen call, calling the except_handler would crash the program and hide the original exception. Now initialize process object to None before starting try block. TEST=RunCommandGeneric no longer crashes if POpen fails Change-Id: I310678fc85e94d066b1da304549e97fee7b99073 Reviewed-on: https://chrome-internal-review.googlesource.com/270045 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-07-18[crosperf] Separate output for different compilers.Caroline Tice
Currently the rotating nightly tester is writing all the test output to the same directory, based on board name, so the GCC & LLVM output files for a particular are overwriting each other. This CL puts the GCC & LLVM output into different directories so that won't happen. BUG=None TEST=None Change-Id: Ifc564a51bd0f44c9a701805975cbb64325074aab Reviewed-on: https://chrome-internal-review.googlesource.com/268335 Commit-Ready: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Ting-Yuan Huang <laszio@google.com>
2016-07-12binary search tool: Update found_items when prune is not setCassidy Burden
Previously when prune was not set found_items would not be updated with the single bad item found. This commit fixed this edge case and adds a unit test for it. TEST=Run unit tests Change-Id: Iac56c53fd4de97fa12b14fc9ea1e05d021cc6495 Reviewed-on: https://chrome-internal-review.googlesource.com/268725 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Han Shen <shenhan@google.com> Reviewed-by: Luis Lozano <llozano@chromium.org>
2016-07-08binary search tool: Add more unit testsCassidy Burden
Add tests for failed verification and iterations limit. Change-Id: I22c26ed1c5f779ee5f81256c2315a6c523e1dfa8 Reviewed-on: https://chrome-internal-review.googlesource.com/268243 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Han Shen <shenhan@google.com> Reviewed-by: Luis Lozano <llozano@chromium.org>
2016-07-07Add docstrings to binary search state methodsCassidy Burden
Change-Id: Iba4bf1e8df155a38c4c12fa488bee7df3ffd0291 Reviewed-on: https://chrome-internal-review.googlesource.com/268538 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Han Shen <shenhan@google.com> Reviewed-by: Luis Lozano <llozano@chromium.org>
2016-07-01binary search tool: Fix typos and small output errorsCassidy Burden
Change-Id: I0859c43b3bfe8917ebf1e5337f2e39cbb2a55fa0 Reviewed-on: https://chrome-internal-review.googlesource.com/268247 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-07-01binary search tool: (Refactor) Extract common scripts into common folderCassidy Burden
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>
2016-06-30[crosperf] Add more tests for results_report.George Burgess IV
With this patch, all of the classes in results_report have tests. The tests aren't overly extensive, but we can always improve on them later. This also includes a few small cleanups of parts of machine_manager, and results_report. BUG=None TEST=./run_tests.sh Change-Id: I9613579d4f8c1079b452e1a0a2edf47b189ac1cd Reviewed-on: https://chrome-internal-review.googlesource.com/268057 Commit-Ready: George Burgess <gbiv@google.com> Tested-by: George Burgess <gbiv@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-30binary search tool: Add object bisecting to bisect.pyCassidy Burden
Add object file bisecting to bisect.py. This is the frontend to the sysroot_wrapper bisection scripts. This bisection mode takes the following arguments: board, remote IP, package to bisect, and optionally the directory for the good/bad build trees. Adds default install/test scripts to sysroot_wrapper (similar to default scripts in cros_pkg) to support this bisection mode. TEST=Run unit tests and system test with cryptohome package CQ-DEPEND=CL:*267995 Change-Id: I1e9166b753f78ca7bdcf6ddbd056af62bc03923b Reviewed-on: https://chrome-internal-review.googlesource.com/268035 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-30binary search tool: Add pretty printing of arguments to bisect.pyCassidy Burden
Add pretty printing of arguments at beginning of bisect.py. Additionally extract argument overriding logic into helper function in base class. TEST=Try various argument overrides and verify output Change-Id: I15b33ee944356e9db880a3518bcea48e022f4442 Reviewed-on: https://chrome-internal-review.googlesource.com/267995 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-29Add README for bisect.pyCassidy Burden
Change-Id: I9bc78a3a69609354fe88ad5123ebb748e211f1e6 Reviewed-on: https://chrome-internal-review.googlesource.com/267412 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-29Add argument overriding to bisect.pyCassidy Burden
Add the ability to override the default arguments given to the package and object bisecting tools. This allows users to specify their own test/install/etc. script but keep the others the same. Example 1 (do boot test instead of interactive test): ./bisect.py package daisy 172.17.211.182 --test_script=cros_pkg/boot_test.sh Example 2 (do package bisector system test instead of interactive test): ./bisect.py package daisy 172.17.211.182 \ --test_script=cros_pkg/testing_test.sh --install_script="" TEST=Run unit tests and ran above examples among others (such as overriding verbose, prune, etc. options) CQ-DEPEND=CL:*266996 Change-Id: I5ee24826d4d7e22e7328ce98c6b8cda9917df533 Reviewed-on: https://chrome-internal-review.googlesource.com/266305 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-29[crosperf] Add results_report tests, minor refactors.George Burgess IV
This adds unit tests for results_report.JSONResultsReport and results_report.ParseChromeosImage. The test for the former aren't as extensive as they could be, but I hope to add more in the future. This also simplifies ParseChromeosImage, and does a few refactors to JSONResultsReport. This also fixes all of `cros lint`'s complaints about results_report. BUG=None TEST=./run_tests.sh Change-Id: Ice4267a5ff2e10df6690595c6b80db1ee1977d50 Reviewed-on: https://chrome-internal-review.googlesource.com/267665 Commit-Ready: George Burgess <gbiv@google.com> Tested-by: George Burgess <gbiv@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-29[crosperf] Fix setting descriptions; NFC.George Burgess IV
This also removes an unused import, and adds a few docstrings/etc. to make `cros lint` happy. BUG=None TEST=./run_tests.sh Change-Id: I0279a0db1d1cb1a1bc655a06bfc6b33d87495610 Reviewed-on: https://chrome-internal-review.googlesource.com/267277 Commit-Ready: George Burgess <gbiv@google.com> Tested-by: George Burgess <gbiv@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-28Add common module for binary search toolCassidy Burden
common module holds common logic between bisect and binary_search_state for adding utils to PYTHONPATH and for building the argument parser. TEST=Run unit tests, run cros_pkg system test Change-Id: I4085b28de011132c53b8fddf06e8745042ef8ea2 Reviewed-on: https://chrome-internal-review.googlesource.com/266996 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Luis Lozano <llozano@chromium.org>
2016-06-27[toolchain-utils] Update rotating tester to allow GCC tests, too.Caroline Tice
BUG=None TEST=Tested on chrotomation2 with role account. Change-Id: I232df188f05a13cdc59a53173b7c46f9b1b1b282 Reviewed-on: https://chrome-internal-review.googlesource.com/266966 Commit-Ready: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Luis Lozano <llozano@chromium.org>
2016-06-24binary search tool: Enforce execution from root directoryCassidy Burden
Both cros_pkg and sysroot_wrapper rely on the current working directory being toolchain-utils/binary_search_tool. bisect.py will now enforce this by cd'ing to this directory before execution. TEST=Run unit tests and cros_pkg CQ-DEPEND=CL:*266365 Change-Id: Ie30272ba31cd80a1b2c715e0f9a42a4e26889f16 Reviewed-on: https://chrome-internal-review.googlesource.com/266329 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-24binary search tool: Move root path of cros_pkg execution, rename scriptsCassidy Burden
Update cros_pkg scripts and bisect.py so that the package bisector needs to be run from binary_search_tool/ instead of binary_search_tool/cros_pkg. This fits with how sysroot_wrapper implements its scripts. Also rename all cros_pkg scripts to remove cros_pkg prefix and remove undo_eclean.py. TEST=Run unit tests and run interactive/testing cros_pkg test Change-Id: I2781319934b704b91346745ae2d4d916fee35d02 Reviewed-on: https://chrome-internal-review.googlesource.com/266365 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-22Add initial unified bisection scriptCassidy Burden
Add new script for unifying package and object bisection script interfaces. Currently only package bisection is implemented. TEST=Add unit test, test cros_pkg with testing script and interactive script Change-Id: I7491e3fb73eae863e24de3869092cfbf9df56c8d Reviewed-on: https://chrome-internal-review.googlesource.com/266096 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-22binary search tool: Make BST tester check output more robustCassidy Burden
Updated binary_search_tool_tester's output checking to be more robust, and fully check the state of the reported good/bad sets. Change-Id: Id7ab8c006133d67b75ed902a437ca817e62cd219 Reviewed-on: https://chrome-internal-review.googlesource.com/266029 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-21Add tests to and update sysroot_wrapper bisectorCassidy Burden
Add new testing script to sysroot_wrapper bisector and make all shell scripts for sysroot_wrapper bisector executable. TEST=Run new test on chromeos-chrome Change-Id: I312e50108e36341517ed1f8ea6b8d415e4184c2e Reviewed-on: https://chrome-internal-review.googlesource.com/265975 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-21Continue test if the test for one board failed.Yunlian Jiang
We run llvm validation test for several boards in a single script. During the test, if something goes wrong and it calls logger.LogFatal(), the whole test terminates because the LogFatal calls sys.exit() and it will terminate the whole script. This CL fixes that by catching the exception raised by sys.exit(). BUG=None TEST=the SystemExit exception is handled. Change-Id: I502361d4c55bf58c4c8106067768c17e94ce8631 Reviewed-on: https://chrome-internal-review.googlesource.com/265905 Commit-Ready: Yunlian Jiang <yunlian@google.com> Tested-by: Yunlian Jiang <yunlian@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-21binary search tool: Add Run method and move Main logic thereCassidy Burden
Add Run method so that the binary search tool can be easily invoked from other Python scripts (see update to binary_search_tool_tester.py). Now Main only does very basic arg_parse logic and leaves rest up to Run. Test=Unit tests run, cros_pkg tester passes Change-Id: I90400f9223c7aad0a2701944ba8282fb763f1cf7 Reviewed-on: https://chrome-internal-review.googlesource.com/265628 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com> Reviewed-by: Han Shen <shenhan@google.com>
2016-06-20Binary search tool: Refactor bs to binary_searchCassidy Burden
TEST=Run unit tests Change-Id: Ia7f682c42602e9355d1e2db67e258e2864c78126 Reviewed-on: https://chrome-internal-review.googlesource.com/265276 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com> Reviewed-by: Han Shen <shenhan@google.com>
2016-06-20binary search tool: Cleanup state files after SaveState unit testCassidy Burden
Running test_bad_save_state would previously leave a save state with no symlink pointing to it. This would cause multiple save states to gather and clutter up the directory. We now simply cleanup the generated save state in this test case. TEST=Run unit test and see if any state files remain Change-Id: If594c7266b2ff24a260e746a4d06bddea2c0bf78 Reviewed-on: https://chrome-internal-review.googlesource.com/265286 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-17Remove unnecessary prune iterations from binary search toolCassidy Burden
Previously the binary search tool would do multiple prune iterations to check if it was complete (using num_bad_items_history). This could lead to dozens of unneccesary prune iterations. Now we just do one extra prune iteration before completing by checking the found_items set. TEST=Run unit tests and test cros_pkg bisector Change-Id: Id5d6e45c15dcf4b4c0a1c1e6c3feb97d5c0d6d62 Reviewed-on: https://chrome-internal-review.googlesource.com/265275 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-17[crosperf] Add phony image testing, for easier package development.Caroline Tice
Using a 'real' bad image for bisecting tool development makes it very slow because it often requires manual intervention to push images onto device and to verify if image is good or bad. This CL creates a phony good/bad test that just looks at the md5 hash value of Chrome package, allowing testing to be done with two good images, which greatly simplifies bisecting tool development. BUG=None TEST=Tested these scripts individually in my chroot. Change-Id: I4342f8f152162e12f49b916f5977776aa79e1b03 Reviewed-on: https://chrome-internal-review.googlesource.com/264605 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-17Fix binary search tool SaveState to correctly save bisecting logicCassidy Burden
Previously SaveState wasn't saving the full program state. Now resuming can continue at the latest possible iteration. TEST=Unit tests run, tested with package bisector Change-Id: Id8542a61d16b4c3e18d696d0b601fbd0dd98d048 Reviewed-on: https://chrome-internal-review.googlesource.com/265096 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com> Reviewed-by: Han Shen <shenhan@google.com>
2016-06-17Fix cros_pkg switch scripts so last input is properly readCassidy Burden
When using --file_args the last line of input won't have a newline. This commit fixes the switch scripts so that read doesn't finish before reading the last line. Change-Id: Ia180ca2c26a40d6d0dafdb53d9129f3079e79a1b Reviewed-on: https://chrome-internal-review.googlesource.com/265085 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com> Reviewed-by: Han Shen <shenhan@google.com>
2016-06-16Add resuming to binary search toolCassidy Burden
Move around logic so that the binary search tool can be properly resumed and add the --resume option. TEST=Added unit test for LoadState Change-Id: I7059fab9ac6c37ecfd79e4cf2ef976bdebfef8fb Reviewed-on: https://chrome-internal-review.googlesource.com/264778 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com> Reviewed-by: Han Shen <shenhan@google.com>
2016-06-16Add script for llvm validation test.Yunlian Jiang
This create a script for llvm validation test. BUG=none TEST=it lanches trybot, runs test and sends out email. Change-Id: I85c5c8d1d9cdd9229a766b2cd5c307bdd35fc970 Reviewed-on: https://chrome-internal-review.googlesource.com/264996 Commit-Ready: Yunlian Jiang <yunlian@google.com> Tested-by: Yunlian Jiang <yunlian@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
2016-06-15Fix binary search tool's temp file creationCassidy Burden
Fix the binary search tool so that temp files are created properly. This means that temp files made for the switch scripts should be automatically deleted once the switch script completes. TEST=New unit test for temp file deletion Change-Id: I5d36bfa07e274cd79965f182d85d6a7ea3006c85 Reviewed-on: https://chrome-internal-review.googlesource.com/264735 Commit-Ready: Cassidy Burden <cburden@google.com> Tested-by: Cassidy Burden <cburden@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>