summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-07-24 20:34:01 +0200
committerandroid-build-merger <android-build-merger@google.com>2017-07-24 20:34:01 +0200
commit4574ca1dff8f748e39a21f9bee029f832af98ea7 (patch)
tree8118a9eca77361ec48dee5ab2bb470470854f0ac /tests
parentMerge "update_verifier: Handle legacy care_map.txt gracefully." am: 15ae0f01c3 am: fdb5d1cd8c am: 1d923f5e54 (diff)
parentMerge "tests: Add a test to cover legacy care_map.txt handling." am: 6eb23c594c am: dbe9da5331 (diff)
downloadandroid_bootable_recovery-4574ca1dff8f748e39a21f9bee029f832af98ea7.tar
android_bootable_recovery-4574ca1dff8f748e39a21f9bee029f832af98ea7.tar.gz
android_bootable_recovery-4574ca1dff8f748e39a21f9bee029f832af98ea7.tar.bz2
android_bootable_recovery-4574ca1dff8f748e39a21f9bee029f832af98ea7.tar.lz
android_bootable_recovery-4574ca1dff8f748e39a21f9bee029f832af98ea7.tar.xz
android_bootable_recovery-4574ca1dff8f748e39a21f9bee029f832af98ea7.tar.zst
android_bootable_recovery-4574ca1dff8f748e39a21f9bee029f832af98ea7.zip
Diffstat (limited to 'tests')
-rw-r--r--tests/component/update_verifier_test.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/component/update_verifier_test.cpp b/tests/component/update_verifier_test.cpp
index 5fc7ef63f..b04e1185e 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));
+}