diff options
author | Gilad Arnold <garnold@chromium.org> | 2015-07-13 17:29:21 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-07-17 00:05:51 +0000 |
commit | 0d575cde18a1b44e386181dc1abbc611b9ae7a59 (patch) | |
tree | 5dde485b98dab00b337f49fa3133eee2b594c558 /scripts/update_payload/test_utils.py | |
parent | 0d7a8d4f8ca7a111b6211c8469ce80355810ae28 (diff) |
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>
Diffstat (limited to 'scripts/update_payload/test_utils.py')
-rw-r--r-- | scripts/update_payload/test_utils.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/update_payload/test_utils.py b/scripts/update_payload/test_utils.py index bdd6b3f4..4e7881d3 100644 --- a/scripts/update_payload/test_utils.py +++ b/scripts/update_payload/test_utils.py @@ -208,6 +208,10 @@ class PayloadGenerator(object): _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. |