Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce test infrastructure for QuicTransport #22844

Merged
merged 18 commits into from
May 12, 2020
Merged

Conversation

yutakahirano
Copy link
Contributor

@yutakahirano yutakahirano commented Apr 10, 2020

This change introduces test infrastructure for
QuicTransport.
See also: https://github.com/web-platform-tests/rfcs/blob/master/rfcs/quic.md

tools/quic contains the test server and files needed by the server such as certificate files.
tools/quic/quic_transport_server.py is based on
https://github.com/aiortc/aioquic/blob/master/examples/http3_server.py.

webtransport/quic contains a test example. It also contains a sample custom handler.

This change doesn't contain a means to run the QuicTransport server automatically.

Tracking issue: #19114

@yutakahirano
Copy link
Contributor Author

@Hexcles, what do you think about this?

@ricea @aboba @vasilvv: Can you take a look at the webtransport/quic part?

I tested this with manually running the server,

$ python3 tools/quic/quic_transport_server.py --certificate tools/quic/certs/leaf_cert.pem --port=8983 --private-key=tools/quic/certs/leaf_cert.key --handlers-path=webtransport/quic/handlers

...and giving additional command line flags to Chrome.

  • --enable-quic
  • --quic-version=h3-25
  • --origin-to-force-quic-on=web-platform.test:8983
  • --ignore-certificate-errors-spki-list=NkfjIFsVoBC1WJSWcwLhG9BslR544io9SI2oeLbvA7I=

@yutakahirano
Copy link
Contributor Author

@vasilvv: I'd appreciate your review on quic_transport_server.py too.

@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-22844 April 10, 2020 08:49 Inactive
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-22844 April 10, 2020 10:14 Inactive
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-22844 April 13, 2020 04:34 Inactive
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-22844 April 13, 2020 05:08 Inactive
webtransport/quic/client-indication.any.js Outdated Show resolved Hide resolved
webtransport/quic/client-indication.any.js Outdated Show resolved Hide resolved
webtransport/quic/client-indication.any.js Outdated Show resolved Hide resolved
webtransport/quic/client-indication.any.js Outdated Show resolved Hide resolved
webtransport/quic/handlers/client-indication.quic.py Outdated Show resolved Hide resolved
async def notify(connection):
_, writer = await connection.create_stream(is_unidirectional=True)
writer.write(b'PASS')
writer.write_eof()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is connection ever closed? Do we need to close it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not closed, and I don't think it needs to be closed in this case.

@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-22844 April 14, 2020 06:59 Inactive
Copy link
Member

@Hexcles Hexcles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm preparing the infra code:
#23075 sets up the venv
#23078 fixes the tests

There's going to be a small number of merge conflicts but hopefully tests will pass after they land.

tools/quic/requirements.txt Outdated Show resolved Hide resolved
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-22844 April 20, 2020 11:39 Inactive
@Hexcles
Copy link
Member

Hexcles commented Apr 21, 2020

I'm preparing the infra code:
#23075 sets up the venv
#23078 fixes the tests

There's going to be a small number of merge conflicts but hopefully tests will pass after they land.

Both PRs have landed! @yutakahirano could you do a git merge --squash master on your branch? Hopefully this will eliminate the lint errors.

@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-22844 April 30, 2020 09:40 Inactive
@yutakahirano
Copy link
Contributor Author

Sorry for the late response. This now pass checks.

For the certificate issue I filed aiortc/aioquic#89.

@ricea @aboba @vasilvv do you have more review comments?

Copy link
Contributor

@vasilvv vasilvv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with exception of one minor comment.

tools/quic/quic_transport_server.py Show resolved Hide resolved
Copy link
Contributor

@ricea ricea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@Hexcles Hexcles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great!

@@ -0,0 +1,12 @@
To generate cert.key and cert.pem:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, once aiortc/aioquic#89 is fixed, we can use web-platform.test.{key,pem} directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do that.

An implication is that the QUIC server will be relatively self contained, without dependencies on other modules in wpt that are currently Python 2-only.

https://github.com/web-platform-tests/rfcs/blob/master/rfcs/quic.md

does not apply to certificate files, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's OK to use the cert in tools/cert. We could perhaps keep the certs in tools/quic/certs as well but only as a fallback.

)
try:
loop.run_forever()
except KeyboardInterrupt:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: is there any cleanup that's required? Like releasing the port?

If so, we'd also need to catch SIGTERM and SIGINT (which is different from KeyboardInterrupt, which I think is only raised after interactive Ctrl-C), and exit gracefully.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yutakahirano I took a look and I don't think any cleanup is needed here. There's no subprocess, and the UDP port gets released almost immediately if the process is killed (unlike TCP ports).

Copy link
Member

@Hexcles Hexcles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we still haven't got a new aioquic release yet. Nonetheless, I'm going to merge this PR for now so that I can build some final pieces of intergration.

@Hexcles Hexcles merged commit 512cf24 into master May 12, 2020
@Hexcles Hexcles deleted the yhirano/quic-server branch May 12, 2020 21:13
@yutakahirano
Copy link
Contributor Author

Sorry for the late response, and thank you for merging this. I'll address the remaining comments in followup PRs.

yutakahirano added a commit that referenced this pull request May 20, 2020
yutakahirano added a commit that referenced this pull request May 20, 2020
* [QuicTransport] Address comments in pull/22844

Address comments provided in
#22844.
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request May 27, 2020
…/22844, a=testonly

Automatic update from web-platform-tests
[QuicTransport] Address comments in pull/22844 (#23705)

* [QuicTransport] Address comments in pull/22844

Address comments provided in
web-platform-tests/wpt#22844.
--

wpt-commits: 6e5e590ef6d34a2cdbc04bbc493d34e482db1d77
wpt-pr: 23705
xeonchen pushed a commit to xeonchen/gecko that referenced this pull request May 27, 2020
…/22844, a=testonly

Automatic update from web-platform-tests
[QuicTransport] Address comments in pull/22844 (#23705)

* [QuicTransport] Address comments in pull/22844

Address comments provided in
web-platform-tests/wpt#22844.
--

wpt-commits: 6e5e590ef6d34a2cdbc04bbc493d34e482db1d77
wpt-pr: 23705
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants