From f6158eb918fb86f94e418244a9351379ad568563 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Tue, 11 Jun 2019 16:09:07 -0700 Subject: Support starting fuse from a block map Factor out a new function from ApplyFromSdcard that installs a package from a local path. Inside this function, we start the fuse and choose the type of data provider depending on the path string. And similar to the existing logic, we treat the package as a block map if the path starts with a '@'. This is part of the effort to install larger than 2GiB packages on ILP32 devices. Bug: 127071893 Test: Build a 32 bit sailfish and create a 3GiB OTA package. Sideload the package, uncrypt and install the package from sdcard. Change-Id: I328ea34fa530731acbce7554bfc3059313ad6ece --- tests/unit/fuse_provider_test.cpp | 3 ++- tests/unit/fuse_sideload_test.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/unit') diff --git a/tests/unit/fuse_provider_test.cpp b/tests/unit/fuse_provider_test.cpp index c5995dd7d..37f99f92e 100644 --- a/tests/unit/fuse_provider_test.cpp +++ b/tests/unit/fuse_provider_test.cpp @@ -44,7 +44,8 @@ TEST(FuseBlockMapTest, CreateFromBlockMap_smoke) { ASSERT_TRUE(block_map_data); ASSERT_EQ(10000, block_map_data->file_size()); ASSERT_EQ(4096, block_map_data->fuse_block_size()); - ASSERT_EQ(RangeSet({ { 10, 11 }, { 20, 21 }, { 22, 23 } }), block_map_data->ranges()); + ASSERT_EQ(RangeSet({ { 10, 11 }, { 20, 21 }, { 22, 23 } }), + static_cast(block_map_data.get())->ranges()); } TEST(FuseBlockMapTest, ReadBlockAlignedData_smoke) { diff --git a/tests/unit/fuse_sideload_test.cpp b/tests/unit/fuse_sideload_test.cpp index 6add99f41..ea895038c 100644 --- a/tests/unit/fuse_sideload_test.cpp +++ b/tests/unit/fuse_sideload_test.cpp @@ -40,6 +40,10 @@ class FuseTestDataProvider : public FuseDataProvider { bool ReadBlockAlignedData(uint8_t*, uint32_t, uint32_t) const override { return true; } + + bool Valid() const override { + return true; + } }; TEST(SideloadTest, run_fuse_sideload_wrong_parameters) { -- cgit v1.2.3