bootstat: add .* positive/negative test

Missing test from aosp/949599

Test: boot_reason_test.sh kBootReasonMap
Bug: 116838876
Bug: 128929506
Change-Id: I3a0690cff80b3b2117cf821ece4b81ffdcf50aec
This commit is contained in:
Mark Salyzyn 2019-04-24 07:26:26 -07:00
parent f9e9d38697
commit aeac7a43d0
1 changed files with 10 additions and 2 deletions

View File

@ -1253,7 +1253,12 @@ filter_kBootReasonMap() {
echo 1 reboot,empty # negative test (ID for unknown is 1)
;;
reboot)
echo 1 reboo # negative test (ID for unknown is 1)
echo 1 reboog # negative test (ID for unknown is 1)
;;
'reboot,pmic_off_fault,.*')
echo ${id} reboot,pmic_off_fault,hello,world
echo ${id} reboot,pmic_off_fault,
echo 1 reboot,pmic_off_fault
;;
esac
echo ${id} "${match}" # matches b/c of exact
@ -1266,6 +1271,8 @@ kBootReasonMap test
- (wait until screen is up, boot has completed)
- read bootstat for kBootReasonMap entries and test them all" ]
test_kBootReasonMap() {
checkDebugBuild || return
duration_test 15
local tempfile="`mktemp`"
local arg=--boot_reason_enum
adb_su bootstat ${arg} </dev/null 2>/dev/null |
@ -1295,7 +1302,8 @@ test_kBootReasonMap() {
report_bootstat_logs -t${T} \
'-bootstat: Service started: bootstat --boot_reason_enum=' \
'-bootstat: Unknown boot reason: reboot,empty' \
'-bootstat: Unknown boot reason: reboo'
'-bootstat: Unknown boot reason: reboog' \
'-bootstat: Unknown boot reason: reboot,pmic_off_fault'
}
[ "USAGE: ${progname} [-s SERIAL] [tests]...