Commit Graph

1042 Commits

Author SHA1 Message Date
Fred Gylys-Colwell
b60f75805d Unify log level for tests
Merge from Widevine repo of http://go/wvgerrit/79463 and
http://go/wvgerrit/82383

Several tests explicitly set the log level. This CL unifies that a
little bit. When running the unit tests by hand, on android or for ce
cdm, the log level is 0 (ERROR) and can be incremented on the command
line using the "--verbose" switch.

When running on the desktop, you can set the environment variable
VERBOSE_LOG to "yes", and the log level is set to VERBOSE.  This is
done by the buildbot so you can see full logs in the build archive.

When running with the test bed (i.e. Mod Mock) you can edit the
options.txt file and set log_level to 0=ERROR up to 4=VERBOSE. if you
are using the run_current_tests script, you can create a file in the
linux directory called override_options.txt and add the line
log_level 4

This CL only changes test code.

bug: 124390006
Test: unit tests
Change-Id: I1e042004692750e218b8c4220bce3ec1e387004e
2019-07-10 14:02:45 -07:00
Alex Dale
7c6572a39e Merge "Log cleanup and reformatting for core/ (part 1)" 2019-07-10 01:26:16 +00:00
Rahul Frias
e3f8bd50a6 Merge changes I5beacece,Iadb3cc57
* changes:
  Address request license test failures
  Support CE CDM in OEMCrypto Testbed
2019-07-09 21:26:50 +00:00
Rahul Frias
57f2a7fe31 Address request license test failures
[ Merge of http://go/wvgerrit/81743 and http://go/ag/7747989 ]

This fixes some failures in tests. A platform property has been added
which controls whether an offline license can be restored if a release
request has been previously made. This behaviour was introduced by
CE CDM in b/113167010 but is not permitted for android.

The tests failures addressed are
* ProvisioningTestWithServiceCertificate
* ReleaseRetryOfflineKeyTest
* ReleaseRetryL3OfflineKeyTest
* ReleaseRetryL3OfflineKeySessionUsageDisable

Bug: 119428680
Bug: 133684744
Test: WV unit/integration tests
Change-Id: I5beacecea32f26c8a319a6d73a45cc36f04d8aa1
2019-06-28 14:10:01 -07:00
Alex Dale
fc31b3ef2a Formatted WV utils/src files.
[ Merge of http://go/wvgerrit/80944 ]

Ran `git clang-format` on files in utils/src.

Used the new .clang-format config.

Bug: 134365840
Test: WV unit tests
Change-Id: Idbba01ec65fc019327fc59dc1d95d7cefa4a5aa7
2019-06-27 13:49:48 -07:00
Alex Dale
906dc12c5d Formatted WV utils/include files.
[ Merge of http://go/wvgerrit/80943 ]

Ran `git clang-format` on files in utils/include.
Used the new .clang-format config.

Bug: 134365840
Test: WV unit tests
Change-Id: Ifc0950236ecd610792e9add11ac07c63485f3f0c
2019-06-27 13:42:10 -07:00
John W. Bruce
435f839f7e Support CE CDM in OEMCrypto Testbed
(This is a merge of http://go/wvgerrit/81628. Although it is primarily
to support a CE CDM feature, this patch touched shared code and so must
be merged.)

The problem that has long stopped the OEMCrypto Testbed from working
with the CE CDM build is that the OEMCrypto Testbed sometimes accesses
the storage via the normal filesystem APIs rather than the FileSystem
abstraction. Furthermore, when doing this, it assumes that FileSystem
abstraction is just a wrapper around direct filesystem access and thus
it should use the same paths in both kinds of filesystem access.
However, this is not true on the CE CDM where FileSystem wraps an opaque
key/value store.

This patch adds a property that allows a platform to indicate if its
FileSystem base path represents a real file system path and sets it
appropriately. ("true" for all platforms except CE CDM) It also adds
code to the OEMCrypto Testbed that makes use of this property to modify
its behavior. When running on a device where the FileSystem base path is
not a real file system path, it will instead use the directory of the
current executable as its base path when accessing the filesystem
directly.

Bug: 129311942
Test: CE CDM Build with Fake L1
Test: Android Build
Change-Id: Iadb3cc57d3bbc8ce0d49224b7df31c46bd5ea56c
2019-06-24 11:52:23 -07:00
Alex Dale
cbc1fba713 Log cleanup and reformatting for core/ (part 1)
Merge from Widevine repo of http://go/wvgerrit/81265

Types of cleanup:
  - Removed function / class prefixes from the logs.
  - Fixed log string format options to match the types passed
  - Added static_cast conversion on enumerations
  - _Tried_ to make the log format more consistent (open to feedback)
  - Corrected small spelling mistakes

This set of changes is very large, splitting change across several
submissions.  This change:
  - core/src/buffer_reader.cpp
  - core/src/cdm_engine.cpp
  - core/src/cdm_session.cpp

Test: WV linux unittests
Bug: 134460638
Change-Id: I16c3297b8e94a99c2b8650b129d0f9e8d96b177f
2019-06-21 17:23:58 -07:00
Rahul Frias
6004c2a945 Ref count WvCdmDecryptionModule in cdm_extended_duration_tests
[ Merge of http://go/wvgerrit/79884 ]

WvCdmDecryptionModule needs to be refcounted since it inherits
from RefBase. The test code instantiates it as a member variable.

Bug: 133188706
Test: WV unit/integration tests
Change-Id: I8ae3d92ae148677ea9a8290a6c0553c1a43e3454
2019-06-19 11:02:28 -07:00
Alex Dale
96c36fa25e Merge "Replace typedef with using statement in cdm/core/ files." 2019-06-10 15:44:00 +00:00
Alex Dale
ce0ea7b20b Replace typedef with using statement in cdm/core/ files.
[ Merge of http://go/wvgerrit/80805 ]

This change was used only where `typedef` was used for type aliasing,
and not for defining a new type (such as enums, structs, or function
pointer types).

Clang-format was used on the changed files.

Test: WV unit tests
Bug: 134437705
Change-Id: I730b9709a5ac773b3036daa79024caab665b3daa
2019-06-07 11:17:45 -07:00
Srujan Gaddam
6d196d8496 Change prov retry test to use prov models
Bug: b/133641240
Tests: ProvisioningInterspersedRetryTest L3 & modmock
Merge of http://go/wvgerrit/80164

The ProvisioningInterspersedRetryTest tests that the response tied to
the provisioning request before the latest fails to be handled. This is
only true for provisioning 2.0 where we use derived keys. In
provisioning 3.0, the number of requests allowed to be handled is tied
to the number of nonces, which from OEMCrypto v15.2 onwards, is exactly
4. This CL modifies the test to handle that behavior.

Change-Id: I9f4e555acab145487d6e409779afe7b9b63fd4af
2019-06-07 09:43:15 -07:00
Srujan Gaddam
dcf3f21289 Add query to CDM to get provisioning model
Bug: b/133855570
Tests: Android tests/CE CDM tests/Linux tests
Merge of http://go/wvgerrit/80163

Adds a query option to QueryStatus to get the provisioning model of the
OEMCrypto.

Change-Id: I1896984be6294a5ada9a97b63e6d9080297e92b0
2019-06-07 09:40:59 -07:00
Rahul Frias
a178eed57d Reformat wv core/src files
[ Merge of http://go/wvgerrit/80484 ]

Clang-format has been run on files in core/src. clang-format has been turned
off for some blocks but otherwise no other changes have been made.

Bug: 134365840
Test: WV unit/integration tests
Change-Id: I6e509f25136f84d37de3d920084302f0f2c23dc4
2019-06-04 11:26:18 -07:00
Rahul Frias
47c2068d6a Reformat wv core/include files
[ Merge of http://go/wvgerrit/80483 ]

Clang-format has been run on files in core/include

Bug: 134365840
Test: WV unit/integration tests
Change-Id: I890127f23f30f0e63f826d3638521b4cc12fb995
2019-06-03 13:53:31 -07:00
Rahul Frias
74d7819374 Address request license test failures [ DO NOT MERGE ] am: b7c6f9b52c
am: 1d05cf8e0d

Change-Id: Ia534ee9e981f2d6ea4acb23a41e433baed071c8f
2019-06-01 18:13:45 -07:00
Rahul Frias
1d05cf8e0d Address request license test failures [ DO NOT MERGE ]
am: b7c6f9b52c

Change-Id: Id3616ea5bae789c2cdb2135cfdb92495c69536e0
2019-06-01 17:56:55 -07:00
John W. Bruce
1d5b7cc8fe Take a Global Write Lock Before Calling OEMCrypto_GenerateNonce()
(This is a merge of http://go/wvgerrit/77803)

In OEMCrypto 15.2, OEMCrypto_GenerateNonce() is a Session Initialization
Function, which means the global OEMCrypto lock must be held before
calling it. There's no harm updating our code to behave this way now,
even before OEMCrypto 15.2 implementations are ready, since it's a
stricter guarantee than the current behavior.

Bug: 131327826
Test: CE CDM Unit Tests
Test: Android Unit Tests
Change-Id: Icb6a86dea7298c99596fa9e3d90cec721ebcb8a6
2019-05-31 19:02:29 -07:00
Rahul Frias
6c9c4697f0 Merge "Return key request type none after key rotation" into qt-dev am: 999a466275 am: 4690da2bcb
am: 4c9a3a6f02

Change-Id: Iddcac699401f64d920fcb8ff73053410019ec028
2019-05-31 09:55:31 -07:00
Rahul Frias
4c9a3a6f02 Merge "Return key request type none after key rotation" into qt-dev am: 999a466275
am: 4690da2bcb

Change-Id: I45387edbb83f05dcadec53e4514cb97c68eae6c7
2019-05-31 09:33:36 -07:00
Rahul Frias
999a466275 Merge "Return key request type none after key rotation" into qt-dev 2019-05-31 15:55:05 +00:00
Rahul Frias
b271da5139 Merge "WvCdmExtendedDurationTest#VerifyLicenseRequestTest fixes" into qt-dev am: e4d432806a am: 785cd12f3c
am: 09e2b6dfa6

Change-Id: I5b1757fee7311a2d34ea5299ec900421dc160634
2019-05-29 19:30:56 -07:00
Rahul Frias
09e2b6dfa6 Merge "WvCdmExtendedDurationTest#VerifyLicenseRequestTest fixes" into qt-dev am: e4d432806a
am: 785cd12f3c

Change-Id: Ic2853252157390f93d2c6cc9406361feb7696d99
2019-05-29 19:24:33 -07:00
Rahul Frias
b7c6f9b52c Address request license test failures [ DO NOT MERGE ]
[ Merge of http://go/wvgerrit/79883 ]

This corrects test code and undoes CE CDM changes in b/113167010 which
will be resolved in a future release.

The tests failures addressed are
* ProvisioningTestWithServiceCertificate
* ReleaseRetryOfflineKeyTest
* ReleaseRetryL3OfflineKeyTest
* ReleaseRetryL3OfflineKeySessionUsageDisable

ProvisioningInterspersedRetryTest has been disabled and will be
addressed in a post 15.2 OEMCrypto release in 133641240

Bug: 119428680
Test: WV unit/integration tests
Change-Id: I7961b4556a0ac749e4f38d43f1bea8f520d67f20
2019-05-29 19:04:52 -07:00
Rahul Frias
3c9175fec5 Return key request type none after key rotation
[ Merge of http://go/wvgerrit/80084 ]

Corrected the key type being returned after entitled keys from
init data are loaded. Made test changes to validate.

Bug: 133903028
Test: WV unit/integration tests
Change-Id: Icb44587f5c3aba3b0facae6d83dc9344d6b60833
2019-05-29 19:03:43 -07:00
Rahul Frias
80b8e29c3f WvCdmExtendedDurationTest#VerifyLicenseRequestTest fixes
[ Merge of http://go/wvgerrit/79724 ]

Bug: 122982573
Test: WV unit/integration tests
Change-Id: Icb7b192311dc6bbe630d96f993ccca774160774b
2019-05-22 18:12:06 -07:00
Haibo Huang
e3e086e3f8 Using ::testing::DoAll
Without this statement, compilation failed with new googletest.

Test: build
Bug: 129498355
Change-Id: I9eb7b7a2634f20ef80a23b75c06fc84a2fa52dc3
(cherry picked from commit 9055e93a70)
2019-05-22 17:38:58 +00:00
Rahul Frias
9900ce909b Merge "Ref count WvCdmDecryptionModule" 2019-05-22 14:28:02 +00:00
Fred Gylys-Colwell
aa7f7d3ac4 Remove test keybox one more time
Merge from Widevine repo of http://go/wvgerrit/78883

Bug: 119316243
Test: unit tests
Change-Id: Ic6748a6e020c2a4058510fb5c6c5a821e57cc5fd
2019-05-22 00:25:56 +00:00
Rahul Frias
776996d6d2 Ref count WvCdmDecryptionModule
[ Merge of http://go/wvgerrit/78803 ]

WvCdmDecryptionModule needs to be refcounted since it inherits
from RefBase. The test code instantiates it as a member variable.

Bug: 133188706
Test: WV unit/integration tests
Change-Id: Ib41f3477a55923fb4cc26472e42d3e18eb2b84d4
2019-05-21 11:41:52 -07:00
Haibo Huang
c19f8867c0 Merge "Using ::testing::DoAll" 2019-05-20 00:19:13 +00:00
Haibo Huang
9055e93a70 Using ::testing::DoAll
Without this statement, compilation failed with new googletest.

Test: build
Bug: 129498355
Change-Id: I9eb7b7a2634f20ef80a23b75c06fc84a2fa52dc3
2019-05-20 00:18:22 +00:00
Rahul Frias
1ae3ff21e8 Merge "Correct android version number in test" into qt-dev am: 48650f74ab am: 5b3a43b17c
am: 766a15693a

Change-Id: I95a665e2eedeacea6d8ad1b676f8bd3757ddb76c
2019-05-18 04:00:21 -07:00
Robert Shih
fe8924f814 Add CdmKeyStatus kKeyStatusUsableInFuture am: 69c8f488ca am: 6a329e6c9a
am: e6ba3ec747

Change-Id: Iee17c92d9a3f3fd390e05bb0324ba04861236210
2019-05-16 20:07:33 -07:00
Rahul Frias
4f273991b9 Correct android version number in test
[ Merge of http://go/wvgerrit/79144 ]

Bug: 132908020
Test: WV unit/integration tests
Change-Id: Idf5cf3e1e886af3bfed157320fa09d66dfa55c0d
2019-05-16 14:44:40 -07:00
Fred Gylys-Colwell
e4c7bc38f8 Address review comments for OEMCrypto Build Information
Merge of http://go/wvgerrit/78683

There were some review comments in http://go/wvgerrit/78683 that came
in after the code was merged to the qt-dev branch.  This CL addresses
them on the master branch.

Test: unit tests.
Bug: 129070445
2019-05-16 18:32:16 +00:00
Robert Shih
69c8f488ca Add CdmKeyStatus kKeyStatusUsableInFuture
Bug: 116738851
Test: unit tests
Change-Id: I49728788e57905806b72e891f3654fbf0c8b1bc0
2019-05-15 15:16:05 -07:00
Rahul Frias
090d9d409b Merge "Ref count Timer implementation" into qt-dev am: ed833222a6
am: 389d917e88

Change-Id: Ie51744931c38b5e4b0bc8110b07fee9d229870f9
2019-05-13 14:23:19 -07:00
Rahul Frias
ed833222a6 Merge "Ref count Timer implementation" into qt-dev 2019-05-13 20:24:45 +00:00
Rahul Frias
c9c3e6ab6f Merge "Single PSSH entitlement handling" into qt-dev am: 19c6e57269
am: f13e62fbe3

Change-Id: Ib06c9f6606fab960a132d1fb0876108cd7513c2d
2019-05-13 09:49:41 -07:00
Rahul Frias
f1bb063682 Merge "Key Status should reflect key container security level" into qt-dev am: 80f5e283ad
am: 555d7cdc83

Change-Id: Ib3c97a96e8482fafc888d71780daa047cc6428ac
2019-05-13 09:49:24 -07:00
Rahul Frias
19c6e57269 Merge "Single PSSH entitlement handling" into qt-dev 2019-05-13 16:26:16 +00:00
Rahul Frias
80f5e283ad Merge "Key Status should reflect key container security level" into qt-dev 2019-05-13 16:25:24 +00:00
Rahul Frias
4d917e3ee8 Ref count Timer implementation
[ Merge of http://go/wvgerrit/78763 ]

The android timer instance is held by a regular pointer rather
than reference counted as all classes that derive from RefBase
should be. This could result in a double deallocation, if the
timer is ever passed to a strong pointer.

Bug: 79364026
Test: WV unit/integration tests. GtsMediaTestCases. Play movies
      playback tests.

Change-Id: I01f622bc045e1012f2240b3775a6d121f9415463
2019-05-12 02:15:12 -07:00
Fred Gylys-Colwell
878e39c740 Report OEMCrypto Build Information in License Request am: 5ee5d00514
am: 23c3bc8ebc

Change-Id: I1006614f9eadc97e9287816723ec179851bf2e67
2019-05-10 06:30:12 -07:00
Rahul Frias
7d78609548 Key Status should reflect key container security level
[ Merge of http://go/wvgerrit/77506 ]

Callers of MediaDrm can register to be notified when key status
changes and if they are usable for decryption. A number of factors
are evaluated when making this determination. Key container security
level will now be included in the evaluation.

Bug: 78652608
Test: WV unit/integration test, GtsMediaDrmTest, Play movies playback
      testing.

Change-Id: I20243e5cb160f7957e3239e8d05f715ff0ee6dd6
2019-05-09 22:16:23 -07:00
Fred Gylys-Colwell
5ee5d00514 Report OEMCrypto Build Information in License Request
Merge from Widevine repo of http://go/wvgerrit/78623

This updates the license request client identification to include
OEMCrypto build information.

Bug: 129070445
Test: ExoPlayer on crosshatch with mod mock
Change-Id: I0dbce0cca4e9810e14f60561e4e434f1dbcadfb6
2019-05-09 13:24:04 -07:00
Adam Stone
c653a9dadc Merge "Correctly sets provisioning state for test." into qt-dev am: c71fb10b95
am: c47c1d7575

Change-Id: Ibad16685c1b1c2e25e73cbe3d4fb7430fc1c31df
2019-05-08 18:32:29 -07:00
Adam Stone
3a27d2d649 Correctly sets provisioning state for test.
[ Merge from http://go/wvgerrit/78383 ]

Bug: http://b/121049662

Test: Re-ran the unit test.
Change-Id: I62c00f425c93b588e123ddd8b1093177f2e9b241
2019-05-08 14:13:28 -07:00
Rahul Frias
da25bce428 Single PSSH entitlement handling
[ Merge of http://go/wvgerrit/78425 ]

This CL refactors code, corrects comments and adds additional
integration tests.

Bug: 128462397
Test: WV unit/integration tests, GPlay playback tests and GtsMediaDrmTests
Change-Id: I679960d44c45cf4ff13c27eb960e66ec63f491b5
2019-05-07 23:07:05 -07:00