summaryrefslogtreecommitdiffstats
path: root/tests/component/updater_test.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* updater: Fix the broken case for apply_patch_check().Tao Bao2017-03-231-0/+49
| | | | | | | | | | | 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
* Remove malloc in edify functionsTianjie Xu2017-03-221-1/+2
| | | | | | | | And switch them to std::vector & std::unique_ptr Bug: 32117870 Test: recovery tests passed on sailfish Change-Id: I5a45951c4bdf895be311d6d760e52e7a1b0798c3
* Add a test to perform block_image_updateTianjie Xu2017-03-171-5/+115
| | | | | | | | | | | | | | | | | 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
* updater: Remove some obsoleted functions for file-based OTA.Tao Bao2017-03-131-113/+0
| | | | | | | | | | | | | | This CL removes the updater support for delete(), symlink(), rename(), set_metadata() and set_metadata_recursive(). Such functions have been removed from the generation script in commit f388104eaacd05cfa075d6478369e1d0df5ddbf3 (platform/build). Note: This CL also removes delete_recursive() which seems to have never been supported in generation script. Bug: 35853185 Test: recovery_component_test passes. Change-Id: I51e1ec946fa73761118fa1eaa082423df6d588e9
* tests: Add testcase for show_progress() and set_progress().Tao Bao2017-01-061-0/+50
| | | | | Test: recovery_component_test passes. Change-Id: I4f00d0171cf86699e9ce747d07d7d44a01906e81
* updater: Refactor set_stage() and get_stage() functions.Tao Bao2016-11-181-0/+59
| | | | | | | | | | | 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
* updater: Add testcase for package_extract_dir().Tao Bao2016-11-181-0/+96
| | | | | Test: recovery_component_test passes. Change-Id: I3af4707bc42c7331ca961be8b967a53de82ea25b
* updater: Add "write_value()" function.Tao Bao2016-11-171-0/+33
| | | | | | | | | | | | | write_value(value, filename) writes 'value' to 'filename'. It can be used to tune device settings when applying an OTA package. For example, write_value("960000", "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"). Bug: 32463933 Test: recovery_component_test passes. Test: Apply an OTA package that contains a call to write_value(), and check the result. Change-Id: Ib009ecb8a45a94353f10c59e2383fe1f49796e35
* updater: Fix the wrong return value for package_extract_file().Tao Bao2016-11-151-17/+75
| | | | | | | | | | | | | | | '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
* updater: Add more testcase for symlink().Tao Bao2016-11-091-6/+39
| | | | | | | | Clean up SymlinkFn() a bit. Also clean up the temp files created when running the tests; otherwise non-empty TemporaryDir won't be removed. Test: recovery_component_test passes. Change-Id: Id3844abebd168c40125c4dcec54e6ef680a83c3a
* Make make_parent() to take const argumentTianjie Xu2016-11-081-0/+22
| | | | | | | | Switch to use const std::string; and add corresponding tests. Bug: 32649858 Test: Component tests pass Change-Id: I640f3ec81f1481fa91aa310f8d4d96dac9649cb9
* updater: Add a testcase for RenameFn().Tao Bao2016-11-041-0/+29
| | | | | | Test: recovery_component_test passes. Change-Id: Iba5a0fdf6c79e2bed6b30b8fc19a306c1ab29d8a
* updater: Fix a bug in DeleteFn().Tao Bao2016-11-041-0/+33
| | | | | | | Also add a testcase for delete() function. Test: recovery_component_test passes. Change-Id: I064d1ad4693c3ed339d0a69eabadd08a61a2ea86
* 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
* Change StringValue to use std::stringTianjie Xu2016-10-151-4/+4
| | | | | | | | | | | 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-131-1/+0
| | | | | | | | | | | | - 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