From 1cc03519155fc333b7db6c90c4d82f70c246997a Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 18 Apr 2018 17:10:49 -0700 Subject: 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 --- tests/component/update_verifier_test.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tests/component') diff --git a/tests/component/update_verifier_test.cpp b/tests/component/update_verifier_test.cpp index 1544bb2a4..f6ef6dcfd 100644 --- a/tests/component/update_verifier_test.cpp +++ b/tests/component/update_verifier_test.cpp @@ -17,6 +17,8 @@ #include #include +#include +#include #include #include #include @@ -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; -- cgit v1.2.3