From 95ff0f14fde32070ff3fd6844f66a41ece7505f8 Mon Sep 17 00:00:00 2001 From: Rahul Frias Date: Mon, 2 Nov 2020 01:29:38 -0800 Subject: [PATCH] Skip LicenseRenewalSpecifiedServer for local license server Merge of http://go/wvgerrit/105063 When running the local license server, the license does not contain a URL for the renewal, or it is mangled. We only need to run this test if we are running against UAT or UAT Nightly. Bug: only found when debugging Test: Ran tests with local license server Change-Id: Ic84fcf9033b945a176119639a21104e4d42258a9 --- libwvdrmengine/cdm/core/test/cdm_engine_test.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libwvdrmengine/cdm/core/test/cdm_engine_test.cpp b/libwvdrmengine/cdm/core/test/cdm_engine_test.cpp index 115d760c..270a52b6 100644 --- a/libwvdrmengine/cdm/core/test/cdm_engine_test.cpp +++ b/libwvdrmengine/cdm/core/test/cdm_engine_test.cpp @@ -405,7 +405,18 @@ TEST_F(WvCdmEngineTest, LicenseRenewalSpecifiedServer) { VerifyNewKeyResponse(config_.license_server(), config_.client_auth()); GenerateRenewalRequest(); - VerifyRenewalKeyResponse(server_url_, config_.client_auth()); + if (!server_url_.empty()) { + // If the license server put a URL for the renewal in the license, we should + // be able to verify the renewal against that server. + VerifyRenewalKeyResponse(server_url_, config_.client_auth()); + } else { + // If the license server did not give us a URL, we won't verify it. + LOGE("License server did not set renewal URL. license_url=%s.", + config_.license_server().c_str()); + // This is OK when you are using a local, debug, license server, but it + // should NOT happen if using UAT or UAT nightly. + EXPECT_EQ(std::string::npos, config_.license_server().find("proxy.uat")); + } } // This test generates a renewal and then requests the renewal from the same