From cd7e122285e9ab0eb6dc9c90e026da767f553d95 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Mon, 7 May 2018 09:46:06 -0700 Subject: [PATCH] bootstat: test reboot rescueparty This test fails on most devices, gives us a report of devices that do not propagate the boot reason via the bootloader. This should become a bootloader required test. Test: boot_reason_test.sh optional_rescueparty Change-Id: Ibdc7b23b025e5d89d659ff08083b2e071343923c --- bootstat/boot_reason_test.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/bootstat/boot_reason_test.sh b/bootstat/boot_reason_test.sh index b194bbe7b..01b894842 100755 --- a/bootstat/boot_reason_test.sh +++ b/bootstat/boot_reason_test.sh @@ -312,6 +312,7 @@ init : processing action (boot) from (/system/etc/init/bootstat.rc init : processing action (ro.boot.bootreason=*) from (/system/etc/init/bootstat.rc init : processing action (sys.boot_completed=1 && sys.logbootcomplete=1) from (/system/etc/init/bootstat.rc (/system/bin/bootstat --record_boot_complete --record_boot_reason --record_time_since_factory_reset -l)' + (/system/bin/bootstat --set_system_boot_reason --record_boot_complete --record_boot_reason --record_time_since_factory_reset -l)' (/system/bin/bootstat -r post_decrypt_time_elapsed)' init : Command 'exec - system log -- /system/bin/bootstat --record_boot_complete' action=sys.boot_completed=1 && sys.logbootcomplete=1 (/system/etc/init/bootstat.rc: init : Command 'exec - system log -- /system/bin/bootstat --record_boot_reason' action=sys.boot_completed=1 && sys.logbootcomplete=1 (/system/etc/init/bootstat.rc: @@ -582,9 +583,9 @@ blind_reboot_test() { duration_test case ${TEST} in bootloader | recovery | cold | hard | warm ) reason=${TEST} ;; - *) reason=reboot,${TEST} ;; + *) reason=reboot,${TEST#optional_} ;; esac - adb reboot ${TEST} + adb reboot ${TEST#optional_} wait_for_screen bootloader_reason=`validate_property ro.boot.bootreason` EXPECT_PROPERTY ro.boot.bootreason ${bootloader_reason} @@ -948,6 +949,20 @@ test_adb_reboot() { report_bootstat_logs reboot,adb } +[ "USAGE: test_rescueparty + +rescueparty test +- adb reboot rescueparty +- (wait until screen is up, boot has completed) +- adb shell getprop sys.boot.reason +- adb shell getprop ro.boot.bootreason +- NB: should report reboot,rescueparty" ] +test_optional_rescueparty() { + blind_reboot_test + echo "WARNING: legacy devices are allowed to fail following ro.boot.bootreason result" >&2 + EXPECT_PROPERTY ro.boot.bootreason reboot,rescueparty +} + [ "USAGE: test_Its_Just_So_Hard_reboot Its Just So Hard reboot test: