diff options
author | Furquan Shaikh <furquan@chromium.org> | 2016-11-03 16:05:07 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-11-08 02:52:45 -0800 |
commit | 95b2d6ca2bea2a81ceeea58bc4660dfb3fa13a07 (patch) | |
tree | add29853a6a58dd85f92c4b08d7222cfc13fc7ed /tests | |
parent | 6e3931d1f609fc23b3ca8c7f6e563926e4f38b69 (diff) | |
download | vboot-95b2d6ca2bea2a81ceeea58bc4660dfb3fa13a07.tar.gz |
recovery: Add new recovery reason to train memory and reboot
This new recovery reason will instruct the calling firmware in
vboot_select_and_load_kernel to reboot the device (under the assumption
that training of memory has already been performed by the firmware). On
seeing the return code VBERROR_REBOOT_REQUESTED, calling firmware should
perform a reboot.
BUG=chrome-os-partner:59352
BRANCH=None
TEST=make -j runtests successful
Change-Id: I110a735e612665cb2378bd71ca01a111edaf58e3
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/407656
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/vboot_api_kernel2_tests.c | 8 | ||||
-rw-r--r-- | tests/vboot_api_kernel4_tests.c | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/tests/vboot_api_kernel2_tests.c b/tests/vboot_api_kernel2_tests.c index 8a566367..433933ba 100644 --- a/tests/vboot_api_kernel2_tests.c +++ b/tests/vboot_api_kernel2_tests.c @@ -360,7 +360,7 @@ static void VbBootDevTest(void) shared->flags = VBSD_HONOR_VIRT_DEV_SWITCH | VBSD_BOOT_DEV_SWITCH_ON; mock_keypress[0] = ' '; mock_keypress[1] = '\r'; - TEST_EQ(VbBootDeveloper(&cparams, &lkp), VBERROR_TPM_REBOOT_REQUIRED, + TEST_EQ(VbBootDeveloper(&cparams, &lkp), VBERROR_REBOOT_REQUIRED, "Space = tonorm"); TEST_EQ(screens_displayed[0], VB_SCREEN_DEVELOPER_WARNING, " warning screen"); @@ -398,7 +398,7 @@ static void VbBootDevTest(void) gbb.flags |= GBB_FLAG_ENTER_TRIGGERS_TONORM; mock_keypress[0] = '\r'; mock_keypress[1] = '\r'; - TEST_EQ(VbBootDeveloper(&cparams, &lkp), VBERROR_TPM_REBOOT_REQUIRED, + TEST_EQ(VbBootDeveloper(&cparams, &lkp), VBERROR_REBOOT_REQUIRED, "Enter = tonorm"); /* Tonorm ignored if GBB forces dev switch on */ @@ -502,7 +502,7 @@ static void VbBootDevTest(void) VbApiKernelGetFwmp()->flags |= FWMP_DEV_DISABLE_BOOT; mock_keypress[0] = '\x1b'; /* Just causes TONORM again */ mock_keypress[1] = '\r'; - TEST_EQ(VbBootDeveloper(&cparams, &lkp), VBERROR_TPM_REBOOT_REQUIRED, + TEST_EQ(VbBootDeveloper(&cparams, &lkp), VBERROR_REBOOT_REQUIRED, "FWMP dev disabled"); TEST_EQ(screens_displayed[0], VB_SCREEN_DEVELOPER_TO_NORM, " tonorm screen"); @@ -690,7 +690,7 @@ static void VbBootRecTest(void) mock_keypress[0] = 0x04; mock_keypress[1] = '\r'; mock_keyflags[1] = VB_KEY_FLAG_TRUSTED_KEYBOARD; - TEST_EQ(VbBootRecovery(&cparams, &lkp), VBERROR_TPM_REBOOT_REQUIRED, + TEST_EQ(VbBootRecovery(&cparams, &lkp), VBERROR_REBOOT_REQUIRED, "Ctrl+D todev confirm"); TEST_EQ(virtdev_set, 1, " virtual dev mode on"); diff --git a/tests/vboot_api_kernel4_tests.c b/tests/vboot_api_kernel4_tests.c index 2672c4e7..401c61d5 100644 --- a/tests/vboot_api_kernel4_tests.c +++ b/tests/vboot_api_kernel4_tests.c @@ -244,7 +244,9 @@ static void VbSlkTest(void) rkr_retval = rkw_retval = rkl_retval = VBERROR_SIMULATED; test_slk(0, 0, "Recovery ignore TPM errors"); - + ResetMocks(); + shared->recovery_reason = VBNV_RECOVERY_TRAIN_AND_REBOOT; + test_slk(VBERROR_REBOOT_REQUIRED, 0, "Recovery train and reboot"); // todo: rkr/w/l fail ignored if recovery |