<commit_before>.. _usage:

Usage
=====


The test suite is packaged up and installed as a command line tool **wstest**.

To get help and a list of options:

::

   wstest --help

**wstest** has different modes in which it can run:

* ``echoserver``
* ``echoclient``
* ``broadcastclient``
* ``broadcastserver``
* ``fuzzingserver``
* ``fuzzingclient``
* ``testeeserver``
* ``testeeclient``
* ``wsperfcontrol``
* ``wsperfmaster``
* ``wampserver``
* ``wampclient``
* ``massconnect``

Server and client modes support TLS (that is WSS). For servers you will need to provide a server key and certificate file.


Mode fuzzingserver/fuzzingclient
--------------------------------

The automated WebSocket test suite comes under the modes:

* fuzzingserver
* fuzzingclient

For example, to test browsers (or other WebSocket clients):

::

   wstest -m fuzzingserver

and point your browser to ``http://localhost:8080``.

The fuzzing modes are configured using a spec file. If you don't provide one, **wstest** will auto-generate one (and reuse that the next time).

You can provide your own, modified spec file by doing

::

   wstest -m fuzzingserver -s <your spec file>

Reports will be generated as a set of HTML files. To create reports for multiple testee's, DO NOT restart **wstest** in between, since (currently), it will forget everything when stopped.


Mode testeeserver/testeeclient
------------------------------

These modes are for testing `AutobahnPython <http://autobahn.ws/python>`__ against the test suite.

The ``testeeserver`` can be tested using a 2nd instance of **wstest** running in ``fuzzingclient`` mode.

For example, to test Autobahn along other WebSocket servers, do

::

   wstest -m testeeserver ws://localhost:9001

start your other WebSocket servers on other ports, and then run the testsuite against all:

::

   wstest -m fuzzingclient -s fuzzingclient.json

where you have edited ``fuzzingclient.json`` for all servers under test, e.g.

::

   {
      "options": {"failByDrop": false},
      "outdir": "./reports/servers",

      "servers": [
                   {"agent": "AutobahnServer",
                    "url": "ws://localhost:9001",
                    "options": {"version": 18}},

                   {"agent": "MyAwesomeServer",
                    "url": "ws://localhost:9002",<commit_msg>testeeserver mode requires WS URI set through -w option<commit_after>.. _usage:

Usage
=====


The test suite is packaged up and installed as a command line tool **wstest**.

To get help and a list of options:

::

   wstest --help

**wstest** has different modes in which it can run:

* ``echoserver``
* ``echoclient``
* ``broadcastclient``
* ``broadcastserver``
* ``fuzzingserver``
* ``fuzzingclient``
* ``testeeserver``
* ``testeeclient``
* ``wsperfcontrol``
* ``wsperfmaster``
* ``wampserver``
* ``wampclient``
* ``massconnect``

Server and client modes support TLS (that is WSS). For servers you will need to provide a server key and certificate file.


Mode fuzzingserver/fuzzingclient
--------------------------------

The automated WebSocket test suite comes under the modes:

* fuzzingserver
* fuzzingclient

For example, to test browsers (or other WebSocket clients):

::

   wstest -m fuzzingserver

and point your browser to ``http://localhost:8080``.

The fuzzing modes are configured using a spec file. If you don't provide one, **wstest** will auto-generate one (and reuse that the next time).

You can provide your own, modified spec file by doing

::

   wstest -m fuzzingserver -s <your spec file>

Reports will be generated as a set of HTML files. To create reports for multiple testee's, DO NOT restart **wstest** in between, since (currently), it will forget everything when stopped.


Mode testeeserver/testeeclient
------------------------------

These modes are for testing `AutobahnPython <http://autobahn.ws/python>`__ against the test suite.

The ``testeeserver`` can be tested using a 2nd instance of **wstest** running in ``fuzzingclient`` mode.

For example, to test Autobahn along other WebSocket servers, do

::

   wstest -m testeeserver -w ws://localhost:9001

start your other WebSocket servers on other ports, and then run the testsuite against all:

::

   wstest -m fuzzingclient -s fuzzingclient.json

where you have edited ``fuzzingclient.json`` for all servers under test, e.g.

::

   {
      "options": {"failByDrop": false},
      "outdir": "./reports/servers",

      "servers": [
                   {"agent": "AutobahnServer",
                    "url": "ws://localhost:9001",
                    "options": {"version": 18}},

                   {"agent": "MyAwesomeServer",
                    "url": "ws://localhost:9002",
{'fraction_non_alphanumeric': 0.13844515441959532, 'fraction_numerical': 0.008093716719914802, 'mean_word_length': 3.126537785588752, 'pattern_counts': {'":': 20, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4573539', 'n_tokens_mistral': 1440, 'n_tokens_neox': 1349, 'n_words': 534}