diff options
author | Tao Bao <tbao@google.com> | 2017-07-24 09:22:39 -0700 |
---|---|---|
committer | Tao Bao <tbao@google.com> | 2017-07-24 12:51:19 -0700 |
commit | 5cee24f4f1aa3f53c0b386abb2797c1e0f3088eb (patch) | |
tree | 8118a9eca77361ec48dee5ab2bb470470854f0ac | |
parent | 71b8103bf11f676ed2c2ed5e2bef34b74b4ea16a (diff) | |
download | android_bootable_recovery-5cee24f4f1aa3f53c0b386abb2797c1e0f3088eb.tar.gz android_bootable_recovery-5cee24f4f1aa3f53c0b386abb2797c1e0f3088eb.tar.bz2 android_bootable_recovery-5cee24f4f1aa3f53c0b386abb2797c1e0f3088eb.zip |
tests: Add a test to cover legacy care_map.txt handling.
This is to cover the code added by commit
5a1dee01df3af346729b5791606b72d59b8e9815, where an O update_verifier
should not reject N care_map.txt.
Bug: 63544345
Test: recovery_component_test passes on marlin.
Change-Id: Ia944e16cba3cc635098b3ffd92842d725b570fec
(cherry picked from commit c319613e06f996aed32da3a1c3e93bf9b04ffa95)
-rw-r--r-- | tests/component/update_verifier_test.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/component/update_verifier_test.cpp b/tests/component/update_verifier_test.cpp index 5fc7ef63..b04e1185 100644 --- a/tests/component/update_verifier_test.cpp +++ b/tests/component/update_verifier_test.cpp @@ -81,3 +81,16 @@ TEST_F(UpdateVerifierTest, verify_image_malformed_care_map) { ASSERT_TRUE(android::base::WriteStringToFile(content, temp_file.path)); ASSERT_FALSE(verify_image(temp_file.path)); } + +TEST_F(UpdateVerifierTest, verify_image_legacy_care_map) { + // This test relies on dm-verity support. + if (!verity_supported) { + GTEST_LOG_(INFO) << "Test skipped on devices without dm-verity support."; + return; + } + + TemporaryFile temp_file; + std::string content = "/dev/block/bootdevice/by-name/system\n2,1,0"; + ASSERT_TRUE(android::base::WriteStringToFile(content, temp_file.path)); + ASSERT_TRUE(verify_image(temp_file.path)); +} |