diff options
author | edisonhello <edisonhello@google.com> | 2021-07-26 15:26:13 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-07-30 17:37:19 +0000 |
commit | c267a6908dcbffa8d683c25fc1ba87edf373acca (patch) | |
tree | 1ce72908970aed52522b8f9bdfee3abc47a7dc13 /tests | |
parent | 6cebe52a33eba8bb82430a7ce5560c590aee99a0 (diff) | |
download | vboot-c267a6908dcbffa8d683c25fc1ba87edf373acca.tar.gz |
vboot: Publicize and create functions for UI migration
Publicize vb2api_enable_developer_mode, vb2api_allow_recovery and
VbTryLoadKernel, and modify corresponding parts in tests.
Create vb2api_disable_dev_request, vb2api_request_diagnostics for
wrapping vb2_nv_set(ctx, VB2_NV_DISABLE_DEV_REQUEST, 1) and
vb2_nv_set(ctx, VB2_NV_DIAG_REQUEST, 1).
BUG=b:172339016
TEST=export CC=x86_64-pc-linux-gnu-clang DEBUG=1 DETACHABLE=0; \
make -j32 test_setup && make -j32 runtests;
TEST=export CC=x86_64-pc-linux-gnu-clang DEBUG=1 DETACHABLE=1; \
make -j32 test_setup && make -j32 runtests;
TEST=Hayato booted into developer mode
BRANCH=none
Change-Id: I0211a63ed58ce862ee3e17b4835c675544f773a4
Signed-off-by: edisonhello <edisonhello@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3053541
Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/vb2_auxfw_sync_tests.c | 1 | ||||
-rw-r--r-- | tests/vb2_ec_sync_tests.c | 1 | ||||
-rw-r--r-- | tests/vb2_kernel_tests.c | 1 | ||||
-rw-r--r-- | tests/vb2_misc_tests.c | 6 | ||||
-rw-r--r-- | tests/vb2_ui_action_tests.c | 2 | ||||
-rw-r--r-- | tests/vb2_ui_tests.c | 6 | ||||
-rw-r--r-- | tests/vboot_api_kernel4_tests.c | 1 | ||||
-rw-r--r-- | tests/vboot_api_kernel_tests.c | 1 | ||||
-rw-r--r-- | tests/verify_kernel.c | 2 |
9 files changed, 9 insertions, 12 deletions
diff --git a/tests/vb2_auxfw_sync_tests.c b/tests/vb2_auxfw_sync_tests.c index 48ce9529..3987d64f 100644 --- a/tests/vb2_auxfw_sync_tests.c +++ b/tests/vb2_auxfw_sync_tests.c @@ -16,7 +16,6 @@ #include "host_common.h" #include "load_kernel_fw.h" #include "test_common.h" -#include "vboot_kernel.h" #include "vboot_struct.h" /* Mock data */ diff --git a/tests/vb2_ec_sync_tests.c b/tests/vb2_ec_sync_tests.c index 8881ea73..ea0dbf11 100644 --- a/tests/vb2_ec_sync_tests.c +++ b/tests/vb2_ec_sync_tests.c @@ -13,7 +13,6 @@ #include "host_common.h" #include "load_kernel_fw.h" #include "test_common.h" -#include "vboot_kernel.h" #include "vboot_struct.h" /* Mock data */ diff --git a/tests/vb2_kernel_tests.c b/tests/vb2_kernel_tests.c index 0e1cb284..0dc0e749 100644 --- a/tests/vb2_kernel_tests.c +++ b/tests/vb2_kernel_tests.c @@ -15,6 +15,7 @@ #include "2sysincludes.h" #include "test_common.h" #include "vboot_struct.h" +#include "vboot_api.h" /* Common context for tests */ static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE] diff --git a/tests/vb2_misc_tests.c b/tests/vb2_misc_tests.c index 11f4ea90..042c0f71 100644 --- a/tests/vb2_misc_tests.c +++ b/tests/vb2_misc_tests.c @@ -58,7 +58,7 @@ static void reset_common_data(void) /* Mocked functions */ -int vb2_allow_recovery(struct vb2_context *c) +int vb2api_allow_recovery(struct vb2_context *c) { return allow_recovery_retval; } @@ -640,7 +640,7 @@ static void dev_switch_tests(void) static void enable_dev_tests(void) { reset_common_data(); - vb2_enable_developer_mode(ctx); + vb2api_enable_developer_mode(ctx); TEST_NEQ(vb2_secdata_firmware_get(ctx, VB2_SECDATA_FIRMWARE_FLAGS) & VB2_SECDATA_FIRMWARE_FLAG_DEV_MODE, 0, "dev mode flag set"); @@ -650,7 +650,7 @@ static void enable_dev_tests(void) /* secdata_firmware not initialized, aborts */ reset_common_data(); sd->status &= ~VB2_SD_STATUS_SECDATA_FIRMWARE_INIT; - TEST_ABORT(vb2_enable_developer_mode(ctx), + TEST_ABORT(vb2api_enable_developer_mode(ctx), "secdata_firmware no init, enable dev mode aborted"); sd->status |= VB2_SD_STATUS_SECDATA_FIRMWARE_INIT; TEST_EQ(vb2_secdata_firmware_get(ctx, VB2_SECDATA_FIRMWARE_FLAGS) & diff --git a/tests/vb2_ui_action_tests.c b/tests/vb2_ui_action_tests.c index 44649ac6..001d6c2e 100644 --- a/tests/vb2_ui_action_tests.c +++ b/tests/vb2_ui_action_tests.c @@ -12,7 +12,7 @@ #include "2ui.h" #include "2ui_private.h" #include "test_common.h" -#include "vboot_kernel.h" +#include "vboot_api.h" /* Fixed value for ignoring some checks. */ #define MOCK_IGNORE 0xffffu diff --git a/tests/vb2_ui_tests.c b/tests/vb2_ui_tests.c index 51a8853d..ca9a9987 100644 --- a/tests/vb2_ui_tests.c +++ b/tests/vb2_ui_tests.c @@ -13,7 +13,7 @@ #include "2ui.h" #include "2ui_private.h" #include "test_common.h" -#include "vboot_kernel.h" +#include "vboot_api.h" /* Fixed value for ignoring some checks */ #define MOCK_IGNORE 0xffffu @@ -514,7 +514,7 @@ vb2_error_t VbTryLoadKernel(struct vb2_context *c, uint32_t disk_flags) return mock_vbtlk_retval[i]; } -int vb2_allow_recovery(struct vb2_context *c) +int vb2api_allow_recovery(struct vb2_context *c) { return mock_allow_recovery; } @@ -527,7 +527,7 @@ int vb2ex_physical_presence_pressed(void) return mock_pp_pressed[mock_iters]; } -void vb2_enable_developer_mode(struct vb2_context *c) +void vb2api_enable_developer_mode(struct vb2_context *c) { mock_enable_dev_mode = 1; } diff --git a/tests/vboot_api_kernel4_tests.c b/tests/vboot_api_kernel4_tests.c index 38c6039f..02b548a3 100644 --- a/tests/vboot_api_kernel4_tests.c +++ b/tests/vboot_api_kernel4_tests.c @@ -17,7 +17,6 @@ #include "test_common.h" #include "tlcl.h" #include "tss_constants.h" -#include "vboot_kernel.h" #include "vboot_struct.h" #include "vboot_test.h" diff --git a/tests/vboot_api_kernel_tests.c b/tests/vboot_api_kernel_tests.c index 16933ea6..ea2f97c9 100644 --- a/tests/vboot_api_kernel_tests.c +++ b/tests/vboot_api_kernel_tests.c @@ -12,7 +12,6 @@ #include "load_kernel_fw.h" #include "test_common.h" #include "vboot_api.h" -#include "vboot_kernel.h" #include "vboot_test.h" #define MAX_TEST_DISKS 10 diff --git a/tests/verify_kernel.c b/tests/verify_kernel.c index 8fe969ef..a79f33a0 100644 --- a/tests/verify_kernel.c +++ b/tests/verify_kernel.c @@ -14,7 +14,7 @@ #include "host_common.h" #include "util_misc.h" #include "vboot_api.h" -#include "vboot_kernel.h" +#include "load_kernel_fw.h" static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE] __attribute__((aligned(VB2_WORKBUF_ALIGN))); |