From 269d1527cb83313f9bf80adb09b7b2e184b3affc Mon Sep 17 00:00:00 2001 From: Vicky Min Date: Mon, 28 Aug 2023 17:53:07 +0000 Subject: [PATCH] Filter keybox tests with GTEST_SKIP Bug: 288404945, 251240681 Merged from https://widevine-internal-review.googlesource.com/183630 Merged from https://widevine-internal-review.googlesource.com/183730 Change-Id: I9f6a4045f9b554589e25338accecb0d338fad5ce --- libwvdrmengine/cdm/core/test/keybox_ota_test.cpp | 3 +++ .../oemcrypto/test/oemcrypto_test_android.cpp | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/libwvdrmengine/cdm/core/test/keybox_ota_test.cpp b/libwvdrmengine/cdm/core/test/keybox_ota_test.cpp index 84eec348..fc3c76ee 100644 --- a/libwvdrmengine/cdm/core/test/keybox_ota_test.cpp +++ b/libwvdrmengine/cdm/core/test/keybox_ota_test.cpp @@ -28,6 +28,9 @@ class CdmOtaKeyboxTest : public ::testing::Test { } ::testing::Test::SetUp(); Properties::Init(); + if (wvoec::global_features.provisioning_method != OEMCrypto_Keybox) { + GTEST_SKIP() << "Test for Prov 2.0 devices only."; + } const ::testing::TestInfo* const test_info = ::testing::UnitTest::GetInstance()->current_test_info(); LOGD("Running test %s.%s", test_info->test_case_name(), test_info->name()); diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_test_android.cpp b/libwvdrmengine/oemcrypto/test/oemcrypto_test_android.cpp index 4e3ab9b9..21483957 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_test_android.cpp +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_test_android.cpp @@ -36,6 +36,10 @@ class OEMCryptoAndroidLMPTest : public ::testing::Test { // Android devices must have a keybox, or use provisioning 3.0. TEST_F(OEMCryptoAndroidLMPTest, GetKeyDataImplemented) { + if (global_features.provisioning_method != OEMCrypto_Keybox && + global_features.provisioning_method != OEMCrypto_OEMCertificate) { + GTEST_SKIP() << "Test for Prov 2.0 and 3.0 devices only."; + } uint8_t key_data[256]; size_t key_data_len = sizeof(key_data); if (OEMCrypto_Keybox == OEMCrypto_GetProvisioningMethod()) { @@ -59,6 +63,9 @@ TEST_F(OEMCryptoAndroidLMPTest, MinVersionNumber9) { } TEST_F(OEMCryptoAndroidLMPTest, ValidKeyboxTest) { + if (global_features.provisioning_method != OEMCrypto_Keybox) { + GTEST_SKIP() << "Test for Prov 2.0 devices only."; + } ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_IsKeyboxValid()); } @@ -112,6 +119,9 @@ TEST_F(OEMCryptoAndroidMNCTest, MinVersionNumber10) { // Android devices using Provisioning 2.0 must be able to load a test keybox. // If they are not using Provisioning 2.0, then they must use Provisioning 3.0. TEST_F(OEMCryptoAndroidMNCTest, LoadsTestKeyboxImplemented) { + if (global_features.provisioning_method != OEMCrypto_Keybox) { + GTEST_SKIP() << "Test for Prov 2.0 devices only."; + } if (OEMCrypto_Keybox == OEMCrypto_GetProvisioningMethod()) { ASSERT_EQ( OEMCrypto_SUCCESS,