From e7c95fb34f9fb9d2ee0f886cc97b824bac4b0e43 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Fri, 13 Oct 2017 09:26:15 -0700 Subject: [PATCH] bootstat: test: add error propagation for fastboot format userdata Test: system/core/bootstat/boot_reason_test.sh optional_factory_reset Bug: 63736262 Change-Id: I8893df15ef802bb76c0795288df91d8463bfe3d1 --- bootstat/boot_reason_test.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bootstat/boot_reason_test.sh b/bootstat/boot_reason_test.sh index e69db12d8..c1d54308b 100755 --- a/bootstat/boot_reason_test.sh +++ b/bootstat/boot_reason_test.sh @@ -241,7 +241,8 @@ EXPECT_EQ() { [ "USAGE: EXPECT_PROPERTY [--allow_failure] -Returns true if current return (regex) value is true and the result matches" ] +Returns true (0) if current return (regex) value is true and the result matches +and the incoming return value is true as well (wired-or)" ] EXPECT_PROPERTY() { save_ret=${?} property="${1}" @@ -628,8 +629,13 @@ test_optional_factory_reset() { adb reboot-bootloader fi fastboot format userdata >&2 + save_ret=${?} + if [ 0 != ${save_ret} ]; then + echo "ERROR: fastboot can not format userdata" >&2 + fi fastboot reboot >&2 wait_for_screen + ( exit ${save_ret} ) # because one can not just do ?=${save_ret} EXPECT_PROPERTY sys.boot.reason reboot,factory_reset EXPECT_PROPERTY persist.sys.boot.reason "" report_bootstat_logs reboot,factory_reset bootloader \