summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2015-05-25 21:46:10 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-05-29 11:29:20 +0000
commitc180460febf4039c86b87ba708c8299749cbfdd6 (patch)
tree13f9dd770685ac500abea63fd0b3c1d06cc7253a /tests
parentebf886b5fd3dd75a00205879f3847198ecf83bdd (diff)
downloadvboot-c180460febf4039c86b87ba708c8299749cbfdd6.tar.gz
fastboot: Add fastboot related flags to nvstorage
Use unused offset 8 for fastboot related flags. BUG=chrome-os-partner:40196 BRANCH=None TEST=Compiles successfully. Change-Id: I6df0985924ba80cdcb68bb6b7658bf962f01287f Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/273180 Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Furquan Shaikh <furquan@chromium.org> Trybot-Ready: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/vboot_api_init_tests.c12
-rw-r--r--tests/vboot_nvstorage_test.c1
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/vboot_api_init_tests.c b/tests/vboot_api_init_tests.c
index a74c541d..bfa5d7df 100644
--- a/tests/vboot_api_init_tests.c
+++ b/tests/vboot_api_init_tests.c
@@ -556,6 +556,7 @@ static void VbInitTestBackup(void)
VbNvSet(&vnc, VBNV_DEV_BOOT_LEGACY, 1);
VbNvSet(&vnc, VBNV_DEV_BOOT_SIGNED_ONLY, 1);
VbNvSet(&vnc, VBNV_DEV_BOOT_FASTBOOT_FULL_CAP, 1);
+ VbNvSet(&vnc, VBNV_FASTBOOT_UNLOCK_IN_FW, 1);
/* and some that don't */
VbNvSet(&vnc, VBNV_OPROM_NEEDED, 1);
VbNvSet(&vnc, VBNV_TRY_B_COUNT, 3);
@@ -585,6 +586,8 @@ static void VbInitTestBackup(void)
TEST_EQ(u, 0, " NV dev_boot_signed_only");
VbNvGet(&vnc, VBNV_DEV_BOOT_FASTBOOT_FULL_CAP, &u);
TEST_EQ(u, 0, " NV dev_boot_fastboot_full_cap");
+ VbNvGet(&vnc, VBNV_FASTBOOT_UNLOCK_IN_FW, &u);
+ TEST_EQ(u, 0, " NV_fastboot_unlock_in_fw ");
/* So we should have written the backup */
TEST_EQ(backup_write_called, 1, " Backup written once");
/* And the backup should reflect the persisent flags. */
@@ -602,6 +605,8 @@ static void VbInitTestBackup(void)
TEST_EQ(u, 0, " BU dev_boot_signed_only");
VbNvGet(&tmp_vnc, VBNV_DEV_BOOT_FASTBOOT_FULL_CAP, &u);
TEST_EQ(u, 0, " BU dev_boot_fastboot_full_cap");
+ VbNvGet(&tmp_vnc, VBNV_FASTBOOT_UNLOCK_IN_FW, &u);
+ TEST_EQ(u, 0, " BU fastboot_unlock_in_fw");
/* but not the others */
VbNvGet(&tmp_vnc, VBNV_OPROM_NEEDED, &u);
TEST_EQ(u, 0, " BU oprom_needed");
@@ -642,6 +647,7 @@ static void VbInitTestBackup(void)
VbNvSet(&vnc, VBNV_DEV_BOOT_LEGACY, 1);
VbNvSet(&vnc, VBNV_DEV_BOOT_SIGNED_ONLY, 1);
VbNvSet(&vnc, VBNV_DEV_BOOT_FASTBOOT_FULL_CAP, 1);
+ VbNvSet(&vnc, VBNV_FASTBOOT_UNLOCK_IN_FW, 1);
/* and some that don't */
VbNvSet(&vnc, VBNV_OPROM_NEEDED, 1);
VbNvSet(&vnc, VBNV_TRY_B_COUNT, 4);
@@ -691,6 +697,8 @@ static void VbInitTestBackup(void)
TEST_EQ(u, 1, " BU dev_boot_signed_only");
VbNvGet(&tmp_vnc, VBNV_DEV_BOOT_FASTBOOT_FULL_CAP, &u);
TEST_EQ(u, 1, " BU dev_boot_fastboot_full_cap");
+ VbNvGet(&tmp_vnc, VBNV_FASTBOOT_UNLOCK_IN_FW, &u);
+ TEST_EQ(u, 1, " BU fastboot_unlock_in_fw");
/* but not the others */
VbNvGet(&tmp_vnc, VBNV_OPROM_NEEDED, &u);
TEST_EQ(u, 0, " BU oprom_needed");
@@ -730,6 +738,8 @@ static void VbInitTestBackup(void)
TEST_EQ(u, 1, " BU dev_boot_signed_only");
VbNvGet(&vnc, VBNV_DEV_BOOT_FASTBOOT_FULL_CAP, &u);
TEST_EQ(u, 1, " BU dev_boot_fastboot_full_cap");
+ VbNvGet(&vnc, VBNV_FASTBOOT_UNLOCK_IN_FW, &u);
+ TEST_EQ(u, 1, " BU fastboot_unlock_in_fw");
/*
* But if we lose the NV storage and go back to normal mode at the same
@@ -766,6 +776,8 @@ static void VbInitTestBackup(void)
TEST_EQ(u, 0, " BU dev_boot_signed_only");
VbNvGet(&vnc, VBNV_DEV_BOOT_FASTBOOT_FULL_CAP, &u);
TEST_EQ(u, 0, " BU dev_boot_fastboot_full_cap");
+ VbNvGet(&vnc, VBNV_FASTBOOT_UNLOCK_IN_FW, &u);
+ TEST_EQ(u, 0, " BU fastboot_unlock_in_fw");
}
diff --git a/tests/vboot_nvstorage_test.c b/tests/vboot_nvstorage_test.c
index 9548a806..7df0cffd 100644
--- a/tests/vboot_nvstorage_test.c
+++ b/tests/vboot_nvstorage_test.c
@@ -44,6 +44,7 @@ static VbNvField nvfields[] = {
{VBNV_FW_RESULT, VBNV_FW_RESULT_UNKNOWN, 1, 2, "firmware result"},
{VBNV_FW_PREV_TRIED, 0, 1, 0, "firmware prev tried"},
{VBNV_FW_PREV_RESULT, VBNV_FW_RESULT_UNKNOWN, 1, 3, "firmware prev result"},
+ {VBNV_FASTBOOT_UNLOCK_IN_FW, 0, 1, 0, "fastboot unlock in firmware"},
{0, 0, 0, 0, NULL}
};