aboutsummaryrefslogtreecommitdiffstats
path: root/tests/component/update_verifier_test.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-04-18 17:10:49 -0700
committerTao Bao <tbao@google.com>2018-04-20 14:26:38 -0700
commit1cc03519155fc333b7db6c90c4d82f70c246997a (patch)
tree7ff841a4b1598550c3129b14f5c917ef891ff55a /tests/component/update_verifier_test.cpp
parentbcb015239c5affc81414d45726aff7efac020a5f (diff)
downloadandroid_bootable_recovery-1cc03519155fc333b7db6c90c4d82f70c246997a.tar.gz
android_bootable_recovery-1cc03519155fc333b7db6c90c4d82f70c246997a.tar.bz2
android_bootable_recovery-1cc03519155fc333b7db6c90c4d82f70c246997a.zip
Make update_verifier generic across verified boot versions.
This allows the update_verifier in a general system image to work across devices that have different verified boot versions (i.e. not supported / verified boot 1.0 / verified boot 2.0 / disabled). Bug: 78283982 Test: Run recovery_component_test on both of marlin and walleye. Test: Generate an OTA that has this CL. Install this OTA and check the update_verifier log during the post-reboot verification, on both of marlin (VB 1.0) and walleye (VB 2.0). Test: Build and flash walleye image with verified boot disabled. Check that update_verifier marks the slot as successfully booted. Change-Id: I828d87d59f911786531f774ffcf9b2ad7c2ca007
Diffstat (limited to 'tests/component/update_verifier_test.cpp')
-rw-r--r--tests/component/update_verifier_test.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/component/update_verifier_test.cpp b/tests/component/update_verifier_test.cpp
index 1544bb2a..f6ef6dcf 100644
--- a/tests/component/update_verifier_test.cpp
+++ b/tests/component/update_verifier_test.cpp
@@ -17,6 +17,8 @@
#include <string>
#include <android-base/file.h>
+#include <android-base/properties.h>
+#include <android-base/strings.h>
#include <android-base/test_utils.h>
#include <gtest/gtest.h>
#include <update_verifier/update_verifier.h>
@@ -24,11 +26,8 @@
class UpdateVerifierTest : public ::testing::Test {
protected:
void SetUp() override {
-#if defined(PRODUCT_SUPPORTS_VERITY) || defined(BOARD_AVB_ENABLE)
- verity_supported = true;
-#else
- verity_supported = false;
-#endif
+ std::string verity_mode = android::base::GetProperty("ro.boot.veritymode", "");
+ verity_supported = android::base::EqualsIgnoreCase(verity_mode, "enforcing");
}
bool verity_supported;