summaryrefslogtreecommitdiff
path: root/payload_generator/extent_utils_unittest.cc
AgeCommit message (Collapse)Author
2019-01-16update_engine: Run clang-format on payload_generator/Amin Hassani
BUG=none TEST=unittest Change-Id: I00cafb1fc709d8f02119cb0058cfcb0b573ef25d Reviewed-on: https://chromium-review.googlesource.com/1409927 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>
2017-12-12update_engine: Remove the duplicate BlocksInExtentsAmin Hassani
This patch removes the duplicate BlocksInExtents from extent_utils.h and fixes the remainder of the code to reflect this change. BUG=none TEST=unittests pass; Change-Id: I76f5106f75072b20cd8f41f081b2f2b07aeac9a8 Reviewed-on: https://chromium-review.googlesource.com/812009 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> Reviewed-by: Alex Deymo <deymo@google.com> Reviewed-by: Sen Jiang <senj@chromium.org>
2016-02-17Build unittests in Brillo.Alex Deymo
Many unittests do not pass for simple reasons that will be addressed later. This CL includes all the changes to make the unittests build. In particular, the generated DBus mocks, required to build several unittests are now included here. The dbus-constants.h files were moved to the system_api repo, so they can be removed from here. The unittest build is only enabled for Brillo targets, since non-Brillo targets don't even build DBus. Bug: 26955860 TEST=`mmma` on edison-eng (and aosp_arm-eng). Change-Id: Ib38241f0a6eb99b1d60d72db6bcfd125d38e3fad
2015-11-12Split payload application code into a subdirectory.Alex Deymo
This patch splits from the main libupdate_engine code the part that is strictly used to download and apply a payload into a new static library, moving the code to subdirectories. The new library is divided in two subdirectories: common/ and payload_consumer/, and should not depend on other update_engine files outside those two subdirectories. The main difference between those two is that the common/ tools are more generic and not tied to the payload consumer process, but otherwise they are both compiled together. There are still dependencies from the new libpayload_consumer library into the main directory files and DBus generated files. Those will be addressed in follow up CLs. Bug: 25197634 Test: FEATURES=test emerge-link update_engine; `mm` on Brillo. Change-Id: Id8d0204ea573627e6e26ca9ea17b9592ca95bc23
2015-08-19Re-license update_engine to Apache2Alex Deymo
This patch automatically replaced the license on all text files from Chromium OS (BSD style) to AOSP (Apache2), keeping the original year as a reference. The license header was added to .gyp and .gypi files, the NOTICE was replaced with a copy of the Apache2 license and MODULE_LICENSE_* file was updated. BUG=b/23084294 TEST=grep 'Chromium OS Authors' doesn't find anything. Change-Id: Ie5083750755f5180a8a785b24fe67dbf9195cd10
2015-08-15update_engine: Move InstallOperation to the top level.Alex Deymo
The InstallOperation message in the protobuf is a nested message inside the DeltaArchiveManifest message, making all references to operation types be very long names like DeltaArchiveManifest_InstallOperation_Type_REPLACE_BZ while most other messages are not nested in the DeltaArchiveManifest message. To improve readability and to prepare for future update metadata changes, this patch moves the InstallOperation message to the top level and replaces all references to operation types with the new shorter version like InstallOperation::REPLACE_BZ. This change only impacts the scope of the generated classes and the serialized format of the protobuf. This exact same question was addressed by protobuf maintainers here: https://groups.google.com/forum/#!topic/protobuf/azWAPa6hP4A Finally coding style and indentation was automatically updated due to the shorter names. BUG=b:23179128 TEST=Unittest still pass. Change-Id: I55add54265934cd1fd3e9cb786c5d3f784902d17 Reviewed-on: https://chromium-review.googlesource.com/293504 Trybot-Ready: Alex Deymo <deymo@chromium.org> Tested-by: Alex Deymo <deymo@chromium.org> Reviewed-by: Alex Deymo <deymo@chromium.org> Commit-Queue: Alex Deymo <deymo@chromium.org>
2015-07-01update_engine: Split delta_diff_generator file.Alex Deymo
The DeltaDiffGenerator class includes both an OperationsGenerator using the A-to-B operations and a set of common methods used also by the inplace generator. The delta_diff_generator.{h,cc} files also include a single function to generate the payload (GenerateUpdatePayloadFile) that centralizes the logic of generating the operations and writing the payload. This patch splits these three parts in different files. The common delta diff function are moved to the delta_diff_utils.{h,cc} files. The operations generator class that uses A-to-B operations is now in a new ab_generator.{h,cc} pair of files that implement the ABGenerator() class. Finally, the payload file writing methods are now in a single PayloadFile class. This allow us to create payload files without the need to generate images and their deltas. This will be used in a follow up CL to remove the image generation logic from the unittests. BUG=chromium:351589 TEST=Ran unittests. Regenerate a payload with and without this patch; got the same results. Change-Id: I6816d2c805ba8c0c5c9423c720131a100a15ebaa Reviewed-on: https://chromium-review.googlesource.com/280838 Reviewed-by: Alex Deymo <deymo@chromium.org> Commit-Queue: Alex Deymo <deymo@chromium.org> Trybot-Ready: Alex Deymo <deymo@chromium.org> Tested-by: Alex Deymo <deymo@chromium.org>
2015-06-12update_engine: Remove unused IsIdempotentOperation().Alex Deymo
All the minor-version=2 are idempotent, so since we switched to minor version 2, this function becomes trivial now. This patch removes this function from the code and moves the ExtentRanges class to the payload_generator/ directory since now it is only used there. BUG=None TEST=Unittest still pass. Change-Id: Ib9dbbdded0ca2ef2128bb6c470de7a00720c4038 Reviewed-on: https://chromium-review.googlesource.com/275806 Reviewed-by: Alex Deymo <deymo@chromium.org> Tested-by: Alex Deymo <deymo@chromium.org> Commit-Queue: Alex Deymo <deymo@chromium.org>
2015-06-09update_engine: Further move Extent manipulation to extent_utils.Alex Deymo
This patch moves more Extent manipulation functions to extent_utils. It moves NormalizeExtents() and creates a new ExtentsSublist() function that will be used by a follow up CL. BUG=None TEST=Added unittests. Change-Id: Icf0ef0af208aa45c9f44e1a73662b3efd8bbbb45 Reviewed-on: https://chromium-review.googlesource.com/275801 Reviewed-by: Alex Deymo <deymo@chromium.org> Commit-Queue: Alex Deymo <deymo@chromium.org> Tested-by: Alex Deymo <deymo@chromium.org>
2015-06-04update_engine: Split Extent utils from graph_utils.Alex Deymo
"Graph" related utils should only concern parts of the code using the inplace generator, since other generators don't use a dependency graph. This patch splits the Extent related utils from the graph related ones creating a new extent_utils.h file. BUG=None TEST=unittest still pass. Change-Id: I0941698b0a47a6cc222e8dc062fc54eb3cdf4de2 Reviewed-on: https://chromium-review.googlesource.com/274899 Reviewed-by: Gilad Arnold <garnold@chromium.org> Commit-Queue: Alex Deymo <deymo@chromium.org> Tested-by: Alex Deymo <deymo@chromium.org>