Closed Bug 1025066 Opened 10 years ago Closed 9 years ago

Support ssl (i.e. https / wss) in web-platform-tests

Categories

(Testing :: web-platform-tests, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla37

People

(Reporter: jgraham, Assigned: jgraham)

References

(Depends on 1 open bug)

Details

Attachments

(3 files, 1 obsolete file)

This should be possible using the same approach that mochitest uses, which aiui is something like installing a fake ca into the temporary profile and using a certificate from that ca for the server processes.
It's *slightly* more involved than that, but that's the right basic premise.

You need the ssltunnel binary from a test package (the right one for your host system) and you need to write a configuration file for it like so:
http://hg.mozilla.org/mozilla-central/annotate/48eee276b1ee/testing/mochitest/runtests.py#l680

You also need the certs/ directory from a test package, that has the prebuilt certificate store with all the testing certs. Then you need to fill the certificate DB in your test profile like so:
http://hg.mozilla.org/mozilla-central/annotate/48eee276b1ee/testing/mochitest/runtests.py#l900

That code already has a comment saying it ought to move to mozprofile, so if you want to use it now might be a good time.

The "locations" stuff that all of this talks about is using this file, which is also in the test package:
http://mxr.mozilla.org/mozilla-central/source/build/pgo/server-locations.txt
Alternately if you wanted to just build your own certificate store, the script that does that is here:
http://mxr.mozilla.org/mozilla-central/source/build/pgo/genpgocert.py

Note that all of this requires some NSS commandline tools for the host system as well.
Attached file Upstream changes
Attachment #8539320 - Flags: review?(ted)
mozharness changes
Attachment #8540072 - Flags: review?(armenzg)
Assignee: nobody → james
Status: NEW → ASSIGNED
Attachment #8540114 - Flags: review?(ted)
/r/1617 - Bug 1025066 - Add certs and mach integration for running web-platform-tests with https.

Pull down this commit:

hg pull review -r 0ae890e02b3b522e2a6e3c7d25e6fe636cfcde82
Comment on attachment 8540072 [details] [diff] [review]
Enable web-platform-tests script to access the certutils binary

Review of attachment 8540072 [details] [diff] [review]:
-----------------------------------------------------------------

::: scripts/web_platform_tests.py
@@ +138,5 @@
>  
>          str_format_values = {
>              'binary_path': self.binary_path,
>              'test_path': dirs["abs_wpttest_dir"],
> +            'test_install_path': dirs["abs_test_install_dir"],

What is this for?
(In reply to Armen Zambrano - Automation & Tools Engineer (:armenzg) from comment #8)
> Comment on attachment 8540072 [details] [diff] [review]
> Enable web-platform-tests script to access the certutils binary
> 
> Review of attachment 8540072 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: scripts/web_platform_tests.py
> @@ +138,5 @@
> >  
> >          str_format_values = {
> >              'binary_path': self.binary_path,
> >              'test_path': dirs["abs_wpttest_dir"],
> > +            'test_install_path': dirs["abs_test_install_dir"],
> 
> What is this for?

I need to get at the bin/ directory from the in-tree configs so that I can pass the location of the certutil binary to wptrunner (see the mozreview review on this bug).
Attachment #8540072 - Flags: review?(armenzg) → review+
Attachment #8540114 - Flags: review?(ted) → review+
https://reviewboard.mozilla.org/r/1615/#review1275

::: testing/web-platform/mach_commands.py
(Diff revision 1)
> +                kwargs["host_cert_path"] = os.path.join(here, "certs", "web-platform.test.pem")

I definitely wish there was a nicer way to set these defaults on the options parser, and even to not expose these as commandline options at all for the mach command (since there's no reason to change the defaults when running on a local build), but your existing code that shares the commandline parser with the harness is better than most of our harnesses already so I don't have a great suggestion.
Attachment #8539320 - Flags: review?(ted) → review+
Depends on: 1123182
Attachment #8540114 - Attachment is obsolete: true
Attachment #8618173 - Flags: review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: