commit | 6e02ea92ec8af1da74f55e616b7cda82740dccc0 | [log] [tgz] |
---|---|---|
author | Tao Bao <tbao@google.com> | Thu Nov 17 11:24:07 2016 -0800 |
committer | Tao Bao <tbao@google.com> | Thu Nov 17 12:01:44 2016 -0800 |
tree | 03b04c72b6a904eb8798a8bef010877c7fe33f2c | |
parent | 8fce75a0697d07deed7dc81b0b9384920d8a46a4 [diff] |
applypatch: Use unique_fd to avoid leaking FDs. Add unique_fd that calls ota_close() instead of the default closer. Test: recovery_component_test passes. Test: Apply a package that calls apply_patch(). Change-Id: I0c19921731757934f76cf7d5215916673a8f2777
mm -j && m ramdisk-nodeps && m recoveryimage-nodeps # To boot into the new recovery image # without flashing the recovery partition: adb reboot bootloader fastboot boot $ANDROID_PRODUCT_OUT/recovery.img
# After setting up environment and lunch. mmma -j bootable/recovery # Running the tests on device. adb root adb sync data # 32-bit device adb shell /data/nativetest/recovery_unit_test/recovery_unit_test adb shell /data/nativetest/recovery_component_test/recovery_component_test # Or 64-bit device adb shell /data/nativetest64/recovery_unit_test/recovery_unit_test adb shell /data/nativetest64/recovery_component_test/recovery_component_test
recovery-refresh
and recovery-persist
executables exist only on systems without /cache partition. And we need to follow special steps to run tests for them.
Execute the test on an A/B device first. The test should fail but it will log some contents to pmsg.
Reboot the device immediately and run the test again. The test should save the contents of pmsg buffer into /data/misc/recovery/inject.txt. Test will pass if this file has expected contents.