From 225a3e50ede934940980d6ce39894892444eec55 Mon Sep 17 00:00:00 2001 From: Vicky Min Date: Mon, 27 Mar 2023 19:41:56 -0700 Subject: [PATCH] Use GTEST_SKIP to skip prov40 tests Merge from Widevine repo of http://go/wvgerrit/169076 We want to transition to using GTEST_SKIP to skip unit tests instead of modifying the GTEST_FILTER variable. This does so for provisioning 4.0 tests. Bug: 251240681 Merged from https://widevine-internal-review.googlesource.com/167497 Change-Id: I65a879fba24b199bd115980bdd556c123fcc1cdc --- libwvdrmengine/oemcrypto/test/oec_device_features.cpp | 2 -- .../oemcrypto/test/oemcrypto_provisioning_test.h | 9 ++++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libwvdrmengine/oemcrypto/test/oec_device_features.cpp b/libwvdrmengine/oemcrypto/test/oec_device_features.cpp index 5084cc30..28614f20 100644 --- a/libwvdrmengine/oemcrypto/test/oec_device_features.cpp +++ b/libwvdrmengine/oemcrypto/test/oec_device_features.cpp @@ -162,8 +162,6 @@ std::string DeviceFeatures::RestrictFilter(const std::string& initial_filter) { if (!generic_crypto) FilterOut(&filter, "*GenericCrypto*"); if (!supports_cas) FilterOut(&filter, "*CasOnly*"); if (derive_key_method == NO_METHOD) FilterOut(&filter, "*SessionTest*"); - if (provisioning_method != OEMCrypto_BootCertificateChain) - FilterOut(&filter, "*Prov40*"); if (!supports_rsa_3072) FilterOut(&filter, "*RSAKey3072*"); if (api_version < 17) FilterOut(&filter, "*API17*"); if (api_version < 18) FilterOut(&filter, "*API18*"); diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_provisioning_test.h b/libwvdrmengine/oemcrypto/test/oemcrypto_provisioning_test.h index 48e5e8c8..ad47cbaa 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_provisioning_test.h +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_provisioning_test.h @@ -45,7 +45,14 @@ class OEMCryptoProv30Test : public OEMCryptoClientTest { }; // This class is for tests that have boot certificate chain instead of a keybox. -class OEMCryptoProv40Test : public OEMCryptoClientTest {}; +class OEMCryptoProv40Test : public OEMCryptoClientTest { + void SetUp() override { + OEMCryptoClientTest::SetUp(); + if (global_features.provisioning_method != OEMCrypto_BootCertificateChain) { + GTEST_SKIP() << "Test for Prov 4.0 devices only."; + } + } +}; // // Certificate Root of Trust Tests