From 38243aca4c9e2e385440a49bd0d09ae50cde73f1 Mon Sep 17 00:00:00 2001 From: Fred Gylys-Colwell Date: Wed, 13 Mar 2024 17:23:33 -0700 Subject: [PATCH] Adjust skipping tests when provisioning skipped [ Merge of http://go/wvgerrit/194254 ] For some platforms, we cannot provision. In this case, any test that needs provisioning is skipped. However, when a test is skipped in a subroutine, the rest of SetUp is still run. Any failures in SetUp will cause the test to be marked as a failure. This CL duplicates the check for skipping the test in SetUp and in TearDown. Bug: 329467151 Test: WV and unit/integration tests Change-Id: I0087b12a3f26b52ecf62bf7b0e7bcf4fa2c6c763 --- .../cdm/core/test/duration_use_case_test.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libwvdrmengine/cdm/core/test/duration_use_case_test.cpp b/libwvdrmengine/cdm/core/test/duration_use_case_test.cpp index 7346e510..e9c003ef 100644 --- a/libwvdrmengine/cdm/core/test/duration_use_case_test.cpp +++ b/libwvdrmengine/cdm/core/test/duration_use_case_test.cpp @@ -128,6 +128,12 @@ class CdmDurationTest : public WvCdmTestBaseWithEngine, // appended to it. void SetUp() override { WvCdmTestBase::SetUp(); + // TODO: b/305093063 - Remove when Drm Reprovisioning server is implemented. + if (wvoec::global_features.provisioning_method == + OEMCrypto_DrmReprovisioning) { + GTEST_SKIP() + << "Skipping until Drm Reprovisioning server support is implemented."; + } EnsureProvisioned(); license_holder_.set_can_persist(GetParam()); ASSERT_NO_FATAL_FAILURE(license_holder_.OpenSession()); @@ -152,6 +158,14 @@ class CdmDurationTest : public WvCdmTestBaseWithEngine, } void TearDown() override { + // TODO: b/305093063 - Remove when Drm Reprovisioning server is implemented. + if (wvoec::global_features.provisioning_method == + OEMCrypto_DrmReprovisioning) { + // Since the session was not opened above. We can skip closing the session + // here too. This should be removed when EnsureProvisioning no longer + // skips this test. + return; + } license_holder_.CloseSession(); // Log the time used in this test suite. When this comment was written, // these tests took over three hours. If we want to improve that, we need to