summaryrefslogtreecommitdiffstats
path: root/tests/Android.mk (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-03-18Remove the dead #include's in verifier.cpp.Tao Bao1-1/+0
A follow-up to commit 5e535014dd7961fbf812abeaa27f3339775031f1. Also clean up Android.mk, since libverifier no longer needs anything from libminui. Test: mmma bootable/recovery Test: recovery_component_test passes. Change-Id: I1c11e4bbeef67ca34a2054debf1f5b280d509217
2017-03-17Add a test to perform block_image_updateTianjie Xu1-1/+8
Add the following tests: stash src bspatch stashed_src tgt free stashed_src (expected a successful update) stash src free stashed_src fail_the_update (expected stashed_src freed) Bug: 36242722 Test: Test identified unfreed stashes correctly. Change-Id: I5a136e8dc31774367972fbfe8c63cbc1ddb3a113
2017-03-07Refractor the code for imgdiffTianjie Xu1-0/+1
Put ImageChunk and some helper functions into a class. Also switch to using std::vector instead of malloc. Bug: 18606652 Test: imgdiff_test passed on host. Also generate a complete incremental OTA package. The file content is the same and time consumption is similar. Change-Id: Id603ada4e130ef521218400761a119001a86ca79
2017-03-03Recovery Test: add SideloadTest to test FUSE support on targetWei Wang1-0/+1
FUSE FS is required in recovery sideload functionalites. This CL is to add a native test to flag when FUSE is not supported in the device kernel. Bug: 35768196 Test: mma, run recovery_component_test on marlin and pass all Change-Id: I43b6dbee658010df56ba4d4b0e91baa7fd1c4480
2017-02-02Use bspatch from external/bsdiff.Sen Jiang1-0/+2
Now ApplyBSDiffPatch() will stream the output to sink as we go instead of sinking everything at the end. Test: recovery_host_test Bug: 26982501 Change-Id: I05b6ed40d45e4b1b19ae72784cf705b731b976e3
2017-01-24Remove '_static' suffix from libext2* references.Alex Deymo1-1/+1
Bug: 34220783 Test: make checkbuild Change-Id: Iceea20e440a4bb6a3b254486a65a86401a2241ef
2017-01-19Add checkers and tests for empty locale in PNG fileTianjie Xu1-2/+26
match_locale() will return false for empty locale string in the PNG file. Also add a manual test to validate if a PNG file is qualified to use under recovery. Bug: 34054052 Test: recovery_manual_test catches invalid PNG files successfully & Locale_test passed Change-Id: Id7e2136e1d8abf20da15825aa7901effbced8b03
2017-01-11Remove "_static" suffix from libsparseAlex Deymo1-1/+1
Bug: 34220783 Change-Id: I358f931f0b29f5bd526e1475180e477e2e90b936
2017-01-11Remove "_static" suffix from libext4_utils.Alex Deymo1-1/+1
Bug: 34220783 Change-Id: I34ccc3b11da0d1b48805967ad75b9ddade569930
2016-12-22tests: Add test coverage for DirUtil.Tao Bao1-0/+1
Test: recovery_unit_test passes. Change-Id: I764c56404c7ccdd57ae5486c946fbc9ac6ae7bc9
2016-12-22tests: Add testcase for ZipUtil.Tao Bao1-1/+2
Test: recovery_unit_test passes. Change-Id: I8ad364e88aaee31579ed7206aad8e5620518d797
2016-12-20Add tests for imgdiff.Tao Bao1-0/+29
Factor out libimgdiff static library for testing purpose. This CL adds the imgdiff tests on host and on target both (similar to libimgpatch). In practice, we only need imgdiff binary on host, and libimgpatch on target. But they should build and pass tests on both platforms. Test: recovery_host_test passes; recovery_component_test passes. Change-Id: I0eafb7faf727cdf70066310e845af6ee245d4f60
2016-12-15tests: Add tests for bootloader_message.Tao Bao1-0/+1
Test: recovery_component_test passes. Change-Id: Ib9aa2ffd6b018546223c76b7424f4ba355f5b088
2016-12-14Add tests for setup-bcb and clear-bcb via uncrypt.Tao Bao1-0/+2
Bug: http://b/33534933 Test: recovery_component_test passes (and fails on buggy build due to the CL in [1]). [1]: commit 7e31f421a514da09b90e46dbd642a5e9b16e0003 Change-Id: I120498048ec1db8f9fcbb3cf135c05d3a48cfcdf
2016-11-18updater: Refactor set_stage() and get_stage() functions.Tao Bao1-0/+2
Add read_bootloader_message_from() and write_bootloader_message_to() to allow specifying the BCB device (/misc). Also add testcases for set_stage() and get_stage(). Test: recovery_component_test passes. Test: Build a recovery image and apply a two-step OTA package. Change-Id: If5ab06a1aaaea168d2a9e5dd63c07c0a3190e4ae
2016-11-15updater: Fix the wrong return value for package_extract_file().Tao Bao1-0/+2
'bool success = ExtractEntryToFile()' gives opposite result. Fix the issue and add testcases. Change the one-argument version of package_extract_file() to explicitly abort for non-existent zip entry. Note that this is NOT changing the behavior. Prior to this CL, it aborts from Evaluate() function, by giving a general cause code. Now it returns kPackageExtractFileFailure. BUg: 32903624 Test: recovery_component_test works. Change-Id: I7a273e9c0d9aaaf8c472b2c778f7b8d90362c24f
2016-11-08Move recovery_test.cpp out of unit testTianjie Xu1-1/+12
Move recovery-refresh/persist tests out because these tests need special steps to run. Also switch the constants to std::string. Test: recovery_manual_test passed on an A/B device Change-Id: I60b3ec6f094044945c3aafc1fae540896a6ddea6
2016-11-07otautil: Clean up SysUtil.cpp.Tao Bao1-6/+7
Add unit testcases for sysMapFile(). Test: recovery_unit_test passes. Test: Build and use the new recovery image to sideload a package. Test: Build and use the new recovery image to install an update. Change-Id: I77d8f1ea151ab513865d992c256ba93a1fcb51a4
2016-11-03tests: Set up testdata path for continuous native tests.Tao Bao1-9/+12
continuous_native_tests expects the testdata under DATA/ in continuous_native_tests.zip. This CL packs a copy of the testdata into continuous_native_tests.zip as DATA/nativetest/recovery/testdata (via LOCAL_PICKUP_FILES). This CL also removes the extra copy for nativetest64. Testdata will always stay at /data/nativetest/recovery/testdata, even for 64-bit version. Otherwise we will unnecessarily get four copies (two for data/ and another two for DATA/). Bug: 32123241 Test: mmma bootable/recovery && adb sync data. On bullhead, /data/nativetest/recovery_component_test/recovery_component_test works; /data/nativetest64/recovery_component_test/recovery_component_test works. Test: m continuous_native_test; DATA/nativetest/recovery/testdata exists. Change-Id: Ifefa0309de7af23c77654e8e450848ca2da218c2
2016-11-01applypatch: Add testcases for applypatch executable.Tao Bao1-1/+2
Refactor applypatch/main.cpp into libapplypatch_modes so that we can add testcases. Some changes to applypatch/main.cpp: - Replace char** argv with const char**; - Use android::base::Split() to split ":"; - Use android::base::ParseUInt(). Bug: 32383590 Test: Unit tests pass, install-recovery.sh works. Change-Id: I44e7bfa5ab717d439ea1d0ee9ddb7b2c40bb95a4
2016-10-26tests: Generate testdata for 2nd arch.Tao Bao1-1/+12
We currently only copy the testdata to $(TARGET_OUT_DATA_NATIVE_TESTS)/recovery, which fails the tests generated for 2nd arch (TARGET_2ND_ARCH). For example, on angler /data/nativetest/recovery_component_test/recovery_component_test fails due to missing testdata. Bug: 32123241 Test: Both of /data/nativetest/recovery... and /data/nativetest64/recovery... work on angler. Change-Id: Ib76264b4408d01c08b2619c8ac84b2476ea5a8bc
2016-10-18Replace minzip with libziparchiveTianjie Xu1-2/+9
Clean up the duplicated codes that handle the zip files in bootable/recovery; and rename the library of the remaining utility functions to libotautil. Test: Update package installed successfully on angler. Bug: 19472796 Change-Id: Iea8962fcf3004473cb0322b6bb3a9ea3ca7f679e
2016-10-11Refactor libupdater into a seperate module.Tao Bao1-6/+22
So that we can write native tests for updater functions. This CL adds a testcase for getprop() function. Test: mmma bootable/recovery; Run recovery_component_test on device. Change-Id: Iff4c1ff63c5c71aded2f9686fed6b71cc298c228
2016-10-04edify: Move the testcases to gtest.Tao Bao1-0/+2
Now they live in tests/component/edify_test.cpp. Also rename edify/main.cpp to edify/edify_parser.cpp. It becomes a host-side debugging tool that validates the input edify script. However, it supports edify builtin functions only and doesn't recognize the ones defined via updater. Test: recovery_component_test passes on device. Change-Id: Ib94a787bf15098a9cc078d256b6a6dc96ff12b2e
2016-09-30Turn on -Werror for recoveryTianjie Xu1-1/+2
Also remove the 0xff comparison when validating the bootloader message fields. As the fields won't be erased to 0xff after we remove the MTD support. Bug: 28202046 Test: The recovery folder compiles for aosp_x86-eng Change-Id: Ibb30ea1b2b28676fb08c7e92a1e5f7b6ef3247ab (cherry picked from commit 7aa88748f6ec4e53333d1a15747bc44826ccc410)
2016-09-30Turn on -Werror for recoveryTianjie Xu1-1/+2
Also remove the 0xff comparison when validating the bootloader message fields. As the fields won't be erased to 0xff after we remove the MTD support. Bug: 28202046 Test: The recovery folder compiles for aosp_x86-eng Change-Id: Ibb30ea1b2b28676fb08c7e92a1e5f7b6ef3247ab
2016-09-01Switch recovery to libbase loggingTianjie Xu1-2/+3
Clean up the recovery image and switch to libbase logging. Bug: 28191554 Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35 (cherry picked from commit 747781433fb01f745529c7e9dd97c5599070ad0d)
2016-09-01Switch recovery to libbase loggingTianjie Xu1-2/+3
Clean up the recovery image and switch to libbase logging. Bug: 28191554 Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35 Merged-In: Icd999c3cc832f0639f204b5c36cea8afe303ad35
2016-08-06Fix references to libcrypto_utils_static.Josh Gao1-2/+2
Bug: http://b/30708454 Change-Id: I7a5048beff1d8b783a9683dcb4a79606a77f20ee
2016-06-16tests: Remove obsolete MTD support.Tao Bao1-1/+0
Track the change in commit 63a319201fc0f5c34c1c62b446527e06f57f8d40 and fix builds. Bug: http://b/29250988 Change-Id: Iad5be953e102020931649629afc980d585ed2931 (cherry picked from commit ab2fb94bf48483d761ba3aa85e0acf851895566f)
2016-06-16tests: Remove obsolete MTD support.Tao Bao1-1/+0
Track the change in commit 63a319201fc0f5c34c1c62b446527e06f57f8d40 and fix builds. Bug: http://b/29250988 Change-Id: Iad5be953e102020931649629afc980d585ed2931
2016-04-20Fix matches_locale functionTianjie Xu1-1/+5
matches_locale was expecting input locale string to have at most one underscore; as a result "zh_CN_#Hans" ignores "zh_CN" and matches into "zh". Fix the match function and add unit tests. Bug: 27837319 Change-Id: I4e8a66f91cae6ac2a46b6bf21f670d5ea564c7c8
2016-04-14Use BoringSSL instead of mincrypt to speed up package verification.Elliott Hughes1-1/+0
This changes the verification code in bootable/recovery to use BoringSSL instead of mincrypt. Cherry-pick of 452df6d99c81c4eeee3d2c7b2171901e8b7bc54a, with merge conflict resolution, extra logging in verifier.cpp, and an increase in the hash chunk size from 4KiB to 1MiB. Bug: http://b/28135231 Change-Id: I1ed7efd52223dd6f6a4629cad187cbc383d5aa84
2016-04-06Convert recovery to use BoringSSL instead of mincrypt.Mattias Nissler1-1/+2
This changes the verification code in bootable/recovery to use BoringSSL instead of mincrypt. Change-Id: I37b37d84b22e81c32ac180cd1240c02150ddf3a7
2016-03-31recovery: use __android_log_pmsg_file_write for log filesMark Salyzyn1-0/+2
(cherry-pick from commit a4f701af93a5a739f34823cde0c493dfbc63537a) - Add call to __android_log_pmsg_file_write for recovery logging. - Add call to refresh pmsg if we reboot back into recovery and then allow overwrite of those logs. - Add a new one-time executable recovery-refresh that refreshes pmsg in post-fs phase of init. We rely on pmsg eventually scrolling off to age the content after recovery-persist has done its job. - Add a new one-time executable recovery-persist that transfers from pmsg to /data/misc/recovery/ directory if /cache is not mounted in post-fs-data phase of init. - Build and appropriately trigger the above two as required if BOARD_CACHEIMAGE_PARTITION_SIZE is undefined. - Add some simple unit tests NB: Test failure is expected on systems that do not deliver either the recovery-persist or recovery-refresh executables, e.g. systems with /cache. Tests also require a timely reboot sequence of test to truly verify, tests provide guidance on stderr to direct. Bug: 27176738 Change-Id: I17bb95980234984f6b2087fd5941b0a3126b706b
2016-03-28recovery: use __android_log_pmsg_file_write for log filesMark Salyzyn1-0/+2
- Add call to __android_log_pmsg_file_write for recovery logging. - Add call to refresh pmsg if we reboot back into recovery and then allow overwrite of those logs. - Add a new one-time executable recovery-refresh that refreshes pmsg in post-fs phase of init. We rely on pmsg eventually scrolling off to age the content after recovery-persist has done its job. - Add a new one-time executable recovery-persist that transfers from pmsg to /data/misc/recovery/ directory if /cache is not mounted in post-fs-data phase of init. - Build and appropriately trigger the above two as required if BOARD_CACHEIMAGE_PARTITION_SIZE is undefined. - Add some simple unit tests NB: Test failure is expected on systems that do not deliver either the recovery-persist or recovery-refresh executables, e.g. systems with /cache. Tests also require a timely reboot sequence of test to truly verify, tests provide guidance on stderr to direct. Bug: 27176738 Change-Id: I17bb95980234984f6b2087fd5941b0a3126b706b
2016-03-12Port applypatch.sh tests to recovery_component_testsJed Estep1-2/+11
Bug: 27135282 Change-Id: If53682b591397ddfdb84860a3779b612904d4489
2016-02-05Change on-device directory for recovery test dataJed Estep1-1/+1
Test data needs to go outside the gtest module. Change-Id: Ic444ca838cbafa651ec97ff8730129da84fafc09
2016-02-04Refactor existing tests to use gtestJed Estep1-3/+32
Bug: 26962907 Change-Id: I5f80636af1740badeff7d08193f08e23f4e4fee1
2015-11-16recovery: Switch to clangTao Bao1-0/+1
And a few trival fixes to suppress warnings. Change-Id: Id28e3581aaca4bda59826afa80c0c1cdfb0442fc (cherry picked from commit 80e46e08de5f65702fa7f7cd3ef83f905d919bbc)
2015-06-03recovery: Switch to clangTao Bao1-0/+1
And a few trival fixes to suppress warnings. Change-Id: I38734b5f4434643e85feab25f4807b46a45d8d65
2014-10-17More test makefile cleanup.Dan Albert1-24/+23
Global variables kill. No need to manually link gtest, and that causes problems with libc++. Change-Id: If804cdd436cf1addfa9a777708efbc37c27770b6
2013-10-10Add support for ECDSA signaturesKenny Root1-0/+26
This adds support for key version 5 which is an EC key using the NIST P-256 curve parameters. OTAs may be signed with these keys using the ECDSA signature algorithm with SHA-256. Change-Id: Id88672a3deb70681c78d5ea0d739e10f839e4567