Commit graph

6 commits

Author SHA1 Message Date
Tao Bao
65b94e92be releasetools: Add a common base class for unittests.
All the releasetools unittests extend the common base class of
test_utils.ReleaseToolsTestCase. Define tearDown() in the base class to
do the clean-up works.

Test: `pylint --rcfile=pylintrc test_*.py`
Test: `python -m unittest discover .`
Change-Id: I51775d964ef032dcdf3bb89c55e1a31371cde708
2018-10-11 23:01:09 -07:00
Tao Bao
08c8583aea Analyze unchanged blocks in odex files.
In BBOTA, we generate patches based on _all_ the blocks of a pair of
input files (src and tgt). For security incremental OTAs, one common
pattern is that only a few blocks are changed in odex files (e.g.
headers). We don't really need to stash/patch the unchanged blocks.

This CL analyzes the unchanged blocks in odex files and computes the
diff for the changed blocks only. It reduces the OTA install time by
about 25% to 40% in our experiments, by paying an increase of 5% to 30%
OTA generation time cost.

Bug: 31570716
Test: Generate an incremental and apply on device.

Change-Id: If842c1afeff6894a3d27eb60b7e8f65a179b7977
2016-09-23 12:15:23 -07:00
Tianjie Xu
cd1e16a761 Monotonic flag sets incorrectly in rangelib
After applying update_target_files_incr_ext4.sh, some files may end up
occupying unsorted block fragments. In one example, an apk file has the
block range [258768-259211,196604]. The monotonic flag in rangelib sets
incorrectly for this example and leads to a bad input file for imgdiff.
After fixing the flag, bsdiff is called instead of imgdiff and the
incremental OTA package generates successfully.

Bug:28053885
Change-Id: Ib841bf449ff6a29314fc4a1b8fba941a6dc532ac
2016-04-13 12:36:14 -07:00
Tao Bao
8179d68458 rangelib.py: Add parse_raw() method.
parse_raw() parses a string generated by RangeSet.to_string_raw().

>>> RangeSet.parse_raw(RangeSet("0-9").to_string_raw())
<RangeSet("0-9")>

Change-Id: Ia74daa30476d5e9ad73c368f4ecc64c755b734a5
2016-03-24 11:08:51 -07:00
Tao Bao
e8f756137c rangelib.py: Fix the bug in monotonic check.
RangeSet("2-10").monotonic gives a wrong result of "False". Fix the bug
and add more tests into test_rangelib.py.

Change-Id: I04780571b45ecafd34040f405756b9745a9e21a5
2015-08-26 21:16:43 -07:00
Tao Bao
873a15e267 Add unit tests for rangelib.py.
Separate the test cases in rangelib.py comments into a python unittest
file.

To invoke:
  $ python -m unittest test_rangelib

Change-Id: I59e4ce0aaccc83bcbb42fee15775683dcd559d99
2015-08-26 16:13:18 -07:00