Update tests for license release
Merge from Widevine repo of http://go/wvgerrit/95403 This updates the test code CreateDefaultResponse to make sure that license releases do not have a core message, and that the key control block is correctly set for renewals. Also, the unit test OEMCryptoUsageTableTest.TimingTest is changed to only a license release when the license is inactive. If the license is still active, then the license is loaded before generating a usage report. Test: Ran full unit tests Bug: 151092673 Change-Id: I7c01fd17f9b66e88ab3c57aa0f3d40740f13507c
This commit is contained in:
@@ -1694,15 +1694,15 @@ class OEMCryptoSessionTestDecryptWithHDCP : public OEMCryptoSessionTests,
|
||||
// reported if OEMCrypto_WARNING_MIXED_OUTPUT_PROTECTION is expected.
|
||||
ASSERT_NO_FATAL_FAILURE(
|
||||
s.TestDecryptCTR(true, OEMCrypto_WARNING_MIXED_OUTPUT_PROTECTION))
|
||||
<< "Failed when current HDCP = " << HDCPCapabilityAsString(current)
|
||||
<< ", maximum HDCP = " << HDCPCapabilityAsString(maximum)
|
||||
<< ", license HDCP = " << HDCPCapabilityAsString(version);
|
||||
<< "Failed when current HDCP = " << HDCPCapabilityAsString(current)
|
||||
<< ", maximum HDCP = " << HDCPCapabilityAsString(maximum)
|
||||
<< ", license HDCP = " << HDCPCapabilityAsString(version);
|
||||
} else {
|
||||
ASSERT_NO_FATAL_FAILURE(
|
||||
s.TestDecryptCTR(true, OEMCrypto_ERROR_INSUFFICIENT_HDCP))
|
||||
<< "Failed when current HDCP = " << HDCPCapabilityAsString(current)
|
||||
<< ", maximum HDCP = " << HDCPCapabilityAsString(maximum)
|
||||
<< ", license HDCP = " << HDCPCapabilityAsString(version);
|
||||
<< "Failed when current HDCP = " << HDCPCapabilityAsString(current)
|
||||
<< ", maximum HDCP = " << HDCPCapabilityAsString(maximum)
|
||||
<< ", license HDCP = " << HDCPCapabilityAsString(version);
|
||||
}
|
||||
} else {
|
||||
ASSERT_NO_FATAL_FAILURE(s.TestDecryptCTR(true, OEMCrypto_SUCCESS))
|
||||
@@ -2804,7 +2804,8 @@ TEST_F(OEMCryptoLoadsCertificate, CertificateProvisionBadRSAKey) {
|
||||
|
||||
// Test that RewrapDeviceRSAKey verifies the RSA key is valid.
|
||||
// TODO(b/144186970): This test should also run on Prov 3.0 devices.
|
||||
TEST_F(OEMCryptoLoadsCertificate, CertificateProvisionBadRSAKeyKeyboxTestAPI16) {
|
||||
TEST_F(OEMCryptoLoadsCertificate,
|
||||
CertificateProvisionBadRSAKeyKeyboxTestAPI16) {
|
||||
Session s;
|
||||
ProvisioningRoundTrip provisioning_messages(&s, encoded_rsa_key_);
|
||||
provisioning_messages.PrepareSession(keybox_);
|
||||
@@ -6065,17 +6066,10 @@ TEST_P(OEMCryptoUsageTableTest, TimingTest) {
|
||||
ASSERT_NO_FATAL_FAILURE(s2.close());
|
||||
|
||||
ASSERT_NO_FATAL_FAILURE(s1.open());
|
||||
ASSERT_NO_FATAL_FAILURE(s2.open());
|
||||
ASSERT_NO_FATAL_FAILURE(s3.open());
|
||||
ASSERT_NO_FATAL_FAILURE(entry1.ReloadUsageEntry());
|
||||
ASSERT_NO_FATAL_FAILURE(entry2.ReloadUsageEntry());
|
||||
ASSERT_NO_FATAL_FAILURE(entry3.ReloadUsageEntry());
|
||||
// Sending a release from an offline license that has been deactivate will
|
||||
// only work if the license server can handle v16 licenses. This is a rare
|
||||
// condition, so it is OK to break it during the transition months.
|
||||
entry1.license_messages().set_api_version(global_features.api_version);
|
||||
entry2.license_messages().set_api_version(global_features.api_version);
|
||||
entry3.license_messages().set_api_version(global_features.api_version);
|
||||
ASSERT_NO_FATAL_FAILURE(entry2.OpenAndReload(this));
|
||||
ASSERT_NO_FATAL_FAILURE(entry3.OpenAndReload(this));
|
||||
|
||||
wvcdm::TestSleep::Sleep(kLongSleep);
|
||||
ASSERT_NO_FATAL_FAILURE(s1.UpdateUsageEntry(&encrypted_usage_header_));
|
||||
ASSERT_NO_FATAL_FAILURE(entry1.GenerateVerifyReport(kInactiveUsed));
|
||||
|
||||
Reference in New Issue
Block a user