| 1 |
Autobahn Testsuite |
| 2 |
================== |
| 3 |
|
| 4 |
General information and installation instructions are available at |
| 5 |
https://github.com/crossbario/autobahn-testsuite. |
| 6 |
|
| 7 |
Running the test suite |
| 8 |
---------------------- |
| 9 |
|
| 10 |
All commands below must be run from the root directory of the repository. |
| 11 |
|
| 12 |
To get acceptable performance, compile the C extension first: |
| 13 |
|
| 14 |
.. code-block:: console |
| 15 |
|
| 16 |
$ python setup.py build_ext --inplace |
| 17 |
|
| 18 |
Run each command in a different shell. Testing takes several minutes to complete |
| 19 |
— wstest is the bottleneck. When clients finish, stop servers with Ctrl-C. |
| 20 |
|
| 21 |
You can exclude slow tests by modifying the configuration files as follows:: |
| 22 |
|
| 23 |
"exclude-cases": ["9.*", "12.*", "13.*"] |
| 24 |
|
| 25 |
The test server and client applications shouldn't display any exceptions. |
| 26 |
|
| 27 |
To test the servers: |
| 28 |
|
| 29 |
.. code-block:: console |
| 30 |
|
| 31 |
$ PYTHONPATH=src python compliance/asyncio/server.py |
| 32 |
$ PYTHONPATH=src python compliance/sync/server.py |
| 33 |
|
| 34 |
$ docker run --interactive --tty --rm \ |
| 35 |
--volume "${PWD}/compliance/config:/config" \ |
| 36 |
--volume "${PWD}/compliance/reports:/reports" \ |
| 37 |
--name fuzzingclient \ |
| 38 |
crossbario/autobahn-testsuite \ |
| 39 |
wstest --mode fuzzingclient --spec /config/fuzzingclient.json |
| 40 |
|
| 41 |
$ open compliance/reports/servers/index.html |
| 42 |
|
| 43 |
To test the clients: |
| 44 |
|
| 45 |
.. code-block:: console |
| 46 |
$ docker run --interactive --tty --rm \ |
| 47 |
--volume "${PWD}/compliance/config:/config" \ |
| 48 |
--volume "${PWD}/compliance/reports:/reports" \ |
| 49 |
--publish 9001:9001 \ |
| 50 |
--name fuzzingserver \ |
| 51 |
crossbario/autobahn-testsuite \ |
| 52 |
wstest --mode fuzzingserver --spec /config/fuzzingserver.json |
| 53 |
|
| 54 |
$ PYTHONPATH=src python compliance/asyncio/client.py |
| 55 |
$ PYTHONPATH=src python compliance/sync/client.py |
| 56 |
|
| 57 |
$ open compliance/reports/clients/index.html |
| 58 |
|
| 59 |
Conformance notes |
| 60 |
----------------- |
| 61 |
|
| 62 |
Some test cases are more strict than the RFC. Given the implementation of the |
| 63 |
library and the test client and server applications, websockets passes with a |
| 64 |
"Non-Strict" result in these cases. |
| 65 |
|
| 66 |
In 3.2, 3.3, 4.1.3, 4.1.4, 4.2.3, 4.2.4, and 5.15 websockets notices the |
| 67 |
protocol error and closes the connection at the library level before the |
| 68 |
application gets a chance to echo the previous frame. |
| 69 |
|
| 70 |
In 6.4.1, 6.4.2, 6.4.3, and 6.4.4, even though it uses an incremental decoder, |
| 71 |
websockets doesn't notice the invalid utf-8 fast enough to get a "Strict" pass. |
| 72 |
These tests are more strict than the RFC. |
| 73 |
|
| 74 |
Test case 7.1.5 fails because websockets treats closing the connection in the |
| 75 |
middle of a fragmented message as a protocol error. As a consequence, it sends |
| 76 |
a close frame with code 1002. The test suite expects a close frame with code |
| 77 |
1000, echoing the close code that it sent. This isn't required. RFC 6455 states |
| 78 |
that "the endpoint typically echos the status code it received", which leaves |
| 79 |
the possibility to send a close frame with a different status code. |