update_engine: Validate payload properties.
Add in unit tests to validate payload properties for JSON and KeyValue
string generation. The JSON properties string should have valid
corresponding "sha256_hex" based on the hash of the entire payload file.
The KeyValue properties string should have valid corresponding payload
and metadata hashes based on payload file size and metadata size
respectively.
BUG=None
TEST=unittests
Change-Id: I0399f420d8ee3dc1e4a103841046b91a0319cdb3
Reviewed-on: https://chromium-review.googlesource.com/1669812
Tested-by: Jae Hoon Kim <kimjae@chromium.org>
Commit-Ready: Jae Hoon Kim <kimjae@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 2ee0b9e..f2bddc9 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -498,6 +498,7 @@
"payload_generator/mapfile_filesystem_unittest.cc",
"payload_generator/payload_file_unittest.cc",
"payload_generator/payload_generation_config_unittest.cc",
+ "payload_generator/payload_properties_unittest.cc",
"payload_generator/payload_signer_unittest.cc",
"payload_generator/squashfs_filesystem_unittest.cc",
"payload_generator/tarjan_unittest.cc",