diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2019-03-14 12:00:30 +0100 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-03-14 12:00:30 +0100 |
commit | 2e6fbfc31e225932fdb9ad7edab8762bf3ef3670 (patch) | |
tree | 5fff518c791b8a97932cb75eaaa38b3798b33cf6 /tests/component | |
parent | Merge "update_verifier: Add some missing #include's." (diff) | |
parent | Update_verifier: Remove the support for legacy text format CareMap (diff) | |
download | android_bootable_recovery-2e6fbfc31e225932fdb9ad7edab8762bf3ef3670.tar android_bootable_recovery-2e6fbfc31e225932fdb9ad7edab8762bf3ef3670.tar.gz android_bootable_recovery-2e6fbfc31e225932fdb9ad7edab8762bf3ef3670.tar.bz2 android_bootable_recovery-2e6fbfc31e225932fdb9ad7edab8762bf3ef3670.tar.lz android_bootable_recovery-2e6fbfc31e225932fdb9ad7edab8762bf3ef3670.tar.xz android_bootable_recovery-2e6fbfc31e225932fdb9ad7edab8762bf3ef3670.tar.zst android_bootable_recovery-2e6fbfc31e225932fdb9ad7edab8762bf3ef3670.zip |
Diffstat (limited to '')
-rw-r--r-- | tests/component/update_verifier_test.cpp | 44 |
1 files changed, 3 insertions, 41 deletions
diff --git a/tests/component/update_verifier_test.cpp b/tests/component/update_verifier_test.cpp index 0a594037c..e27e58c22 100644 --- a/tests/component/update_verifier_test.cpp +++ b/tests/component/update_verifier_test.cpp @@ -98,7 +98,7 @@ TEST_F(UpdateVerifierTest, verify_image_no_care_map) { ASSERT_FALSE(verifier_.ParseCareMap()); } -TEST_F(UpdateVerifierTest, verify_image_smoke) { +TEST_F(UpdateVerifierTest, verify_image_text_format) { // This test relies on dm-verity support. if (!verity_supported) { GTEST_LOG_(INFO) << "Test skipped on devices without dm-verity support."; @@ -107,49 +107,11 @@ TEST_F(UpdateVerifierTest, verify_image_smoke) { std::string content = "system\n2,0,1"; ASSERT_TRUE(android::base::WriteStringToFile(content, care_map_txt_)); - ASSERT_TRUE(verifier_.ParseCareMap()); - ASSERT_TRUE(verifier_.VerifyPartitions()); - - // Leading and trailing newlines should be accepted. - ASSERT_TRUE(android::base::WriteStringToFile("\n" + content + "\n\n", care_map_txt_)); - ASSERT_TRUE(verifier_.ParseCareMap()); - ASSERT_TRUE(verifier_.VerifyPartitions()); -} - -TEST_F(UpdateVerifierTest, verify_image_empty_care_map) { + // CareMap in text format is no longer supported. ASSERT_FALSE(verifier_.ParseCareMap()); } -TEST_F(UpdateVerifierTest, verify_image_wrong_lines) { - // The care map file can have only 2 / 4 / 6 lines. - ASSERT_TRUE(android::base::WriteStringToFile("line1", care_map_txt_)); - ASSERT_FALSE(verifier_.ParseCareMap()); - - ASSERT_TRUE(android::base::WriteStringToFile("line1\nline2\nline3", care_map_txt_)); - ASSERT_FALSE(verifier_.ParseCareMap()); -} - -TEST_F(UpdateVerifierTest, verify_image_malformed_care_map) { - // This test relies on dm-verity support. - if (!verity_supported) { - GTEST_LOG_(INFO) << "Test skipped on devices without dm-verity support."; - return; - } - - std::string content = "system\n2,1,0"; - ASSERT_TRUE(android::base::WriteStringToFile(content, care_map_txt_)); - ASSERT_FALSE(verifier_.ParseCareMap()); -} - -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; - } - - std::string content = "/dev/block/bootdevice/by-name/system\n2,1,0"; - ASSERT_TRUE(android::base::WriteStringToFile(content, care_map_txt_)); +TEST_F(UpdateVerifierTest, verify_image_empty_care_map) { ASSERT_FALSE(verifier_.ParseCareMap()); } |