summaryrefslogtreecommitdiff
path: root/tests/vboot_kernel_tests.c
diff options
context:
space:
mode:
authorDan Ehrenberg <dehrenberg@chromium.org>2014-11-04 16:06:20 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-11-15 01:13:52 +0000
commit5040a945dfd0dd305d3ca8e923b8bf0bd5c6528e (patch)
tree5b4003d4b4063151f1b60faa4482c4392159adc1 /tests/vboot_kernel_tests.c
parente8dfacf141844ec1c2c78ecc98d85b3698bf946c (diff)
downloadvboot-5040a945dfd0dd305d3ca8e923b8bf0bd5c6528e.tar.gz
vboot: Plumb the two disk sizes and 'gpt on device' param through
To support an external GPT, disks have two new attributes: - A binary flag indicating whether the GPT is in the same address space as the payloads or a separate one. - The number of sectors of the streaming portion of storage, as opposed to the portion containing the GPT. These have been added elsewhere to GptData (in cgptlib) and BlockDev (in depthcharge). This patch adds the plumbing between those, including in the DiskInfo interface between the firmware and vboot. BUG=chromium:425677 BRANCH=none TEST=Interactively wrote the GPT with cgpt and observed the following boot with depthcharge to read the GPT from SPI and then read from the proper locations in NAND flash. make runalltests passes. Signed-off-by: Dan Ehrenberg <dehrenberg@chromium.org> Change-Id: I5a77e417aea8ee9442d18c200d1b073aa5375ecf Reviewed-on: https://chromium-review.googlesource.com/228943 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'tests/vboot_kernel_tests.c')
-rw-r--r--tests/vboot_kernel_tests.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/vboot_kernel_tests.c b/tests/vboot_kernel_tests.c
index c546ed12..4866a6d3 100644
--- a/tests/vboot_kernel_tests.c
+++ b/tests/vboot_kernel_tests.c
@@ -151,6 +151,7 @@ static void ResetMocks(void)
lkp.gbb_size = sizeof(gbb_data);
lkp.bytes_per_lba = 512;
lkp.ending_lba = 1023;
+ lkp.gpt_lba_count = 1024;
lkp.kernel_buffer = kernel_buffer;
lkp.kernel_buffer_size = sizeof(kernel_buffer);
lkp.disk_handle = (VbExDiskHandle_t)1;
@@ -541,6 +542,11 @@ static void InvalidParamsTest(void)
TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_NO_KERNEL_FOUND,
"Bad GPT");
+ ResetMocks();
+ lkp.gpt_lba_count = 0;
+ TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_NO_KERNEL_FOUND,
+ "GPT size = 0");
+
/* This causes the stream open call to fail */
ResetMocks();
lkp.disk_handle = NULL;