Home | History | Annotate | Download | only in sysroot_wrapper
      1 #!/bin/bash -u
      2 #
      3 # Copyright 2016 Google Inc. All Rights Reserved.
      4 #
      5 # This script pings the chromebook to determine if it successfully booted.
      6 # It then asks the user if the image is good or not, allowing the user to
      7 # conduct whatever tests the user wishes, and waiting for a response.
      8 #
      9 # This script is intended to be used by binary_search_state.py, as
     10 # part of the binary search triage on ChromeOS package and object files. It
     11 # waits for the test setup script to build and install the image, then asks the
     12 # user if the image is good or not. It should return '0' if the test succeeds
     13 # (the image is 'good'); '1' if the test fails (the image is 'bad'); and '125'
     14 # if it could not determine (does not apply in this case).
     15 #
     16 
     17 source common/common.sh
     18 
     19 ping -c 3 -W 3 ${BISECT_REMOTE}
     20 retval=$?
     21 
     22 if [[ ${retval} -eq 0 ]]; then
     23     echo "ChromeOS image has been built and installed on ${BISECT_REMOTE}."
     24 else
     25     exit 1
     26 fi
     27 
     28 while true; do
     29     read -p "Is this a good ChromeOS image?" yn
     30     case $yn in
     31         [Yy]* ) exit 0;;
     32         [Nn]* ) exit 1;;
     33         * ) echo "Please answer yes or no.";;
     34     esac
     35 done
     36 
     37 exit 125
     38