summaryrefslogtreecommitdiff
path: root/tests/vb2_misc_tests.c
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-05-23 15:33:54 +0800
committerCommit Bot <commit-bot@chromium.org>2019-06-07 22:40:03 +0000
commit3eb00efa4eb30e02d1b3197dafc5975fdcbe5914 (patch)
treea60cece3b500976279a32bb7e71d4ba993d4400e /tests/vb2_misc_tests.c
parent96d5a58cbe65d762c64dc0e8f5ecc7af397015a4 (diff)
downloadvboot-3eb00efa4eb30e02d1b3197dafc5975fdcbe5914.tar.gz
vboot: rewrite GBB functions and API
Old vboot1-style GBB accessor functions were awkwardly located within region-init.c. Rewrite GBB accessor functions for vboot2, and formally expose HWID retrieval function via vboot2 API. workbuf is used for key retrieval functions, while a buffer provided by the caller is used for HWID retrieval function. Reintroduce vboot_display_tests to `make runtests` test suite. Move GBB tests from vboot_display_tests to vb2_gbb_tests. Properly propagate vb2_workbuf objects within the function call stack (vb2_load_partition). BUG=b:124141368, chromium:954774 TEST=Build and flash to eve, check that Chrome OS boots TEST=Build with CL:1627469 applied, check HWID TEST=make clean && make runtests BRANCH=none Change-Id: I398d1329f0b092de35aac73d98dfd9aee6e4e7de Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1584488 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Jason Clinton <jclinton@chromium.org>
Diffstat (limited to 'tests/vb2_misc_tests.c')
-rw-r--r--tests/vb2_misc_tests.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/vb2_misc_tests.c b/tests/vb2_misc_tests.c
index d36dd44f..3c262633 100644
--- a/tests/vb2_misc_tests.c
+++ b/tests/vb2_misc_tests.c
@@ -52,6 +52,10 @@ static void reset_common_data(void)
};
/* Mocked functions */
+struct vb2_gbb_header *vb2_get_gbb(struct vb2_context *c)
+{
+ return &gbb;
+}
int vb2ex_read_resource(struct vb2_context *c,
enum vb2_resource_index index,
@@ -77,11 +81,6 @@ int vb2ex_tpm_clear_owner(struct vb2_context *c)
}
/* Tests */
-struct vb2_gbb_header *vb2_get_gbb(struct vb2_context *c)
-{
- return &gbb;
-}
-
static void init_context_tests(void)
{
/* Use our own context struct so we can re-init it */