summaryrefslogtreecommitdiff
path: root/tests/vboot_detach_menu_tests.c
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2018-03-22 14:38:11 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-03-26 20:16:25 -0700
commit3f896a5b638c26632098ff9fdf563686a55c10dd (patch)
treefda5cb41a2c31c90a634848e233802a0a2e28e55 /tests/vboot_detach_menu_tests.c
parent754e56bff6911fdd667b6c03d8b7ba1269dba966 (diff)
downloadvboot-3f896a5b638c26632098ff9fdf563686a55c10dd.tar.gz
Add new GBB_FLAG_FORCE_MANUAL_RECOVERY
It seems like there are some testing use cases where we want the device to boot into the recovery installer but it is impractical to fully simulate a user-triggered recovery. This has become impossible with the recent change to always require manual recovery to boot an image, even when the developer mode switch is enabled (CL:924458). This patch adds a new GBB flag to support this use case. When the flag is set, all recovery mode is manual recovery mode, regardless of wheter the developer mode switch is on or not. Since the GBB_FLAG_ENABLE_SERIAL was killed off before it ever really worked anyway, we can safely reuse the bit reserved for it. BRANCH=None BUG=None TEST=make runtests, manually confirmed on Kevin Change-Id: I4f51dfd20b4ff04c522f53596896dccbceee52dc Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/976660 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'tests/vboot_detach_menu_tests.c')
-rw-r--r--tests/vboot_detach_menu_tests.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/vboot_detach_menu_tests.c b/tests/vboot_detach_menu_tests.c
index 3d30683a..f494dc91 100644
--- a/tests/vboot_detach_menu_tests.c
+++ b/tests/vboot_detach_menu_tests.c
@@ -1333,6 +1333,20 @@ static void VbBootRecTest(void)
TEST_EQ(screens_count, 2, " no extra screens");
TEST_EQ(beeps_count, 0, " no beep on shutdown");
+ /* go to INSERT if forced by GBB flag */
+ ResetMocks();
+ vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
+ sd->gbb_flags |= GBB_FLAG_FORCE_MANUAL_RECOVERY;
+ TEST_EQ(VbBootRecoveryMenu(&ctx), VBERROR_SHUTDOWN_REQUESTED,
+ "Shutdown requested in INSERT forced by GBB flag");
+ TEST_EQ(vb2_nv_get(&ctx, VB2_NV_RECOVERY_REQUEST), 0, " no recovery");
+ TEST_EQ(debug_info_displayed, 0, " no debug info");
+ TEST_EQ(screens_displayed[0], VB_SCREEN_RECOVERY_INSERT,
+ " insert screen");
+ TEST_EQ(screens_displayed[1], VB_SCREEN_BLANK, " final blank screen");
+ TEST_EQ(screens_count, 2, " no extra screens");
+ TEST_EQ(beeps_count, 0, " no beep on shutdown");
+
/* Stay at BROKEN if recovery button not physically pressed */
ResetMocksForManualRecovery();
vbtlk_retval[0] = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;