crossbario / autobahn-testsuite

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

Run specific testcase? #46

Closed Pithikos closed 9 years ago

Pithikos commented 9 years ago

I appreciate the work done for this tessuite. I use it to debug a websocket server I built. The problem is that there are many test cases and I want to narrow down the debugging to specific test cases. For example if the problem is on test case 9.2.3 I don't want to have to wait for all the tests for every attempt to fix my bug.

So is there a way to run a specific testcase?

Examples:

wstest --mode fuzzingclient --testcase 9.2.3
wstest --mode fuzzingclient --testcase 7-9 # this would run all test cases from 7.x.x to 9.x.x
zaphoyd commented 9 years ago

Take a look at the fuzzingclient.json and fuzzingserver.json config files. They allow you to specify a single test or a sub-range, exclude a specific test or subrange, etc.

oberstet commented 9 years ago

Exactly. You can use patterns like "cases": ["1.*", "3.1.*"] in the config https://github.com/tavendo/AutobahnTestSuite/blob/master/examples/fuzzingserver/fuzzingserver.json#L8

Pithikos commented 9 years ago

Thank you. It wasn't that clear for a newbie how to go on doing this but now I figured it out :)

For future reference, you simply have the json in the same directory where you run wstest:

wstest --mode fuzzingclient --testset fuzzingclient.json

fuzzingclient.json:

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

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

   "cases": ["9.*"],
   "exclude-cases": [],
   "exclude-agent-cases": {}
}

The above configuration will run all 9.x.x tests.