A conformance testing tool for HTTP/2 implementation.
Перейти к файлу
Moto Ishizawa d99d171711 Bump version 2017-03-28 20:39:52 +09:00
client h2specd: Moved handshaking into tests 2017-03-07 16:53:39 +08:00
cmd/h2spec Use non-zero return code when tests fail 2017-03-28 20:37:17 +09:00
config Update log message 2017-03-01 15:18:15 +08:00
generic Change the dynamic table size to be sent to 128 2017-02-01 20:08:55 +09:00
hpack Revert: Use index 126 instead of 70 2017-02-01 20:06:24 +09:00
http2 Set the payload length appropriately 2017-03-11 22:42:40 +09:00
log Add comments 2017-01-22 23:58:37 +09:00
reporter Support test case filter like h2spec do 2017-03-01 17:54:00 +08:00
spec h2specd: Moved handshaking into tests 2017-03-07 16:53:39 +08:00
.gitignore Used port-based instaed of path-based, so that we could test more situation 2017-02-27 15:09:27 +08:00
.travis.yml Do not cache vendor on Travis CI 2017-01-23 00:01:37 +09:00
Dockerfile Remove argument from ENTRYPOINT in Dockerfile 2017-02-01 20:36:47 +09:00
LICENSE Add LICENSE 2014-12-03 23:32:51 +09:00
Makefile Bump version 2017-03-28 20:39:52 +09:00
README.md Add link to Docker Hub 2017-01-25 19:13:28 +09:00
glide.yaml Update dependencies 2017-01-22 23:58:39 +09:00
h2spec.go Use non-zero return code when tests fail 2017-03-28 20:37:17 +09:00

README.md

h2spec

h2spec is a conformance testing tool for HTTP/2 implementation.
This tool is compliant with RFC 7540 (HTTP/2) and RFC 7541 (HPACK).

Install

Go to the releases page, find the version you want, and download the zip file or tarball file. The docker image is also available in Docker Hub.

Usage

Conformance testing tool for HTTP/2 implementation.

Usage:
  h2spec [spec...] [flags]

Flags:
      --dryrun                  Display only the title of test cases
      --help                    Display this help and exit
  -h, --host string             Target host (default "127.0.0.1")
  -k, --insecure                Don't verify server's certificate
  -j, --junit-report string     Path for JUnit test report
      --max-header-length int   Maximum length of HTTP header (default 4000)
  -p, --port int                Target port
  -S, --strict                  Run all test cases including strict test cases
  -o, --timeout int             Time seconds to test timeout (default 2)
  -t, --tls                     Connect over TLS
  -v, --verbose                 Output verbose log
      --version                 Display version information and exit

Running a specific test case

You can choose a test case to run by specifying the Spec ID as the command argument. For example, if you want to run test cases for HTTP/2, run h2spec as following:

$ h2spec http2

If you add a section number after the Spec ID, test cases related to a specific section will be run. For example, if you want to run test cases related to 6.3 of HTTP/2, run h2spec as following:

$ h2spec http2/6.3

If you add a test number after the section number, you can run the specific test case individually. For example, to run only the first test case related to 6.3 of HTTP/2 6.3, run h2spec as following:

$ h2spec http2/6.3/1

The Spec ID can be specified multiple times.

$ h2spec http2/6.3 generic

Currently supported Spec IDs are as follows. generic is the original spec of h2spec, includes generic test cases for HTTP/2 servers.

Spec ID Description
http2 Test cases for RFC 7540 (HTTP/2)
hpack Test cases for RFC 7541 (HPACK)
generic Generic test cases for HTTP/2 servers

Dryrun Mode

To display the list of test cases to be run, use Dryrun Mode as follows:

$ h2spec --dryrun

Strict Mode

When Strict Mode is enabled, h2spec will run the test cases related to the contents requested with the SHOULD notation in each specification. It is useful for more rigorous verification of HTTP/2 implementation.

$ h2spec --strict

Screenshot

Sceenshot

Build

First, you need to install Go, Glide and set GOPATH appropriately.

To build:

$ make build

To test:

$ make test

License

h2spec is made available under MIT license.