From c7ee80e420941341fedaf8e620776f5b4a9df9df Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Wed, 30 Nov 2016 09:41:28 -0800 Subject: [binary search tool] Allow non-flashing images to be fails. Currently if an image is so bad that it can't be flashed, it gets marked as 'skipped', which is different from bad/failed. This can cause the binary search to never find the bad image. We need an option to treat a non-flashing image as a failure. That's what this CL does. BUG=None TEST=Tested by Manoj: without this change, binary search failed to find any bad packages, but with this change it worked. Change-Id: Ib223338a1820314e85352827857fb8f3ba1ed73a Reviewed-on: https://chrome-internal-review.googlesource.com/307824 Commit-Ready: Caroline Tice Tested-by: Caroline Tice Reviewed-by: Manoj Gupta --- binary_search_tool/android/test_setup.sh | 6 ++++-- binary_search_tool/binary_search_state.py | 3 --- binary_search_tool/common/test_setup.sh | 6 ++++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/binary_search_tool/android/test_setup.sh b/binary_search_tool/android/test_setup.sh index 985d27f4..26f8ec22 100755 --- a/binary_search_tool/android/test_setup.sh +++ b/binary_search_tool/android/test_setup.sh @@ -84,13 +84,15 @@ flash() echo "1. Debug and/or flash manually" echo "2. Retry flashing automatically" echo "3. Abort this installation and skip this image" + echo "4. Abort this installation and mark test as failed" sleep 1 read -p "Which method would you like to do? " choice case $choice in 1) manual_flash && break;; 2) auto_flash && break;; - 3) return 1;; - *) echo "Please answer 1, 2, or 3.";; + 3) return 125;; + 4) return 1;; + *) echo "Please answer 1, 2, 3, or 4.";; esac done } diff --git a/binary_search_tool/binary_search_state.py b/binary_search_tool/binary_search_state.py index 8356d93e..a10e90b9 100755 --- a/binary_search_tool/binary_search_state.py +++ b/binary_search_tool/binary_search_state.py @@ -293,9 +293,6 @@ class BinarySearchState(object): status = self.TestSetupScript() if status == 0: status = self.TestScript() - else: - # Test setup script failed, treat as skipped item - status = 125 terminated = self.binary_search.SetStatus(status) if terminated: diff --git a/binary_search_tool/common/test_setup.sh b/binary_search_tool/common/test_setup.sh index 7aae9c9c..c4f5f698 100755 --- a/binary_search_tool/common/test_setup.sh +++ b/binary_search_tool/common/test_setup.sh @@ -144,13 +144,15 @@ if [[ ${build_status} -eq 0 ]] ; then echo "1. Flash through USB" echo "2. Retry flashing over ethernet" echo "3. Abort this installation and skip this image" + echo "4. Abort this installation and mark test as failed" sleep 1 read -p "Which method would you like to do? " choice case $choice in 1) usb_flash && break;; 2) ethernet_flash && break;; - 3) exit 1;; - *) echo "Please answer 1, 2, or 3.";; + 3) exit 125;; + 4) exit 1;; + *) echo "Please answer 1, 2, 3, or 4.";; esac done -- cgit v1.2.3