cgpt: Handle read errors gracefully
When a read fails in getting the GPT, just zero the contents of the
buffer and carry on.
Some testing changes are required for this. When a read of the GPT
fails, it is no longer fatal, so tests of that have been adjusted.
Tests have been improved to show that the GPT is automatically
repaired when a read error occurs.
There was one test which checked that a zero-sized disk would fail
to load a kernel, but it was surrounded by a number of mocked
functions which normally do that error checking, and it amounted
to the same test as read failure; that test was deleted.
TEST=vboot tests pass
Signed-off-by: Dan Ehrenberg <firstname.lastname@example.org>
Reviewed-by: Randall Spangler <email@example.com>
2 files changed