aboutsummaryrefslogtreecommitdiff
path: root/binary_search_tool
diff options
context:
space:
mode:
authorCaroline Tice <cmtice@google.com>2016-11-30 09:41:28 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-12-01 17:06:08 -0800
commitc7ee80e420941341fedaf8e620776f5b4a9df9df (patch)
tree9ae5d46c19ef807db839a13a0a22757062c117d9 /binary_search_tool
parente02e9f819648419cc1d6e59d02ddf50d16f0ca22 (diff)
downloadtoolchain-utils-c7ee80e420941341fedaf8e620776f5b4a9df9df.tar.gz
[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 <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Manoj Gupta <manojgupta@google.com>
Diffstat (limited to 'binary_search_tool')
-rwxr-xr-xbinary_search_tool/android/test_setup.sh6
-rwxr-xr-xbinary_search_tool/binary_search_state.py3
-rwxr-xr-xbinary_search_tool/common/test_setup.sh6
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