summaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2019-12-19 00:53:59 +0100
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2019-12-19 00:53:59 +0100
commit494d2ef710775c69f85c8a7d4f5870ad2056da95 (patch)
tree7d741e2ac84ff27d3e4ab2b604181840d53c2da1 /tests/unit
parentMerge "Do not execute linkerconfig from recovery" am: b12e54c4f1 am: 7a0a80ea28 am: 0c6c04c64d (diff)
parentMerge "Delete VINTF compatibility check during OTA." am: cae99c43de am: 567ae2f9e1 (diff)
downloadandroid_bootable_recovery-494d2ef710775c69f85c8a7d4f5870ad2056da95.tar
android_bootable_recovery-494d2ef710775c69f85c8a7d4f5870ad2056da95.tar.gz
android_bootable_recovery-494d2ef710775c69f85c8a7d4f5870ad2056da95.tar.bz2
android_bootable_recovery-494d2ef710775c69f85c8a7d4f5870ad2056da95.tar.lz
android_bootable_recovery-494d2ef710775c69f85c8a7d4f5870ad2056da95.tar.xz
android_bootable_recovery-494d2ef710775c69f85c8a7d4f5870ad2056da95.tar.zst
android_bootable_recovery-494d2ef710775c69f85c8a7d4f5870ad2056da95.zip
Diffstat (limited to '')
-rw-r--r--tests/unit/install_test.cpp82
1 files changed, 0 insertions, 82 deletions
diff --git a/tests/unit/install_test.cpp b/tests/unit/install_test.cpp
index 60cdc1105..ee753494c 100644
--- a/tests/unit/install_test.cpp
+++ b/tests/unit/install_test.cpp
@@ -28,7 +28,6 @@
#include <android-base/properties.h>
#include <android-base/strings.h>
#include <gtest/gtest.h>
-#include <vintf/VintfObjectRecovery.h>
#include <ziparchive/zip_archive.h>
#include <ziparchive/zip_writer.h>
@@ -51,29 +50,6 @@ static void BuildZipArchive(const std::map<std::string, std::string>& file_map,
ASSERT_EQ(0, fclose(zip_file));
}
-TEST(InstallTest, verify_package_compatibility_no_entry) {
- TemporaryFile temp_file;
- // The archive must have something to be opened correctly.
- BuildZipArchive({ { "dummy_entry", "" } }, temp_file.release(), kCompressStored);
-
- // Doesn't contain compatibility zip entry.
- ZipArchiveHandle zip;
- ASSERT_EQ(0, OpenArchive(temp_file.path, &zip));
- ASSERT_TRUE(verify_package_compatibility(zip));
- CloseArchive(zip);
-}
-
-TEST(InstallTest, verify_package_compatibility_invalid_entry) {
- TemporaryFile temp_file;
- BuildZipArchive({ { "compatibility.zip", "" } }, temp_file.release(), kCompressStored);
-
- // Empty compatibility zip entry.
- ZipArchiveHandle zip;
- ASSERT_EQ(0, OpenArchive(temp_file.path, &zip));
- ASSERT_FALSE(verify_package_compatibility(zip));
- CloseArchive(zip);
-}
-
TEST(InstallTest, read_metadata_from_package_smoke) {
TemporaryFile temp_file;
const std::string content("abc=defg");
@@ -135,64 +111,6 @@ TEST(InstallTest, read_wipe_ab_partition_list) {
ASSERT_EQ(expected, read_partition_list);
}
-TEST(InstallTest, verify_package_compatibility_with_libvintf_malformed_xml) {
- TemporaryFile compatibility_zip_file;
- std::string malformed_xml = "malformed";
- BuildZipArchive({ { "system_manifest.xml", malformed_xml } }, compatibility_zip_file.release(),
- kCompressDeflated);
-
- TemporaryFile temp_file;
- std::string compatibility_zip_content;
- ASSERT_TRUE(
- android::base::ReadFileToString(compatibility_zip_file.path, &compatibility_zip_content));
- BuildZipArchive({ { "compatibility.zip", compatibility_zip_content } }, temp_file.release(),
- kCompressStored);
-
- ZipArchiveHandle zip;
- ASSERT_EQ(0, OpenArchive(temp_file.path, &zip));
- std::vector<std::string> compatibility_info;
- compatibility_info.push_back(malformed_xml);
- // Malformed compatibility zip is expected to be rejected by libvintf. But we defer that to
- // libvintf.
- std::string err;
- bool result =
- android::vintf::VintfObjectRecovery::CheckCompatibility(compatibility_info, &err) == 0;
- ASSERT_EQ(result, verify_package_compatibility(zip));
- CloseArchive(zip);
-}
-
-TEST(InstallTest, verify_package_compatibility_with_libvintf_system_manifest_xml) {
- static constexpr const char* system_manifest_xml_path = "/system/manifest.xml";
- if (access(system_manifest_xml_path, R_OK) == -1) {
- GTEST_LOG_(INFO) << "Test skipped on devices w/o /system/manifest.xml.";
- return;
- }
- std::string system_manifest_xml_content;
- ASSERT_TRUE(
- android::base::ReadFileToString(system_manifest_xml_path, &system_manifest_xml_content));
- TemporaryFile compatibility_zip_file;
- BuildZipArchive({ { "system_manifest.xml", system_manifest_xml_content } },
- compatibility_zip_file.release(), kCompressDeflated);
-
- TemporaryFile temp_file;
- std::string compatibility_zip_content;
- ASSERT_TRUE(
- android::base::ReadFileToString(compatibility_zip_file.path, &compatibility_zip_content));
- BuildZipArchive({ { "compatibility.zip", compatibility_zip_content } }, temp_file.release(),
- kCompressStored);
-
- ZipArchiveHandle zip;
- ASSERT_EQ(0, OpenArchive(temp_file.path, &zip));
- std::vector<std::string> compatibility_info;
- compatibility_info.push_back(system_manifest_xml_content);
- std::string err;
- bool result =
- android::vintf::VintfObjectRecovery::CheckCompatibility(compatibility_info, &err) == 0;
- // Make sure the result is consistent with libvintf library.
- ASSERT_EQ(result, verify_package_compatibility(zip));
- CloseArchive(zip);
-}
-
TEST(InstallTest, SetUpNonAbUpdateCommands) {
TemporaryFile temp_file;
static constexpr const char* UPDATE_BINARY_NAME = "META-INF/com/google/android/update-binary";