ci: extend expect-output.sh
We need to support different fastboot fetch strings for different bootloader solutions. Lets extend expect-output.sh to support multiple fetch strings (-f) and add support for error catch strings (-e) to stop the CI run early. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5258>
This commit is contained in:
parent
ef5b8bbc5e
commit
06d8171994
|
@ -72,11 +72,11 @@ $BM/write-serial.py $BM_SERIAL_EC reboot
|
||||||
# This is emitted right when the bootloader pauses to check for input. Emit a
|
# This is emitted right when the bootloader pauses to check for input. Emit a
|
||||||
# ^N character to request network boot, because we don't have a
|
# ^N character to request network boot, because we don't have a
|
||||||
# direct-to-netboot firmware on cheza.
|
# direct-to-netboot firmware on cheza.
|
||||||
$BM/expect-output.sh serial-output.txt "load_archive: loading locale_en.bin"
|
$BM/expect-output.sh serial-output.txt -f "load_archive: loading locale_en.bin"
|
||||||
$BM/write-serial.py $BM_SERIAL `printf '\016'`
|
$BM/write-serial.py $BM_SERIAL `printf '\016'`
|
||||||
|
|
||||||
# Wait for the device to complete the deqp run
|
# Wait for the device to complete the deqp run
|
||||||
$BM/expect-output.sh serial-output.txt "DEQP RESULT"
|
$BM/expect-output.sh serial-output.txt -f "DEQP RESULT"
|
||||||
|
|
||||||
# power down the CPU on the device
|
# power down the CPU on the device
|
||||||
$BM/write-serial.py $BM_SERIAL_EC 'power off'
|
$BM/write-serial.py $BM_SERIAL_EC 'power off'
|
||||||
|
|
|
@ -2,8 +2,29 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "Waiting for $1 to say '$2'"
|
STRINGS=$(mktemp)
|
||||||
|
ERRORS=$(mktemp)
|
||||||
|
|
||||||
while ! grep -q "$2" $1; do
|
trap "rm $STRINGS; rm $ERRORS;" EXIT
|
||||||
|
|
||||||
|
FILE=$1
|
||||||
|
shift 1
|
||||||
|
|
||||||
|
while getopts "f:e:" opt; do
|
||||||
|
case $opt in
|
||||||
|
f) echo "$OPTARG" >> $STRINGS;;
|
||||||
|
e) echo "$OPTARG" >> $STRINGS ; echo "$OPTARG" >> $ERRORS;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $((OPTIND -1))
|
||||||
|
|
||||||
|
echo "Waiting for $FILE to say one of following strings"
|
||||||
|
cat $STRINGS
|
||||||
|
|
||||||
|
while ! egrep -wf $STRINGS $FILE; do
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if egrep -wf $ERRORS $FILE; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
|
@ -78,11 +78,11 @@ done
|
||||||
PATH=$BM:$PATH $BM_POWERUP
|
PATH=$BM:$PATH $BM_POWERUP
|
||||||
|
|
||||||
# Once fastboot is ready, boot our image.
|
# Once fastboot is ready, boot our image.
|
||||||
$BM/expect-output.sh artifacts/serial-output.txt "fastboot: processing commands"
|
$BM/expect-output.sh artifacts/serial-output.txt -f "fastboot: processing commands"
|
||||||
fastboot boot -s $BM_FASTBOOT_SERIAL artifacts/fastboot.img
|
fastboot boot -s $BM_FASTBOOT_SERIAL artifacts/fastboot.img
|
||||||
|
|
||||||
# Wait for the device to complete the deqp run
|
# Wait for the device to complete the deqp run
|
||||||
$BM/expect-output.sh artifacts/serial-output.txt "DEQP RESULT"
|
$BM/expect-output.sh artifacts/serial-output.txt -f "DEQP RESULT"
|
||||||
|
|
||||||
# power down the device
|
# power down the device
|
||||||
PATH=$BM:$PATH $BM_POWERDOWN
|
PATH=$BM:$PATH $BM_POWERDOWN
|
||||||
|
|
Loading…
Reference in New Issue