summaryrefslogtreecommitdiff
path: root/tests/vb2_ui_action_tests.c
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2021-04-29 12:02:16 +0800
committerCommit Bot <commit-bot@chromium.org>2021-06-15 19:35:56 +0000
commit4e982f1c39da417100e4021fb1c2c370da5f8dd6 (patch)
tree658c9539ddd1841087da6d742e4c2d999cb3e6e1 /tests/vb2_ui_action_tests.c
parentda50d8587ae24b1a5e7528dde1ead5523e78f6b2 (diff)
downloadvboot-4e982f1c39da417100e4021fb1c2c370da5f8dd6.tar.gz
vboot/vboot_kernel: break disk check out to separate functionstabilize-14031.B
Move disk validity check to static function is_valid_disk(). If multiple disk types are selected (e.g. REMOVABLE | FIXED), is_valid_disk() will now check that exactly *one* of those flags is selected by VbDiskInfo.flags. Also, split disk flags into two 16-bit sections: - Disk selection in the lower 16 bits (where the disk lives) - Disk attributes in the higher 16 bits (extra information about the disk needed to access it correctly) This CL is part of a series to merge vboot1 and vboot2.0 kernel verification code; see b/181739551. BUG=b:181739551 TEST=make clean && make runtests BRANCH=none Signed-off-by: Joel Kitching <kitching@google.com> Change-Id: Icf76ab6e92cca40810071def66aed13cdb3a7ec7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2872251 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'tests/vb2_ui_action_tests.c')
-rw-r--r--tests/vb2_ui_action_tests.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/vb2_ui_action_tests.c b/tests/vb2_ui_action_tests.c
index 66a776eb..6db75bfd 100644
--- a/tests/vb2_ui_action_tests.c
+++ b/tests/vb2_ui_action_tests.c
@@ -235,10 +235,10 @@ static void add_mock_keypress(uint32_t press)
}
-static void set_mock_vbtlk(vb2_error_t retval, uint32_t get_info_flags)
+static void set_mock_vbtlk(vb2_error_t retval, uint32_t disk_flags)
{
mock_vbtlk_retval = retval;
- mock_vbtlk_expected_flag = get_info_flags;
+ mock_vbtlk_expected_flag = disk_flags;
}
static void displayed_eq(const char *text,
@@ -481,10 +481,10 @@ uint32_t VbExKeyboardReadWithFlags(uint32_t *key_flags)
return 0;
}
-vb2_error_t VbTryLoadKernel(struct vb2_context *c, uint32_t get_info_flags)
+vb2_error_t VbTryLoadKernel(struct vb2_context *c, uint32_t disk_flags)
{
- TEST_EQ(mock_vbtlk_expected_flag, get_info_flags,
- " unexpected get_info_flags");
+ TEST_EQ(mock_vbtlk_expected_flag, disk_flags,
+ " unexpected disk_flags");
return mock_vbtlk_retval;
}