3 # Requires pip install autobahntestsuite
5 # you should run this from ./build, after building with
6 # cmake .. -DLWS_WITH_MINIMAL_EXAMPLES=1
8 # It will use the minimal echo client and server to run
9 # autobahn ws tests as both client and server.
17 CLIE=bin/lws-minimal-ws-client-echo
18 SERV=bin/lws-minimal-ws-server-echo
22 which wstest 2>/dev/null
24 echo "wstest is not installed"
28 killall wstest 2>/dev/null
31 # 2.10 / 2.11: There is no requirement to handle multiple PING / PONG
32 # in flight on a single connection in RFC6455. lws doesn't
33 # waste memory on supporting it since it is useless.
35 cat << EOF >fuzzingclient.json
37 "outdir": "./reports/servers",
40 "url": "ws://127.0.0.1:9001"
43 "cases": [ "12.2.13" ],
44 "exclude-cases": ["2.10", "2.11" ],
45 "exclude-agent-cases": {}
50 echo "----------------------------------------------"
51 echo "------- tests: autobahn as server"
55 wstest -m fuzzingclient
57 echo "Autobahn client exit $R"
59 killall lws-minimal-ws-server-echo
62 # repeat the client results
64 R=`cat /tmp/ji | grep -v '"behavior": "OK"' | grep -v '"behavior": "NON-STRICT"' | grep -v '"behavior": "INFORMATIONAL"' | wc -l`
65 echo -n "AUTOBAHN SERVER / LWS CLIENT: Total tests: " `cat /tmp/ji | wc -l` " : "
66 if [ "$R" == "0" ] ;then
71 cat /tmp/ji | grep -v '"behavior": "OK"' | grep -v '"behavior": "NON-STRICT"' | grep -v '"behavior": "INFORMATIONAL"' | cut -d\" -f2 | tr '\n' ','
75 # and then the server results
77 cat reports/servers/index.json | tr '\n' '!' | sed "s|\},\!|\n|g" | tr '!' ' ' | tr -s ' ' > /tmp/jis
78 R=`cat /tmp/jis | grep -v '"behavior": "OK"' | grep -v '"behavior": "NON-STRICT"' | grep -v '"behavior": "INFORMATIONAL"' | wc -l`
80 echo -n "AUTOBAHN CLIENT / LWS SERVER: Total tests: " `cat /tmp/jis | wc -l` " : "
81 if [ "$R" == "0" ] ;then
84 RESULT=$(( $RESULT + 2 ))
86 cat /tmp/jis | grep -v '"behavior": "OK"' | grep -v '"behavior": "NON-STRICT"' | grep -v '"behavior": "INFORMATIONAL"' | cut -d\" -f2 | tr '\n' ','