diff options
author | Tao Bao | 2017-07-24 11:22:39 -0500 |
---|---|---|
committer | Tao Bao | 2017-07-24 11:34:06 -0500 |
commit | c319613e06f996aed32da3a1c3e93bf9b04ffa95 (patch) | |
tree | 86679e32ecd4716da736d4e3aa2c3ba14f319c08 /tests | |
parent | 15ae0f01c3e750bafb34bde88897096adb5c8881 (diff) | |
download | platform-bootable-recovery-c319613e06f996aed32da3a1c3e93bf9b04ffa95.tar.gz platform-bootable-recovery-c319613e06f996aed32da3a1c3e93bf9b04ffa95.tar.xz platform-bootable-recovery-c319613e06f996aed32da3a1c3e93bf9b04ffa95.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
Diffstat (limited to 'tests')
-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) { | |||
81 | ASSERT_TRUE(android::base::WriteStringToFile(content, temp_file.path)); | 81 | ASSERT_TRUE(android::base::WriteStringToFile(content, temp_file.path)); |
82 | ASSERT_FALSE(verify_image(temp_file.path)); | 82 | ASSERT_FALSE(verify_image(temp_file.path)); |
83 | } | 83 | } |
84 | |||
85 | TEST_F(UpdateVerifierTest, verify_image_legacy_care_map) { | ||
86 | // This test relies on dm-verity support. | ||
87 | if (!verity_supported) { | ||
88 | GTEST_LOG_(INFO) << "Test skipped on devices without dm-verity support."; | ||
89 | return; | ||
90 | } | ||
91 | |||
92 | TemporaryFile temp_file; | ||
93 | std::string content = "/dev/block/bootdevice/by-name/system\n2,1,0"; | ||
94 | ASSERT_TRUE(android::base::WriteStringToFile(content, temp_file.path)); | ||
95 | ASSERT_TRUE(verify_image(temp_file.path)); | ||
96 | } | ||