Update cdm provision tests to work with prov 4

[ Merge of http://go/wvgerrit/150810 ]

This CL changes the call "Provision()" in some tests to use
"EnsureProvisioned()". The latter can actually call "Provision()" twice
in case of Prov 4 being used: first call to get oemcert.bin and second
call to get drm cert.bin.

Also added a file clean up during test tear-down.

Test: opk_ta with prov2 and prov4
Bug: 180530495
Bug: 236317198
Change-Id: I37c8708ead7f18e8b4d619bf6a080424e45406ee
This commit is contained in:
Alex Dale
2022-06-21 15:34:12 -07:00
parent 577ce88cbc
commit 1c96d290bd

View File

@@ -2,7 +2,7 @@
// source code may only be used and distributed under the Widevine License
// Agreement.
// These tests are for the cdm engine, and code below it in the stack. In
// particular, we assume that the OEMCrypo layer works, and has a valid keybox.
// particular, we assume that the OEMCrypto layer works, and has a valid keybox.
// This is because we need a valid RSA certificate, and will attempt to connect
// to the provisioning server to request one if we don't.
@@ -65,7 +65,7 @@ class WvCdmEnginePreProvTest : public WvCdmTestBaseWithEngine {
CdmResponseType status = cdm_engine_.OpenSession(
config_.key_system(), nullptr, nullptr, &session_id_);
if (status == NEED_PROVISIONING) {
Provision();
EnsureProvisioned();
status = cdm_engine_.OpenSession(config_.key_system(), nullptr, nullptr,
&session_id_);
}
@@ -335,20 +335,22 @@ TEST_F(WvCdmEngineTest, SetLicensingServiceInvalidCertificate) {
NO_ERROR);
};
TEST_F(WvCdmEnginePreProvTestStaging, ProvisioningTest) { Provision(); }
TEST_F(WvCdmEnginePreProvTestStaging, ProvisioningTest) { EnsureProvisioned(); }
TEST_F(WvCdmEnginePreProvTestUatBinary, ProvisioningTest) { Provision(); }
TEST_F(WvCdmEnginePreProvTestUatBinary, ProvisioningTest) {
EnsureProvisioned();
}
// Test that provisioning works.
TEST_F(WvCdmEngineTest, ProvisioningTest) { Provision(); }
TEST_F(WvCdmEngineTest, ProvisioningTest) { EnsureProvisioned(); }
// Test that provisioning works, even if device is already provisioned.
TEST_F(WvCdmEngineTest, ReprovisioningTest) {
// Provision once.
Provision();
EnsureProvisioned();
// Verify that we can provision a second time, even though we already
// provisioned once.
Provision();
EnsureProvisioned();
}
TEST_F(WvCdmEngineTest, BaseIsoBmffMessageTest) {