Bug 237731

Summary: [Cocoa] Add a FairPlay keyserver and EME tests to LayoutTests
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: New BugsAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: calvaris, eric.carlson, ews-watchlist, glenn, jbedard, peng.liu6, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
none
Patch
none
Patch
none
Patch
none
Patch
ews-feeder: commit-queue-
Patch
none
Patch
ews-feeder: commit-queue-
Patch jer.noble: review?, ews-feeder: commit-queue-

Description Jer Noble 2022-03-10 13:44:30 PST
[Cocoa] Add a FairPlay keyserver and EME tests to LayoutTests
Comment 1 Jer Noble 2022-03-10 14:38:24 PST
Created attachment 454402 [details]
Patch
Comment 2 Eric Carlson 2022-03-10 14:54:33 PST
Comment on attachment 454402 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=454402&action=review

> LayoutTests/ChangeLog:23
> +        and persistable licenses. It currently only supports "modern" EME key requests, but acn

s/acn/can/

> LayoutTests/ChangeLog:261
> +2022-03-10  Jer Noble  <jer.noble@apple.com>
> +
> +        [Cocoa] Add a FairPlay keyserver and EME tests to LayoutTests
> +        https://bugs.webkit.org/show_bug.cgi?id=237731
> +
> +        Reviewed by NOBODY (OOPS!).

Double ChangeLog
Comment 3 Jonathan Bedard 2022-03-11 11:42:49 PST
Created attachment 454500 [details]
Patch
Comment 4 Jer Noble 2022-03-13 13:14:42 PDT
Created attachment 454556 [details]
Patch
Comment 5 Jer Noble 2022-03-13 15:05:28 PDT
Created attachment 454558 [details]
Patch
Comment 6 Jer Noble 2022-03-13 23:27:09 PDT
```
[Sun Mar 13 15:35:39.040034 2022] [cgi:error] [pid 847] [client 127.0.0.1:62020] AH01215: ModuleNotFoundError: No module named 'OpenSSL': /Volumes/Data/worker/macOS-Release-WK2-Stress-Tests-EWS/build/LayoutTests/http/tests/media/fairplay/keyserver/index.py, referer: http://127.0.0.1:8000/media/fairplay/fps-mse-unmuxed-multiple-keys.html
```

Looks like we need to auto install the OpenSSL package as well.
Comment 7 Jonathan Bedard 2022-03-14 07:59:44 PDT
Comment on attachment 454558 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=454558&action=review

> LayoutTests/http/tests/media/fairplay/keyserver/keyserver/__init__.py:40
> +    from webkitpy.autoinstalled.cryptography.hazmat.primitives.ciphers import modes

`from webkitpy.autoinstalled import cryptography` should be sufficient for this.

Also, once you do this once, "from cryptography.hazmat.primitives.ciphers import modes" should work.
Comment 8 Jer Noble 2022-03-14 09:19:05 PDT
Created attachment 454595 [details]
Patch
Comment 9 Jer Noble 2022-03-15 17:02:08 PDT
Created attachment 454777 [details]
Patch
Comment 10 Jer Noble 2022-03-16 08:21:01 PDT
Created attachment 454836 [details]
Patch
Comment 11 Jer Noble 2022-03-16 10:08:37 PDT
Getting closer! The key server is now running correctly! Now to investigate the cause of the failing tests. I suspect it's just a harness problem.
Comment 12 Peng Liu 2022-03-16 10:57:47 PDT
Comment on attachment 454836 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=454836&action=review

> LayoutTests/ChangeLog:23
> +        and persistable licenses. It currently only supports "modern" EME key requests, but acn

s/acn/can

> LayoutTests/http/tests/media/fairplay/eme2016.js:15
> +            method: 'POST',

Nit. The indention.

> LayoutTests/http/tests/media/fairplay/fps-hls-key-rotation.html:61
> +                        method: 'POST',

Ditto.

> LayoutTests/http/tests/media/fairplay/fps-hls-update-reject.html:52
> +                method: 'POST',

Ditto.

> LayoutTests/http/tests/media/fairplay/fps-hls.html:53
> +                method: 'POST',

Ditto.

> LayoutTests/http/tests/media/fairplay/fps-init-data-cenc.html:48
> +                    method: 'POST',

Ditto.

> LayoutTests/http/tests/media/fairplay/fps-init-data-sinf.html:45
> +                method: 'POST',

Ditto.

> LayoutTests/http/tests/media/fairplay/keyserver/keyserver/test_DFunction.py:34
> +class TestDFunction(unittest.TestCase):

Will bots run the test? :-)
Comment 13 Jer Noble 2022-03-16 11:41:22 PDT
Created attachment 454868 [details]
Patch
Comment 14 Jer Noble 2022-03-16 12:13:55 PDT
Created attachment 454877 [details]
Patch
Comment 15 Jer Noble 2022-03-16 12:18:41 PDT
Created attachment 454879 [details]
Patch
Comment 16 Xabier Rodríguez Calvar 2022-03-17 00:22:25 PDT
I think there are some changes in this patch that need to be removed as they are unrelated and there is no changelog for them, right?
Comment 17 Jer Noble 2022-03-17 10:55:48 PDT
(In reply to Xabier Rodríguez Calvar from comment #16)
> I think there are some changes in this patch that need to be removed as they
> are unrelated and there is no changelog for them, right?

Yes, I should remove the r? bit on this patch; I changed some of the promise rejections inside MediaKeySession to get more information about why the testes were failing on the stress bot.
Comment 18 Radar WebKit Bug Importer 2022-03-17 14:45:40 PDT
<rdar://problem/90453705>
Comment 19 Jer Noble 2022-03-17 22:12:17 PDT
Okay, the Mac-wk2-stress test bot is failing for a very interesting reason: we leak every RemoteCDMInstanceSessionProxy we create in the GPU Process. So after about 800 tests, FairPlay stops allowing additional sessions to be created. I'll include a fix with the next patch.
Comment 20 Jer Noble 2022-03-20 22:32:46 PDT
Created attachment 455213 [details]
Patch
Comment 21 Jer Noble 2022-03-23 15:03:35 PDT
Created attachment 455565 [details]
Patch
Comment 22 Jer Noble 2022-03-23 16:44:30 PDT
Created attachment 455584 [details]
Patch
Comment 23 Jer Noble 2022-07-27 11:40:44 PDT
Pull request: https://github.com/WebKit/WebKit/pull/2786
Comment 24 EWS 2022-08-08 13:43:34 PDT
Committed 253230@main (809ad82ca6e2): <https://commits.webkit.org/253230@main>

Reviewed commits have been landed. Closing PR #2786 and removing active labels.