crossbario / autobahn-testsuite

Autobahn WebSocket protocol testsuite
https://crossbar.io/autobahn/
Apache License 2.0
1k stars 84 forks source link

Testing non browser websocket client using autobahn test-suite #85

Open Apoorva2405 opened 6 years ago

Apoorva2405 commented 6 years ago

Testing non browser websocket client

Hi,

I have followed mentioned steps for testing non-browser websocket client with fuzzing server.Server is running as expected using: wstest -m fuzzingserver

I am able to test browser websocket by visiting "http://localhost:8080" and clicking on runTests button

But how do we run tests for a non browser application? And where will be the reports generated?

I am able to connect to the fuzzing server from my client but after that nothing happens.How are we supposed to trigger tests in this case

n1tesh4dez commented 4 years ago

The answer comes late but maybe it helps anyone: After studying the source code I found out that you have to provide the correct url path+url query to run any testcase. The url query must have the case tuple parameter and an agent (which is any string e.g. 'my_websocket_client') set.

As an example: To run the test number '1.1.1' the path must be '/runCase?casetuple=1.1.1&agent=my_websocket_client'. Be sure to set all headers which are needed for the websocket handshake (like SecWebsocketVersion, SecWebsocketKey aso). To connect to the fuzzing server you have to connect to localhost with port 9001 and not port 8080.

The fuzzing server does not expect that you send any ping frames except one of the testcases requires that. In most of the testcases you have simply to echo whats coming from the server in one single message. So you usually start to receive data from the server, parse it and echo it back. Note that for the round trip time tests the server requires that you echo each single message the fuzzing server is sending immediately and not one big message with multiple messages appended.