diff options
author | Tianjie <xunchang@google.com> | 2020-06-30 12:26:25 -0700 |
---|---|---|
committer | Tianjie Xu <xunchang@google.com> | 2020-07-09 20:15:08 +0000 |
commit | 24f960986b1337f14eb8e86382cb62aed5d1153c (patch) | |
tree | ea47bdb983a0b692fc02fe2b5e84029d7d6002f7 /payload_consumer/filesystem_verifier_action_unittest.cc | |
parent | d2da7b1990e0fee1c99bf64aa562cef572aaa061 (diff) |
Verify the extents for untouched dynamic partitions during partial update
For partial updates, the metadata for untouched dynamic partitions
are just copied over to the target slot. So, verifying the extents
of these partitions in the target metadata should be sufficient for
correctness. This saves the work to read & hash the bytes on these
partitions for each resumed update.
Bug: 151088567
Test: unit tests pass, apply a partial update
Change-Id: I9d40ed2643e145a1546ea17b146fcdcfb91f213f
Diffstat (limited to 'payload_consumer/filesystem_verifier_action_unittest.cc')
-rw-r--r-- | payload_consumer/filesystem_verifier_action_unittest.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/payload_consumer/filesystem_verifier_action_unittest.cc b/payload_consumer/filesystem_verifier_action_unittest.cc index cb33404d..2971849c 100644 --- a/payload_consumer/filesystem_verifier_action_unittest.cc +++ b/payload_consumer/filesystem_verifier_action_unittest.cc @@ -27,6 +27,7 @@ #include <brillo/secure_blob.h> #include <gtest/gtest.h> +#include "update_engine/common/dynamic_partition_control_stub.h" #include "update_engine/common/hash_calculator.h" #include "update_engine/common/test_utils.h" #include "update_engine/common/utils.h" @@ -51,6 +52,7 @@ class FilesystemVerifierActionTest : public ::testing::Test { brillo::FakeMessageLoop loop_{nullptr}; ActionProcessor processor_; + DynamicPartitionControlStub dynamic_control_stub_; }; class FilesystemVerifierActionTestDelegate : public ActionProcessorDelegate { @@ -188,7 +190,8 @@ bool FilesystemVerifierActionTest::DoTest(bool terminate_early, void FilesystemVerifierActionTest::BuildActions( const InstallPlan& install_plan) { auto feeder_action = std::make_unique<ObjectFeederAction<InstallPlan>>(); - auto verifier_action = std::make_unique<FilesystemVerifierAction>(); + auto verifier_action = + std::make_unique<FilesystemVerifierAction>(&dynamic_control_stub_); auto collector_action = std::make_unique<ObjectCollectorAction<InstallPlan>>(); @@ -217,7 +220,8 @@ class FilesystemVerifierActionTest2Delegate : public ActionProcessorDelegate { }; TEST_F(FilesystemVerifierActionTest, MissingInputObjectTest) { - auto copier_action = std::make_unique<FilesystemVerifierAction>(); + auto copier_action = + std::make_unique<FilesystemVerifierAction>(&dynamic_control_stub_); auto collector_action = std::make_unique<ObjectCollectorAction<InstallPlan>>(); |