Commit graph

270 commits

Author SHA1 Message Date
Tianjie Xu
e002d96194 Merge "Remove the obsolete package_extract_dir() test" am: e916cca8a9
am: af913974a5

Change-Id: I6afcdb92726231325a7d2e8171e3e2b1b3b940e0
2017-06-23 04:53:56 +00:00
Tianjie Xu
e916cca8a9 Merge "Remove the obsolete package_extract_dir() test" 2017-06-23 04:46:14 +00:00
Tianjie Xu
bb7e005a79 Remove the obsolete package_extract_dir() test
package_extract_dir() was removed in go/aog/402383, and the
corresponding UpdaterTest should be removed as well.

Bug: 62918308
Test: mma && code search
Change-Id: Ibe9c473a5d41d2fa4d26abca5684e71b104891b0
2017-06-22 17:35:06 -07:00
David Zeuthen
0f6a109f14 Merge "update_verifier: Support AVB." am: e248e434ea am: 1f108dae49
am: b0c38f1cce

Change-Id: If4e8be8b8277143cad9447a487a674e39ba5a832
2017-06-22 19:56:37 +00:00
David Zeuthen
b0c38f1cce Merge "update_verifier: Support AVB." am: e248e434ea
am: 1f108dae49

Change-Id: I85544f829783fade5e91cfa1d48013047056924d
2017-06-22 19:26:10 +00:00
Treehugger Robot
e248e434ea Merge "update_verifier: Support AVB." 2017-06-22 19:15:15 +00:00
Tianjie Xu
1905e3665a Merge "kill package_extract_dir" am: 99e7216907 am: 49f9c969eb am: 66e53f59b9
am: d1b65aa645

Change-Id: Idb46742fd2b73e927a14e12dd1b7ae5854e35334
2017-05-31 22:01:19 +00:00
Tianjie Xu
d1b65aa645 Merge "kill package_extract_dir" am: 99e7216907 am: 49f9c969eb
am: 66e53f59b9

Change-Id: Iec9ae5171aaa2d8a0eb92de12b78e65aeb0136a4
2017-05-31 21:59:21 +00:00
David Zeuthen
8ed9738b62 update_verifier: Support AVB.
When using AVB, PRODUCT_SUPPORTS_VERITY is not set so check for
BOARD_ENABLE_AVB as well. Also AVB sets up the root filesystem as
'vroot' so map that to 'system' since this is what is
expected. Managed to test at least that the code is at least compiled
in:

 $ fastboot --set-active=_a
 Setting current slot to 'a'...
 OKAY [  0.023s]
 finished. total time: 0.023s

 $ fastboot reboot
 rebooting...

 finished. total time: 0.050s

 $ adb wait-for-device

 $ adb logcat |grep update_verifier
 03-04 05:28:56.773   630   630 I /system/bin/update_verifier: Started with arg 1: nonencrypted
 03-04 05:28:56.776   630   630 I /system/bin/update_verifier: Booting slot 0: isSlotMarkedSuccessful=0
 03-04 05:28:56.776   630   630 W /system/bin/update_verifier: Failed to open /data/ota_package/care_map.txt: No such file or directory
 03-04 05:28:56.788   630   630 I /system/bin/update_verifier: Marked slot 0 as booted successfully.
 03-04 05:28:56.788   630   630 I /system/bin/update_verifier: Leaving update_verifier.

Bug: None
Test: Manually tested on device using AVB bootloader.
Change-Id: I13c0fe1cc5d0f397e36f5e62fcc05c8dfee5fd85
2017-05-24 14:14:11 -04:00
Tianjie Xu
53c38b1538 kill package_extract_dir
It's only used by file-based OTA which has been deprecated for O.

Test: mma
Change-Id: I439c93155ca94554d827142c99aa6c0845cc7561
2017-05-23 17:09:45 -07:00
Tianjie Xu
f158a7d29e Merge "Print SHA1 of the patch if bsdiff fails with data error" am: 1f9808bd48 am: 8f68accc9d am: 1562f41348
am: 0abe9860d8

Change-Id: Id8d4e4b369f30a33a37ca1895d5dd36eb2bf8aff
2017-05-18 22:25:55 +00:00
Tianjie Xu
0abe9860d8 Merge "Print SHA1 of the patch if bsdiff fails with data error" am: 1f9808bd48 am: 8f68accc9d
am: 1562f41348

Change-Id: I7b605673eb3cee6a615459ca9fe2fc00c532ed9d
2017-05-18 22:20:55 +00:00
Tianjie Xu
ce5fa5e538 Print SHA1 of the patch if bsdiff fails with data error
This will help us to identify the patch corruption.

Meanwhile fix a wrong size parameter passed to bspatch.
(patch->data.size() into patch->data.size() - patch_offset).

Also remove the only usage of "ApplyBSDiffPatchMem()" and inline its
Sink function for simplicity.

Bug: 37855643
Test: Prints SHA1 for corrupted patch in imgdiff_test.
Change-Id: Ibf2db8c08b0ded1409bb7c91a3547a6bf99c601d
2017-05-16 12:39:14 -07:00
Tao Bao
4deb2fb1bd Merge "Add a binary path param to update_binary_command()." am: 197304aada am: f648b5c9fc am: f49c57643d
am: 460e47adfc

Change-Id: I34b789b29f019f730d6c8a7e3a96384a056c1d4a
2017-05-09 00:28:00 +00:00
Tao Bao
460e47adfc Merge "Add a binary path param to update_binary_command()." am: 197304aada am: f648b5c9fc
am: f49c57643d

Change-Id: Iea3496ad9cbcd8389ade9effa7072198cf33a5c3
2017-05-09 00:22:30 +00:00
Tao Bao
00d5757186 Add a binary path param to update_binary_command().
This allows writing native tests for non-A/B update_binary_command().
Prior to this CL, it was extracting the updater to a hard-coded
location (/tmp/update_binary) that's not available under the test
environment.

Test: recovery_component_test on angler and marlin respectively.
Test: Sideload OTA packages on angler and marlin respectively.
Change-Id: I78b9cc211d90c0a16a84e94e339b65759300e2a8
2017-05-08 12:16:45 -07:00
Tao Bao
ab1e70647f Merge "fuse_sideload: Change the minimal block size to 4096." am: 4e8e56eaea am: 53b98de866 am: 6bea344d7e
am: bfca876038

Change-Id: I5d1fa644a867b523553127c8bde92000f4cb539a
2017-05-04 00:11:51 +00:00
Tao Bao
bfca876038 Merge "fuse_sideload: Change the minimal block size to 4096." am: 4e8e56eaea am: 53b98de866
am: 6bea344d7e

Change-Id: If7e905a7630ee8cf142752695272afb8e76c28cb
2017-05-04 00:06:38 +00:00
Tao Bao
4e8e56eaea Merge "fuse_sideload: Change the minimal block size to 4096." 2017-05-03 23:52:34 +00:00
Tao Bao
a616f0d476 Merge "Move sysMapFile and sysReleaseMap into MemMapping class." am: fe7eecff4c am: 08d9ede8f2 am: b3eeb817ab
am: 586377d1f3

Change-Id: I4d2cac061fbf6ac34e9e5125ebd5294dbc33e4ef
2017-05-02 23:54:02 +00:00
Tao Bao
586377d1f3 Merge "Move sysMapFile and sysReleaseMap into MemMapping class." am: fe7eecff4c am: 08d9ede8f2
am: b3eeb817ab

Change-Id: I1bcf86cbbc495bf5df92dc53e01be39e7c623255
2017-05-02 23:51:32 +00:00
Tao Bao
ed13819a0d fuse_sideload: Change the minimal block size to 4096.
run_fuse_sideload() is passing the block size as the max_read
option, so it will only handle a request that involves at most two
blocks at a time. However, the minimal allowed value was set to 1024
prior to this CL, which is inconsistent with the kernel code
(fs/fuse/inode.c) that sets it to the greater of 4096 and the passed-in
max_read option. This would fail the calls with a block size / max_read
less than 4096 due to the wrongly computed block indices.

Note that we didn't observe real issue in practice, because we have been
using 64 KiB block sizes for both of adb and sdcard sideload calls. The
issue only shows up in my local CL (to come later) that uses 1024 block
size in run_fuse_sideload() tests.

Test: recovery_component_test
Test: adb sideload with the new recovery image on angler
Change-Id: Id9f0cfea13d0d193dcb7cd41a1553a23739545f2
2017-05-02 15:56:22 -07:00
Tao Bao
b656a154ea Move sysMapFile and sysReleaseMap into MemMapping class.
Test: recovery_component_test
Test: recovery_unit_test
Test: Apply an OTA on angler.
Change-Id: I7170f03e4ce1fe06184ca1d7bcce0a695f33ac4d
2017-05-01 21:51:54 -07:00
Tao Bao
598679cbad Merge "Separate libupdate_verifier module and add testcases." am: c99bb23955 am: d8c078d2c6 am: c7410924a3
am: 322d866ec8

Change-Id: I58bf1596f7247866e0d9e76c1c7a5ddc1d58024a
2017-04-27 21:41:28 +00:00
Tao Bao
322d866ec8 Merge "Separate libupdate_verifier module and add testcases." am: c99bb23955 am: d8c078d2c6
am: c7410924a3

Change-Id: I452f0a1b5c0377f985294d37d59a19d1272be50d
2017-04-27 21:32:30 +00:00
Tao Bao
83b0780ddd Separate libupdate_verifier module and add testcases.
Enable -Wall and expose verify_image() for testing purpose.

Test: mmma bootable/recovery
Test: recovery_component_test
Change-Id: I1ee1db2a775bafdc1112e25a1bc7194d8d6aee4f
2017-04-27 08:57:23 -07:00
Tao Bao
afd224bf3b Merge "applypatch: Remove the obsolete support for "applypatch -s"." am: d5ae4253c1 am: 22b1fa7d61 am: 7ee4b7dd84
am: 41dc284309

Change-Id: If092d5a6d97e31bef4d2ec19478061c8df4ad792
2017-04-26 17:29:46 +00:00
Tao Bao
41dc284309 Merge "applypatch: Remove the obsolete support for "applypatch -s"." am: d5ae4253c1 am: 22b1fa7d61
am: 7ee4b7dd84

Change-Id: I9f372c9b371f28b70ec6832e66053d3aee5b7c8e
2017-04-26 17:07:44 +00:00
Tao Bao
8ab28082b7 applypatch: Remove the obsolete support for "applypatch -s".
The SpaceMode (applypatch -s) was used in amend script (cupcake) only,
which has been removed since commit
9ce2ebf5d300eba5f6086583b0941ef68a3e4b42 (platform/build). The later
(and current) edify script uses apply_patch_space().

Note that other modes (PatchMode, CheckMode) of applypatch executable
are mostly used by install-recovery.sh script.

Test: No active user of "applypatch -s".
Test: recovery_component_test
Change-Id: I1d689b7fedd3884077e88ed1d6c22f7a2198859d
2017-04-25 21:23:12 -07:00
Tao Bao
f5cb2a11df Merge "Add more tests for verify_package_compatibility()." am: a9dd77fa84 am: 5f85d07e87 am: 54f8988cfe
am: 7b2957ed25

Change-Id: Ia1dbea19d1975348a7dfdcaf803ebb6bf4b99a0a
2017-04-24 19:38:41 +00:00
Tao Bao
4983412270 Merge "tests: Remove obsolete classes in applypatch_test." am: f17aa960db am: 8a3325dc8a am: f4a8d0bba6
am: b35fb1cf7b

Change-Id: Iba385b5435dc8aa4393821f8a72c92c477685f51
2017-04-24 19:38:29 +00:00
Tao Bao
7b2957ed25 Merge "Add more tests for verify_package_compatibility()." am: a9dd77fa84 am: 5f85d07e87
am: 54f8988cfe

Change-Id: I389ced1ec0e90e90e5fbde74f1b0ab5449310ab7
2017-04-24 19:01:28 +00:00
Tao Bao
b35fb1cf7b Merge "tests: Remove obsolete classes in applypatch_test." am: f17aa960db am: 8a3325dc8a
am: f4a8d0bba6

Change-Id: If68b3e47fa75a5d5f2041bdda8a8f4cb84c8880c
2017-04-24 19:01:14 +00:00
Tao Bao
a9dd77fa84 Merge "Add more tests for verify_package_compatibility()." 2017-04-24 18:08:55 +00:00
Tao Bao
0a3e4dca58 tests: Remove obsolete classes in applypatch_test.
ApplyPatchFullTest and ApplyPatchDoubleCacheTest were used for defining
testcases for file-based OTA. The testcases have already been removed by
commit 40e144dae8. This CL removes the
obsolete class defnitions.

Bug: 37559618
Test: recovery_component_test on angler and marlin respectively.
Change-Id: I3f4f1dfc8580cf010365e671de256f68bbc0d99a
2017-04-21 09:52:27 -07:00
Tao Bao
f2784b6a43 Add more tests for verify_package_compatibility().
This now covers the actual calls to libvintf, and asserts we're getting
identical results through verify_package_compatibility() and by calling
libvintf directly.

We were missing the coverage and introduced the double free bug (fixed
by commit f978278995).

Bug: 37413730
Test: recovery_component_test passes.
Test: recovery_component_test fails w/o commit
      f978278995.
Change-Id: If5195ea1c583fd7c440a1de289da82145e80e23c
2017-04-19 17:10:34 -07:00
Tao Bao
b0945e1a23 Merge "Call libvintf to verify package compatibility." 2017-04-20 00:10:09 +00:00
Tao Bao
71df092bf2 Call libvintf to verify package compatibility. am: da320ac6ab
am: 34ae4d02ce

Change-Id: I96580281c3d898b382e9870f3dbc8db218114e27
2017-04-19 22:25:53 +00:00
Tao Bao
34ae4d02ce Call libvintf to verify package compatibility.
am: da320ac6ab

Change-Id: I5749ac56a8eed8c3ce8420360643a4cfe8d52bc7
2017-04-19 22:19:06 +00:00
Tao Bao
919d2c9a53 Call libvintf to verify package compatibility.
The libvintf API has landed. Hook up to do the actual verification.

Bug: 36597505
Test: recovery_component_test
Test: m recoveryimage; adb sideload on angler and sailfish, with
      packages that contain dummy compatibility entries.
Test: m recoveryimage; adb sideload on angler and sailfish, with
      packages that don't contain any compatibility entries.
Change-Id: Idbd6f5aaef605ca51b20e667505d686de5ac781f
(cherry picked from commit da320ac6ab)
2017-04-19 15:17:16 -07:00
Tao Bao
da320ac6ab Call libvintf to verify package compatibility.
The libvintf API has landed. Hook up to do the actual verification.

Bug: 36597505
Test: recovery_component_test
Test: m recoveryimage; adb sideload on angler and sailfish, with
      packages that contain dummy compatibility entries.
Test: m recoveryimage; adb sideload on angler and sailfish, with
      packages that don't contain any compatibility entries.
Change-Id: Idbd6f5aaef605ca51b20e667505d686de5ac781f
2017-04-19 13:04:57 -07:00
Tao Bao
0ae77823f4 Merge "Add tests for read_metadata_from_package()." am: e888d45950 am: c08c055ce0 am: 7b9b77f445
am: 67045afa85

Change-Id: I449c52d75ee821293e57878eda5b95782912d429
2017-04-19 19:03:23 +00:00
Tao Bao
67045afa85 Merge "Add tests for read_metadata_from_package()." am: e888d45950 am: c08c055ce0
am: 7b9b77f445

Change-Id: I9e3563e052ce1b993981af29c8af9fd4ab4f3516
2017-04-19 18:58:52 +00:00
Tao Bao
8a7afcc6ed Add tests for read_metadata_from_package().
Test: recovery_component_test
Change-Id: I672a6a4f101c72e82b9f25f165dccd1c9520627b
2017-04-18 22:07:44 -07:00
Tao Bao
a233a89d99 Add tests for update_binary_command().
Expose update_binary_command() through private/install.h for testing
purpose.

Also make minor clean-ups to install.cpp: a) adding more verbose logging
on ExtractToMemory failures; b) update_binary_command() taking
std::string instead of const char*; c) moving a few macro and global
constants into update_binary_command().

Bug: 37300957
Test: recovery_component_test on marlin
Test: Build new recovery and adb sideload on angler and sailfish.
Change-Id: Ib2d9068af3fee038f01c90940ccaeb0a7da374fc
Merged-In: Ib2d9068af3fee038f01c90940ccaeb0a7da374fc
(cherry picked from commit bc4b1fe4c4)
2017-04-18 20:35:29 -07:00
Tao Bao
9c5ae7445f Merge "Add tests for update_binary_command()." am: 44f61b4ce5 am: 1fc109bdc7 am: d218dca8f9
am: c6bb44e9bf

Change-Id: I42f53d3d48caf913fa8d4ba2eba475e20c8b65f9
2017-04-19 01:54:22 +00:00
Tao Bao
c6bb44e9bf Merge "Add tests for update_binary_command()." am: 44f61b4ce5 am: 1fc109bdc7
am: d218dca8f9

Change-Id: Ib8520d3249f3c131be5008324c52e4b94cf8426d
2017-04-19 01:52:22 +00:00
Tao Bao
bc4b1fe4c4 Add tests for update_binary_command().
Expose update_binary_command() through private/install.h for testing
purpose.

Also make minor clean-ups to install.cpp: a) adding more verbose logging
on ExtractToMemory failures; b) update_binary_command() taking
std::string instead of const char*; c) moving a few macro and global
constants into update_binary_command().

Bug: 37300957
Test: recovery_component_test on marlin
Test: Build new recovery and adb sideload on angler and sailfish.
Change-Id: Ib2d9068af3fee038f01c90940ccaeb0a7da374fc
2017-04-17 20:44:37 -07:00
Tao Bao
1d866050eb Verify the package compatibility with libvintf.
verify_package_compatibility() is added to parse the compatibility entry
(compatibility.zip) in a given OTA package. If entry is present, the
information is sent to libvintf to check the compatibility.

This CL doesn't actually call libvintf, since the API there is not
available yet.

Bug: 36597505
Test: Doesn't break the install with existing packages (i.e. w/o the
      compatibility entry).
Test: recovery_component_test
Change-Id: I3903ffa5f6ba33a5c0d761602ade6290c6752596
(cherry picked from commit 62e0bc7586)
2017-04-12 22:46:09 -07:00
Tao Bao
a6004b6dcb Verify the package compatibility with libvintf. am: 62e0bc7586
am: 33ebf7bea4

Change-Id: I9799279177b4b0c98b6a198a7544da224cda72b0
2017-04-13 00:26:50 +00:00
Tao Bao
33ebf7bea4 Verify the package compatibility with libvintf.
am: 62e0bc7586

Change-Id: I35383abfd52766070df0de00013ec743dea190c7
2017-04-13 00:16:19 +00:00
Tao Bao
62e0bc7586 Verify the package compatibility with libvintf.
verify_package_compatibility() is added to parse the compatibility entry
(compatibility.zip) in a given OTA package. If entry is present, the
information is sent to libvintf to check the compatibility.

This CL doesn't actually call libvintf, since the API there is not
available yet.

Bug: 36597505
Test: Doesn't break the install with existing packages (i.e. w/o the
      compatibility entry).
Test: recovery_component_test
Change-Id: I3903ffa5f6ba33a5c0d761602ade6290c6752596
2017-04-12 14:52:00 -07:00
Tianjie Xu
3cdd467f17 Merge "Abort the update if there's not enough new data" am: b4b0c49c48 am: bc66528cb9 am: 955c5ebece
am: 3bd7aaf871

Change-Id: I015ba8d71c6aea95647b01b4c61a7c28d153fbda
2017-04-10 18:37:25 +00:00
Tianjie Xu
3bd7aaf871 Merge "Abort the update if there's not enough new data" am: b4b0c49c48 am: bc66528cb9
am: 955c5ebece

Change-Id: I65b6699cc653192b3b8cbcb88093abd1a0e44ba1
2017-04-10 18:32:54 +00:00
Tianjie Xu
3a8d98dd90 Abort the update if there's not enough new data
Right now the update stuck in a deadlock if there's less new data than
expection. Add some checkers and abort the update if such case happens.
Also add a corresponding test.

Bug: 36787146
Test: update aborts correctly on bullhead && recovery_component_test passes
Change-Id: I914e4a2a4cf157b99ef2fc65bd21c6981e38ca47
2017-04-07 17:19:46 -07:00
Tao Bao
58847a109a Merge "tests: Use get_bootloader_message_blk_device() to find /misc." am: 3cd630a5a8 am: cc630bdde1 am: f25cd871cc
am: 8ce8affee8

Change-Id: I6501442dc37ef8db52a0bcd75c0475636f157d52
2017-04-05 15:54:07 +00:00
Tao Bao
8ce8affee8 Merge "tests: Use get_bootloader_message_blk_device() to find /misc." am: 3cd630a5a8 am: cc630bdde1
am: f25cd871cc

Change-Id: I7ee75869ea3b80548c25e5f96d0906c1e8d88862
2017-04-05 15:51:36 +00:00
Tao Bao
ad87d9dc78 tests: Use get_bootloader_message_blk_device() to find /misc.
Since commit fb00d82f32 has added
get_bootloader_message_blk_device() as an API, switch the tests-local
implementation to it.

Test: recovery_component_test on angler.
Test: recovery_component_test on a local build that doesn't have /misc.
Change-Id: I4f5f542cb9ef58292c587a677da73d8822db7262
2017-04-04 20:35:10 -07:00
Tao Bao
c2b3d700b4 Merge "Change the internal representation in RangeSet." am: 7ffa8be41d am: 2e12242b7a am: 7f4e5d55f4
am: b126a2cd9a

Change-Id: Iabb1641aec17d535d740ae1275351e7befdf1432
2017-04-04 22:07:51 +00:00
Tao Bao
b126a2cd9a Merge "Change the internal representation in RangeSet." am: 7ffa8be41d am: 2e12242b7a
am: 7f4e5d55f4

Change-Id: Ie48c858013808b1ccbe19b68e236b6bf18471da8
2017-04-04 21:57:57 +00:00
Tao Bao
bf5b77dbf7 Change the internal representation in RangeSet.
This CL makes the following changes to RangeSet:
 - Uses std::pair<size_t, size_t> to represent a Range;
 - Uses std::vector<Range> to represent a RangeSet;
 - Provides const iterators (forward and reverse);
 - Provides const accessor;
 - 'blocks()' returns the number of blocks (formerly 'size');
 - 'size()' returns the number of Range's (formerly 'count').

Test: recovery_unit_test
Test: Apply an incremental update with the new updater.
Change-Id: Ia1fbb343370a152e1f7aa050cf914c2da09b1396
2017-04-03 09:22:48 -07:00
Tao Bao
45c5ba309e Merge "Move parse_range() and range_overlaps() into RangeSet." am: 8fab8f97b7 am: 74c4da4c01 am: 3cf1113021
am: 1980075fa9

Change-Id: Ife54e7b7235c4f81c8f01d8c5554cd278b350c6e
2017-03-31 19:32:55 +00:00
Tao Bao
1980075fa9 Merge "Move parse_range() and range_overlaps() into RangeSet." am: 8fab8f97b7 am: 74c4da4c01
am: 3cf1113021

Change-Id: I297d6d7d5bb266cddc11e76216e064ea3ad1529e
2017-03-31 19:30:25 +00:00
Tao Bao
8f23757ad4 Move parse_range() and range_overlaps() into RangeSet.
Also move RangeSet into a header file to make it testable, and add unit
tests.

In RangeSet::Parse() (the former parse_range()), use libbase logging to
do assertions. This has the same effect as the previous
exit(EXIT_FAILURE) to terminate the updater process and abort an update.
The difference lies in the exit status code (i.e. WEXITSTATUS(status) in
install.cpp), which changes from 1 (i.e. EXIT_FAILURE) to 0.

Test: recovery_unit_test
Test: Apply an incremental update with the new updater.
Change-Id: Ie8393c78b0d8ae0fd5f0ca0646d871308d71fff0
2017-03-31 00:04:56 -07:00
Tao Bao
1671d317f0 Merge "tests: Remove LOCAL_ADDITIONAL_DEPENDENCIES." am: 3f0a3a2b1d am: b648a8781f am: 4d6f904a88
am: 25546af375

Change-Id: Ibe08bac8d4197947db6535ea5900a30c416fe0c5
2017-03-30 17:59:51 +00:00
Tao Bao
25546af375 Merge "tests: Remove LOCAL_ADDITIONAL_DEPENDENCIES." am: 3f0a3a2b1d am: b648a8781f
am: 4d6f904a88

Change-Id: Ib0e503efca67d3abcb964c5c9cc6bf6c60d0a0fc
2017-03-30 17:57:21 +00:00
Dan Shi
0253952942 Merge "Add test config to minadbd_test" am: df1a585504 am: b8f33fdf5f am: 57bb313b1e
am: c0e6475f68

Change-Id: Iaba7e4e7e62b4e735fd5b71531a2a36bab11428d
2017-03-30 15:51:43 +00:00
Dan Shi
c0e6475f68 Merge "Add test config to minadbd_test" am: df1a585504 am: b8f33fdf5f
am: 57bb313b1e

Change-Id: I3e9aaedf23d1f3bfbeac9c7afee97993fa14422e
2017-03-30 15:49:43 +00:00
Tao Bao
31b6bc5ced tests: Remove LOCAL_ADDITIONAL_DEPENDENCIES.
Per the comment in build/make/core/base_rules.mk:
  Ninja has an implicit dependency on the command being run, and kati will
  regenerate the ninja manifest if any read makefile changes, so there is no
  need to have dependencies on makefiles.

Test: mmma bootable/recovery
Change-Id: I27b97df10d40f39ad966be70b33811175a665439
2017-03-30 08:43:47 -07:00
Treehugger Robot
df1a585504 Merge "Add test config to minadbd_test" 2017-03-30 15:39:21 +00:00
Dan Shi
7368316de1 Add test config to minadbd_test
Design doc:
Generalized Suites & the Unification of APCT & CTS Workflows Design/Roadmap
https://docs.google.com/document/d/1eabK3srlBLouMiBMrNP3xJPiRRdcoCquNxC8gBWPvx8/edit#heading=h.78vup5eivwzo

Details about test configs changes are tracked in doc
https://docs.google.com/document/d/1EWUjJ7fjy8ge_Nk0YQbFdRp8DSHo3z6GU0R8jLgrAcw/edit#

Bug: 35882476
Test: local test
Change-Id: I51e1b410536469d254ae7a353bc61a7df06c8324
2017-03-28 22:13:38 -07:00
Tao Bao
28b79f797c Fix the bad merge (duplicate tests).
Test: mmma bootable/recovery
Change-Id: I909164fed84fb17a7e1cb2427cb88208a69dc052
2017-03-28 19:07:12 -07:00
Tao Bao
fa617cdf97 resolve merge conflicts of 39ef2d7f to oc-dev-plus-aosp
am: 8fdce9ab99

Change-Id: Ifcd2c3236d337216adabb5bb810befd33f05f44c
2017-03-29 01:14:51 +00:00
Tao Bao
8fdce9ab99 resolve merge conflicts of 39ef2d7f to oc-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I59d27cec1ef2c6befe824848cdc9ef3b0a0dc586
2017-03-28 17:58:31 -07:00
Tao Bao
3f2d35522a Merge "tests: Construct two bad packages at runtime for VerifierTest." 2017-03-29 00:37:05 +00:00
Tao Bao
dcf94dd14c Merge "tests: Add a test for --wipe_ab into UncryptTest." am: 7b0cda5b37 am: c6df7d2937 am: 62a4e5ca98
am: 20e4e73caa

Change-Id: Ib58d2e7843c6cbe75695b83651e3dcd2f9d94f9a
2017-03-28 22:39:39 +00:00
Tao Bao
20e4e73caa Merge "tests: Add a test for --wipe_ab into UncryptTest." am: 7b0cda5b37 am: c6df7d2937
am: 62a4e5ca98

Change-Id: I87b66da50364c0effdfdd5dbe8a7d0496152e68b
2017-03-28 22:34:39 +00:00
Tianjie Xu
0a599567ce Merge "Add the missing sr-Latn into png files and rename the png locale header" am: 713d915636 am: dc235b5ab9
am: 5ec12126f0

Change-Id: Ia6b861c91958d3be23a4a7456d6d5d8e4a1607c8
(cherry picked from commit 9166f66eee)
2017-03-28 22:23:40 +00:00
Tao Bao
7b0cda5b37 Merge "tests: Add a test for --wipe_ab into UncryptTest." 2017-03-28 22:12:35 +00:00
Tao Bao
2eb5d10846 Merge "tests: Construct two bad packages at runtime for VerifierTest." 2017-03-28 21:18:13 +00:00
Tianjie Xu
9166f66eee Merge "Add the missing sr-Latn into png files and rename the png locale header" am: 713d915636 am: dc235b5ab9
am: 5ec12126f0

Change-Id: Ia6b861c91958d3be23a4a7456d6d5d8e4a1607c8
2017-03-28 20:11:15 +00:00
Tianjie Xu
713d915636 Merge "Add the missing sr-Latn into png files and rename the png locale header" 2017-03-28 19:42:54 +00:00
Tao Bao
e003a97668 Merge changes from topic 'sinkfn' am: 34df98ee6d am: 862b7e8523
am: a2015e0d86

Change-Id: I55bd4c762033cbfd68b019c3fad861ff9b954450
2017-03-28 19:21:34 +00:00
Tao Bao
b5f84ef1c3 applypatch: Change the ssize_t length parameters to size_t. am: f7eb760fe7 am: d4d9ef3941
am: 52569ce2ed

Change-Id: Ifeeb537d59d93acac445a0c748e4180a9704fcfb
2017-03-28 19:21:31 +00:00
Tao Bao
bdc8c1a264 tests: Add a test for --wipe_ab into UncryptTest.
Also factor out the common parts in {setup,clear}_bcb into a separate
function.

Test: recovery_component_test
Change-Id: I7b95cced925c8135e020dcb791ca2425d4f28449
2017-03-28 10:55:02 -07:00
Tao Bao
c0e1c46a70 applypatch: Let Apply{BSDiff,Image}Patch accept std::function.
Test: mmma bootable/recovery system/update_engine
Test: recovery_component_test
Change-Id: I93c2caa87bf94a53509bb37f98f2c02bcadb6f5c
2017-03-28 10:14:53 -07:00
Tao Bao
f7eb760fe7 applypatch: Change the ssize_t length parameters to size_t.
Mostly for applypatch family APIs like ApplyBSDiffPatch() and
ApplyImagePatch(). Changing to size_t doesn't indicate they would
necessarily work with very large size_t (e.g. > ssize_t), just
similar to write(2). But otherwise accepting negative length doesn't
make much sense.

Also change the return type of SinkFn from ssize_t to size_t. Callers
tell a successful sink by comparing the number of written bytes against
the desired value. Negative return values like -1 are not needed. This
also makes it consistent with bsdiff::bspatch interface.

Test: recovery_component_test
Test: Apply an incremental with the new updater.
Change-Id: I7ff1615203a5c9854134f75d019e266f4ea6e714
2017-03-28 10:13:38 -07:00
Tao Bao
7e61c6a862 tests: Construct two bad packages at runtime for VerifierTest.
For the BadPackage tests from VerifierTest: one alters the footer, and
the other alters the metadata. Move the two tests to be based on
otasigned_v3.zip (they're based on otasigned_v1.zip previously). Also
construct the testdata files dynamically (to save the space and for
better readability).

Test: recovery_component_test
Change-Id: I7604d563f8b4fa0c55fec8730c063384158e3abc
(cherry picked from commit 217d9f9859)
2017-03-27 16:13:01 -07:00
Tao Bao
217d9f9859 tests: Construct two bad packages at runtime for VerifierTest.
For the BadPackage tests from VerifierTest: one alters the footer, and
the other alters the metadata. Move the two tests to be based on
otasigned_v3.zip (they're based on otasigned_v1.zip previously). Also
construct the testdata files dynamically (to save the space and for
better readability).

Test: recovery_component_test
Change-Id: I7604d563f8b4fa0c55fec8730c063384158e3abc
2017-03-27 16:10:11 -07:00
Tao Bao
056e2da679 tests: Construct signature-boundary.zip at runtime.
Test: Observe the same failure with recovery_component_test ("signature
      start: 65535 is larger than comment size: 0").
Change-Id: I98c357b5df2fa4caa9d8eed63af2e945ed99f18a
2017-03-26 23:34:13 -07:00
Tao Bao
e55215ffd5 Merge "applypatch: Drop the support for patching non-EMMC targets." am: b4c4f8c494 am: 351f69e64a
am: dcbabd5932

Change-Id: Ia8ff537f0c503fec5602ae6ad6677c8b427d0806
2017-03-26 18:08:40 +00:00
Tao Bao
b4c4f8c494 Merge "applypatch: Drop the support for patching non-EMMC targets." 2017-03-26 18:00:20 +00:00
Tianjie Xu
2078b22e41 Add the missing sr-Latn into png files and rename the png locale header
Switch the locale header in the png files from Locale.toString() to
Locale.toLanguageTag(). For example, en_US --> en-us and sr__#Latn
--> sr-Latn. Also clean up recovery a bit to expect the new locale
format.

Bug: 35215015
Test: sr-Latn shows correctly under graphic tests && recovery tests pass
Change-Id: Ic62bab7756cdc6e5f98f26076f7c2dd046f811db
2017-03-24 16:54:52 -07:00
Tao Bao
951a61b9a8 Merge "updater: Fix the broken case for apply_patch_check()." am: 9f2062657d am: 923d41ccd5
am: 47ee8fa42a

Change-Id: I24a2b7776779a61f786fae0cbe5dd9569250ff7b
2017-03-23 17:15:42 +00:00
Tao Bao
db56eb073e updater: Fix the broken case for apply_patch_check().
It's valid to provide only 1 argument to apply_patch_check(). We
shouldn't fail the argument parsing.

Bug: 36541737
Test: recovery_component_test passes.
Test: recovery_component_test captures the failure without the fix.
Test: The previously failed update applies successfully.
Change-Id: Iee4c54ed33b877fc4885945b085341ec5c64f663
2017-03-23 06:52:45 -07:00
Tianjie Xu
5e1a2dc522 Merge "Remove malloc in edify functions" am: 1ea869b0c6 am: 137d85333e
am: eb0623b14b

Change-Id: I7c48105d9259b1713e8be5fb2c50ef8d6a92c993
2017-03-23 00:45:51 +00:00
Tianjie Xu
c444732540 Remove malloc in edify functions
And switch them to std::vector & std::unique_ptr

Bug: 32117870
Test: recovery tests passed on sailfish
Change-Id: I5a45951c4bdf895be311d6d760e52e7a1b0798c3
2017-03-22 14:20:57 -07:00
Tao Bao
a309fec8af Merge "Refactor asn1_decoder functions into a class." am: ea3d0b923d am: d7846b7303
am: 6e30101834

Change-Id: I4ac855fe7b33e4b1141c601045ecf79a681c60cf
2017-03-22 17:11:14 +00:00
Tao Bao
861c53c6c5 Refactor asn1_decoder functions into a class.
Test: mmma bootable/recovery
Test: recovery_unit_test passes.
Test: recovery_component_test passes.
Change-Id: If0bf25993158eaebeedff55ba4f4dd0f6e5f937d
2017-03-21 15:17:43 -07:00
Tao Bao
9d9f310f4e Merge "verify_file: Add constness to a few addresses." am: 5b2bf90e13 am: 43bd2c8414
am: 1c456cd3a5

Change-Id: I6d423a2fe19727e0d41b083a4020be30ae9400fb
2017-03-21 19:16:39 +00:00