From aeac7a43d0f91a2ef892e23e0a7c88117cbb2684 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Wed, 24 Apr 2019 07:26:26 -0700 Subject: [PATCH] bootstat: add .* positive/negative test Missing test from aosp/949599 Test: boot_reason_test.sh kBootReasonMap Bug: 116838876 Bug: 128929506 Change-Id: I3a0690cff80b3b2117cf821ece4b81ffdcf50aec --- bootstat/boot_reason_test.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bootstat/boot_reason_test.sh b/bootstat/boot_reason_test.sh index cb09433d1..8979b0c9e 100755 --- a/bootstat/boot_reason_test.sh +++ b/bootstat/boot_reason_test.sh @@ -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 | @@ -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]...