summaryrefslogtreecommitdiffstats
path: root/tests/component (follow)
Commit message (Collapse)AuthorAgeFilesLines
* updater: Fix an off-by-1 bug in file_getprop().Tao Bao2016-11-031-0/+50
| | | | | | | | Also add a testcase for file_getprop(). Test: recovery_component_test passes. Change-Id: I8eb2f9a5702b43997ac9f4b29665eea087b1c146
* tests: Set up testdata path for continuous native tests.Tao Bao2016-11-032-16/+2
| | | | | | | | | | | | | | | | | | | | 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
* applypatch: Add testcases for applypatch executable.Tao Bao2016-11-011-256/+322
| | | | | | | | | | | | | | | 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
* applypatch: Switch the parameter of Value** to std::vector.Tao Bao2016-10-291-126/+138
| | | | | | Test: Unit tests and install-recovery.sh pass on angler and dragon. Change-Id: I328e6554edca667cf850f5584ebf1ac211e3d4d1
* Add a unit test for applypatch_checkTianjie Xu2016-10-191-0/+5
| | | | | | | | | If no sha1 is specified, applypatch_check should pass as long as the file content loads successfully. Add a unit case acccordingly. Test: Unit tests passed Bug: 32243751 Change-Id: I8c013be67c197d2935e11cf6acc59fb9b943cfd9
* Replace minzip with libziparchiveTianjie Xu2016-10-181-1/+2
| | | | | | | | | | | 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
* Change StringValue to use std::stringTianjie Xu2016-10-153-81/+67
| | | | | | | | | | | Changing the field of 'Value' in edify to std::string from char*. Meanwhile cleaning up the users of 'Value' and switching them to cpp style. Test: compontent tests passed. Bug: 31713288 Change-Id: Iec5a7d601b1e4ca40935bf1c70d325dafecec235
* edify: Some clean-ups to libedify.Tao Bao2016-10-132-6/+23
| | | | | | | | | | | | - Remove dead declarations in expr.h: SetError(), GetError(), ClearError(). - Remove the declaration of Build() out of expr.h. - Use std::unordered_map to implement RegisterFunction() and FindFunction(); kill FinishRegistration(). - Add a testcase for calling unknown functions. Test: mmma bootable/recovery; recovery_component_test passes. Change-Id: I9af6825ae677f92b22d716a4a5682f58522af03b
* updater: Kill the duplicate PrintSha1() in install.cpp.Tao Bao2016-10-111-7/+36
| | | | | | | | Also add a testcase for sha1_check(). Test: mmma bootable/recovery; recovery_component_test passes. Change-Id: I4d06d551a771aec84e460148544f68b247a7e721
* Refactor libupdater into a seperate module.Tao Bao2016-10-111-0/+71
| | | | | | | | | 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
* edify: Move State.script and State.errmsg to std::string.Tao Bao2016-10-041-6/+1
| | | | | | | | | | | This way we kill a few strdup() and free() calls. Test: 1. recovery_component_test still passes; 2. Applying an update with the new updater works; 3. The error code in a script with abort("E310: xyz") is recorded into last_install correctly. Change-Id: Ibda4da5937346e058a0d7cc81764d6f02920010a
* edify: Move the testcases to gtest.Tao Bao2016-10-041-0/+156
| | | | | | | | | | | | | 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
* Fix clang-tidy warnings in bootable/recovery.Chih-Hung Hsieh2016-08-261-1/+1
| | | | | | | | | | | | * Use const reference type for read-only parameters. Bug: 30407689 * Use faster overloaded string find function. Bug: 30411878 * Add parentheses around macro parameters. Bug: 28705665 Test: build with WITH_TIDY=1 Change-Id: I4e8e5748bfa4ae89871f1fb5fa4624d372530d75
* Merge \"Clean up verifier testcases.\"Tao Bao2016-08-011-41/+26
|\ | | | | | | | | | | am: e91aef0ee9 Change-Id: Ia130dc2a7f62ecf1ad40ec03d88a331a31800efa
| * Clean up verifier testcases.Tao Bao2016-08-011-41/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A Certificate is a pair of an RSAPublicKey and a particular hash. So v1 and v3 differ in the hash algorithm (SHA-1 vs SHA-256), similarly for v2 and v4. In verifier testcases, we used to load v1/v2 keys with an explicit argument of "sha256" to test the v3/v4 keys. This CL switches to loading v3/v4 keys directly and lets load_keys() to handle that, which is the actual flow we use in practice. Also remove the "fallback to v1 key" in the testcases, which is not the actual behavior. Bug: 30415901 Test: Run the verifier_test component test on device. Change-Id: I3a2baa64826f1b6c4c367a560090df384c4521bb
* | resolve merge conflicts of 5823dd4 to nyc-dev-plus-aospTianjie Xu2016-05-021-0/+1
|\ \ | | | | | | | | | Change-Id: I4ec33904a6af38d81b422c7be6f40b828fbc7525
| * | Add ability to show "installing security update"Tianjie Xu2016-04-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new command "--security" to boot commands. If this command is observed as part of BCB, choose a different background text picture for installing stage in recovery UI. As a result, users will see "installing security update" instead of "installing system update" when applying a security update package. Bug: 27837319 Change-Id: I2e2253a124993ecc24804fa1ee0b918ac96837c5
| * | Use BoringSSL instead of mincrypt to speed up package verification.Elliott Hughes2016-04-141-108/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | resolve merge conflicts of 2bf95ac to nyc-dev-plus-aospElliott Hughes2016-04-131-108/+23
|\ \ \ | | |/ | |/| | | | Change-Id: Iaf232fbe65879bad6e19c7a9600aa6303a491a67
| * | Convert recovery to use BoringSSL instead of mincrypt.Mattias Nissler2016-04-061-108/+23
| | | | | | | | | | | | | | | | | | | | | This changes the verification code in bootable/recovery to use BoringSSL instead of mincrypt. Change-Id: I37b37d84b22e81c32ac180cd1240c02150ddf3a7
* | | Merge "Port applypatch.sh tests to recovery_component_tests" into nyc-devJed Estep2016-03-122-6/+393
|\ \ \ | |/ / |/| / | |/ | | | | | | am: 761653a4ad * commit '761653a4ad1c392fcd505e8909661fd64f02ce97': Port applypatch.sh tests to recovery_component_tests
| * Port applypatch.sh tests to recovery_component_testsJed Estep2016-03-122-6/+393
| | | | | | | | | | Bug: 27135282 Change-Id: If53682b591397ddfdb84860a3779b612904d4489
| * Fix verifier test base testdata directory after merge conflictJed Estep2016-02-221-1/+1
| | | | | | | | Change-Id: I7ffba0be5a6befc875ce59b51a008c1892e7d34b
* | Merge "verifier_test: Suppress the unused parameter warnings."Tao Bao2016-02-091-8/+9
|\ \
| * | verifier_test: Suppress the unused parameter warnings.Tao Bao2016-02-051-8/+9
| |/ | | | | | | Change-Id: I51fec30114c0a31efc9c2ac8472654baf8bb3e84
* / Change on-device directory for recovery test dataJed Estep2016-02-051-1/+1
|/ | | | | | Test data needs to go outside the gtest module. Change-Id: Ic444ca838cbafa651ec97ff8730129da84fafc09
* Refactor existing tests to use gtestJed Estep2016-02-041-0/+267
Bug: 26962907 Change-Id: I5f80636af1740badeff7d08193f08e23f4e4fee1