diff options
author | Ben Chan <benchan@chromium.org> | 2018-01-31 11:39:14 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-02-06 18:18:35 -0800 |
commit | a4a8c02ad5988bd4b6fd85f6e09e9e0e79d18feb (patch) | |
tree | a1cc5fb4923c3d5a990fb486debc7cb2fe261f04 /tests | |
parent | 3585eb3d21da676db3d87e9e0490a0df92d597d2 (diff) | |
download | vboot-a4a8c02ad5988bd4b6fd85f6e09e9e0e79d18feb.tar.gz |
cgpt: add support for managing GPT platform required partition bit
Bit 0 in the GPT partition attributes is defined to indicate whether a
partition is required by the platform. This CL adds the support for
managing this bit to cgpt.
BUG=b:70807006
BRANCH=None
TEST=Run unit tests.
Change-Id: Iaf87c828438b3df6730de502ae420fcf4c61277b
Reviewed-on: https://chromium-review.googlesource.com/902196
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cgptlib_test.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/cgptlib_test.c b/tests/cgptlib_test.c index c0147e16..f37a2725 100644 --- a/tests/cgptlib_test.c +++ b/tests/cgptlib_test.c @@ -1130,6 +1130,15 @@ static int EntryAttributeGetSetTest(void) GptEntry *e = (GptEntry *)(gpt->primary_entries); e->attrs.whole = 0x0000000000000000ULL; + SetEntryRequired(e, 1); + EXPECT(0x0000000000000001ULL == e->attrs.whole); + EXPECT(1 == GetEntryRequired(e)); + e->attrs.whole = 0xFFFFFFFFFFFFFFFFULL; + SetEntryRequired(e, 0); + EXPECT(0xFFFFFFFFFFFFFFFEULL == e->attrs.whole); + EXPECT(0 == GetEntryRequired(e)); + + e->attrs.whole = 0x0000000000000000ULL; SetEntryLegacyBoot(e, 1); EXPECT(0x0000000000000004ULL == e->attrs.whole); EXPECT(1 == GetEntryLegacyBoot(e)); @@ -1184,6 +1193,7 @@ static int EntryAttributeGetSetTest(void) override_priority = 10; e->attrs.whole = 0xFFFFFFFFFFFFFFFFULL; + EXPECT(1 == GetEntryRequired(e)); EXPECT(1 == GetEntryLegacyBoot(e)); EXPECT(1 == GetEntrySuccessful(e)); EXPECT(10 == GetEntryPriority(e)); @@ -1191,6 +1201,7 @@ static int EntryAttributeGetSetTest(void) override_priority = 0; e->attrs.whole = 0x0123000000000004ULL; + EXPECT(0 == GetEntryRequired(e)); EXPECT(1 == GetEntryLegacyBoot(e)); EXPECT(1 == GetEntrySuccessful(e)); EXPECT(2 == GetEntryTries(e)); @@ -1198,6 +1209,7 @@ static int EntryAttributeGetSetTest(void) override_priority = 10; e->attrs.whole = 0x0123000000000004ULL; + EXPECT(0 == GetEntryRequired(e)); EXPECT(1 == GetEntryLegacyBoot(e)); EXPECT(1 == GetEntrySuccessful(e)); EXPECT(2 == GetEntryTries(e)); @@ -1207,6 +1219,7 @@ static int EntryAttributeGetSetTest(void) /* Invalid priority */ override_priority = 100; e->attrs.whole = 0x0123000000000004ULL; + EXPECT(0 == GetEntryRequired(e)); EXPECT(1 == GetEntryLegacyBoot(e)); EXPECT(1 == GetEntrySuccessful(e)); EXPECT(2 == GetEntryTries(e)); |