From 673bb6f0518f9d98acf7c53ed0712750d21befa6 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Fri, 3 Aug 2018 20:56:25 -0700 Subject: updater: Move libupdater to Soong. Test: mmma -j bootable/recovery Test: Run recovery_unit_test and recovery_component_test on marlin. Change-Id: I2617b87d13c585addf0ed2fbae8c3ce443ea7200 --- tests/Android.mk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/Android.mk b/tests/Android.mk index ef64d76ab..362fe568c 100644 --- a/tests/Android.mk +++ b/tests/Android.mk @@ -127,13 +127,11 @@ tune2fs_static_libraries := \ libupdater_static_libraries := \ libupdater \ libapplypatch \ + libbootloader_message \ libbspatch \ libedify \ - libziparchive \ - libotautil \ - libbootloader_message \ - libutils \ libotafault \ + libotautil \ libext4_utils \ libfec \ libfec_rs \ @@ -144,14 +142,16 @@ libupdater_static_libraries := \ libselinux \ libsparse \ libsquashfs_utils \ + libbrotli \ libbz \ + libziparchive \ libz \ libbase \ libcrypto \ libcrypto_utils \ libcutils \ + libutils \ libtune2fs \ - libbrotli \ $(tune2fs_static_libraries) health_hal_static_libraries := \ -- cgit v1.2.3 From 056538c0a9ec2bf1b641957ef7a260c465a0eb75 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 11 Jul 2018 17:04:12 -0700 Subject: recovery uses IHealth::getService recovery is_battery_ok function uses get_health_service(), which calls IHealth::getService("default") then IHealth::getService("backup"). - An OEM can provide the default instance by installing android.hardware.health@2.0-impl-.so to recovery partition. - If that's not found, the "backup" instance is provided to the recovery partition by default. Test: call is_battery_ok() in recovery, successfully get battery information. Bug: 80132328 Change-Id: Ibfee80636325a07bc20b24d044d007a60b3dd7c2 --- tests/Android.mk | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'tests') diff --git a/tests/Android.mk b/tests/Android.mk index b6f5b451f..987e372e5 100644 --- a/tests/Android.mk +++ b/tests/Android.mk @@ -154,18 +154,6 @@ libupdater_static_libraries := \ libbrotli \ $(tune2fs_static_libraries) -health_hal_static_libraries := \ - android.hardware.health@2.0-impl \ - android.hardware.health@2.0 \ - android.hardware.health@1.0 \ - android.hardware.health@1.0-convert \ - libhealthstoragedefault \ - libhidltransport \ - libhidlbase \ - libhwbinder_noltopgo \ - libvndksupport \ - libbatterymonitor - librecovery_static_libraries := \ librecovery \ libbootloader_message \ @@ -175,7 +163,6 @@ librecovery_static_libraries := \ libminui \ libverifier \ libotautil \ - $(health_hal_static_libraries) \ libcrypto_utils \ libcrypto \ libext4_utils \ -- cgit v1.2.3 From 8f64bf635fb021861288222ae5c741cd8fb22f03 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Tue, 7 Aug 2018 00:22:19 -0700 Subject: Add the hash_tree_info class in Command Add hash_tree_info to represent the hash tree computation arguments in the transfer commands 'compute_hash_tree'. Also add its parsing code in the Command class. Bug: 25170618 Test: unit tests pass Change-Id: Ie8607968377968e8fb3e58d1af0b8ca315e145be --- tests/unit/commands_test.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests') diff --git a/tests/unit/commands_test.cpp b/tests/unit/commands_test.cpp index 9679a9e73..19841d676 100644 --- a/tests/unit/commands_test.cpp +++ b/tests/unit/commands_test.cpp @@ -333,6 +333,25 @@ TEST(CommandsTest, Parse_ZERO) { ASSERT_EQ(PatchInfo(), command.patch()); } +TEST(CommandsTest, Parse_COMPUTE_HASH_TREE) { + const std::string input{ "compute_hash_tree 2,0,1 2,3,4 sha1 unknown-salt unknown-root-hash" }; + std::string err; + Command command = Command::Parse(input, 9, &err); + ASSERT_TRUE(command); + + ASSERT_EQ(Command::Type::COMPUTE_HASH_TREE, command.type()); + ASSERT_EQ(9, command.index()); + ASSERT_EQ(input, command.cmdline()); + + HashTreeInfo expected_info(RangeSet({ { 0, 1 } }), RangeSet({ { 3, 4 } }), "sha1", "unknown-salt", + "unknown-root-hash"); + ASSERT_EQ(expected_info, command.hash_tree_info()); + ASSERT_EQ(TargetInfo(), command.target()); + ASSERT_EQ(SourceInfo(), command.source()); + ASSERT_EQ(StashInfo(), command.stash()); + ASSERT_EQ(PatchInfo(), command.patch()); +} + TEST(CommandsTest, Parse_InvalidNumberOfArgs) { Command::abort_allowed_ = true; @@ -341,6 +360,7 @@ TEST(CommandsTest, Parse_InvalidNumberOfArgs) { std::vector inputs{ "abort foo", "bsdiff", + "compute_hash_tree, 2,0,1 2,0,1 unknown-algorithm unknown-salt", "erase", "erase 4,3,5,10,12 hash1", "free", -- cgit v1.2.3