diff options
author | Kelvin Zhang <zhangkelvin@google.com> | 2020-06-30 03:09:11 +0200 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-06-30 03:09:11 +0200 |
commit | fd481f6f6254443382af94d6de9ded18c0eae6bd (patch) | |
tree | af25f4c5ce716327cdaa9b193a5f57e3ea2ac1b5 /tests/unit | |
parent | Track rename of adbd_system_binaries. am: 4473e1689f (diff) | |
parent | Merge "Add recovery support of dynamic fingerprints" am: dca4844328 (diff) | |
download | android_bootable_recovery-fd481f6f6254443382af94d6de9ded18c0eae6bd.tar android_bootable_recovery-fd481f6f6254443382af94d6de9ded18c0eae6bd.tar.gz android_bootable_recovery-fd481f6f6254443382af94d6de9ded18c0eae6bd.tar.bz2 android_bootable_recovery-fd481f6f6254443382af94d6de9ded18c0eae6bd.tar.lz android_bootable_recovery-fd481f6f6254443382af94d6de9ded18c0eae6bd.tar.xz android_bootable_recovery-fd481f6f6254443382af94d6de9ded18c0eae6bd.tar.zst android_bootable_recovery-fd481f6f6254443382af94d6de9ded18c0eae6bd.zip |
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/install_test.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/unit/install_test.cpp b/tests/unit/install_test.cpp index ee753494c..90c4b1409 100644 --- a/tests/unit/install_test.cpp +++ b/tests/unit/install_test.cpp @@ -466,6 +466,34 @@ TEST(InstallTest, CheckPackageMetadata_ab_fingerprint) { TestCheckPackageMetadata(metadata, OtaType::AB, false); } +TEST(InstallTest, CheckPackageMetadata_dynamic_fingerprint) { + std::string device = android::base::GetProperty("ro.product.device", ""); + ASSERT_FALSE(device.empty()); + + std::string finger_print = android::base::GetProperty("ro.build.fingerprint", ""); + ASSERT_FALSE(finger_print.empty()); + + std::string metadata = android::base::Join( + std::vector<std::string>{ + "ota-type=AB", + "pre-device=please|work|" + device + "|please|work", + "pre-build=" + finger_print = "pass|this|test", + "post-timestamp=" + std::to_string(std::numeric_limits<int64_t>::max()), + }, + "\n"); + TestCheckPackageMetadata(metadata, OtaType::AB, true); + + metadata = android::base::Join( + std::vector<std::string>{ + "ota-type=AB", + "pre-device=" + device, + "pre-build=dummy_build_fingerprint", + "post-timestamp=" + std::to_string(std::numeric_limits<int64_t>::max()), + }, + "\n"); + TestCheckPackageMetadata(metadata, OtaType::AB, false); +} + TEST(InstallTest, CheckPackageMetadata_ab_post_timestamp) { std::string device = android::base::GetProperty("ro.product.device", ""); ASSERT_NE("", device); |