paycheck: Improve minor_version checking.
1) We explicitly catch whether this field is not set. This means we
might fail payloads generated by an old delta_generator, but ensures
that we catch such a failure in current payload generation. Test
logic slightly restructured to reduce duplication.
2) Slight changes to the checker method signature, for better uniformity
with the rest of the code. This also lets us test that we actually
read the minor_version field.
BUG=chromium:508566
TEST=Unit tests (revised)
Change-Id: Ib2d1999964ba892ef778ffc16bd1ca1c7d02bcd5
Reviewed-on: https://chromium-review.googlesource.com/285446
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
diff --git a/scripts/update_payload/test_utils.py b/scripts/update_payload/test_utils.py
index bdd6b3f..4e7881d 100644
--- a/scripts/update_payload/test_utils.py
+++ b/scripts/update_payload/test_utils.py
@@ -208,6 +208,10 @@
_SetMsgField(self.manifest, 'signatures_offset', sigs_offset)
_SetMsgField(self.manifest, 'signatures_size', sigs_size)
+ def SetMinorVersion(self, minor_version):
+ """Set the payload's minor version field."""
+ _SetMsgField(self.manifest, 'minor_version', minor_version)
+
def _WriteHeaderToFile(self, file_obj, manifest_len):
"""Writes a payload heaer to a file."""
# We need to access protected members in Payload for writing the header.