summaryrefslogtreecommitdiff
path: root/payload_generator/payload_properties_unittest.cc
AgeCommit message (Collapse)Author
2020-11-09Estimate COW image size during OTA generationKelvin Zhang
Estimate COW image size and put the estimation in OTA metadata. Then VAB could use this to allocate disk space and prompt the user if more space required. Test: create an OTA package Change-Id: Iaedafcf39af2d1a4d9cae9cd1a642a3cd3a4815c
2020-10-29update_engine: Fix leaking unit testsAmin Hassani
Some of the unit tests have been leaking temp files because they don't properly unlink them. In this CL, we did some rearrangement of the ScopedTempFile class and moved it into the utils.h (instead of testing only location) so it can be used everywhere and more efficiently. Also added functionality to open an file descriptor too so users don't have to keep a different object for the file descriptor. BUG=b:162766400 TEST=cros_workon_make --board reef --test; Then looked at the /build/reef/tmp directory and no files were leaked. Change-Id: Id64a2923d30f27628120497fdefe16bf65fa3fb0 Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2500772 Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Jae Hoon Kim <kimjae@chromium.org> Commit-Queue: Amin Hassani <ahassani@chromium.org>
2020-09-26Merge "update_engine: Merge remote-tracking branch 'cros/upstream' into ↵Commit Bot
cros/master"
2020-09-24payload_generator: Remove unused attributesVyshu
Some attributes are not used by the client. Removed all instances of of "ignored" and option ttributes from delta generation. Removed all instances of ImageInfo and moved target and source version to paygen_payload. BUG=b:163048638 TEST=FEATURES=test emerge-hatch update_engine TEST=FEATURES=test emerge update_payload TEST=./run_pytest lib/paygen/paygen_payload_lib_unittest.py Change-Id: I9102d37fcf054f2cbeb79e54113925a684de1cfb Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2388163 Reviewed-by: Amin Hassani <ahassani@chromium.org> Tested-by: Vyshu Khota <vyshu@google.com> Commit-Queue: Vyshu Khota <vyshu@google.com>
2020-08-27Add CowMergeOperations as a hint for snapshot writeTianjie
As proposed in http://go/vabc, we want to reduce the cow size for VAB. One nature apporach is to skip writing the idential blocks to snapshot; instead we can read from the souce blocks. Similiar to the non-A/B update schema, we need to compute a sequence for snapshot merge to avoid the read after write problem. If there is a circular dependency, we will omit some blocks in the result sequence to break the cycles. So libsnapshot will write the raw data of these blocks to cow. All extents in the CowMergeOperations are subsets of a particular OTA SOURCE_COPY InstallOperation. Also, these src & ext extents will be contiguous to improve the libsnapshot read performance before merge completes, as well as to simplify the sequence generation. Bug: 162274240 Test: unittest pass, genertes an OTA Change-Id: I12c952593d83a8e34a0a6cff5a2066c9103a0d30
2019-06-27update_engine: Validate payload properties.Jae Hoon Kim
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>