ci: Add test for websockets

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jeremy White <jwhite@codeweavers.com>
This commit is contained in:
Frediano Ziglio 2019-06-20 12:39:31 +01:00
parent c1c5d8bf5a
commit a68fd56b41
3 changed files with 49 additions and 0 deletions

View File

@ -136,3 +136,23 @@ makecheck-windows:
- mingw64-configure --disable-celt051
- mingw64-make
- mingw64-make LOG_COMPILE=wine -C server check || (cat server/tests/test-suite.log && exit 1)
websocket-autobahn:
before_script:
- apt-get update || true
- apt-get install -y python-six python-pyparsing libopus-dev libssl-dev libglib2.0-dev
- git clone ${CI_REPOSITORY_URL/spice.git/spice-protocol.git}
- (cd spice-protocol && ./autogen.sh --prefix=/usr && make install)
image: crossbario/autobahn-testsuite
script:
- ./autogen.sh
- make -j4
- ./server/tests/test-websocket & pid=$!
- wstest -m fuzzingclient -s server/tests/fuzzingclient.json
- kill $pid
- server/tests/autobahn-check-report reports/servers/index.json
- rm -rf reports/servers
- ./server/tests/test-websocket -n & pid=$!
- wstest -m fuzzingclient -s server/tests/fuzzingclient.json
- kill $pid
- server/tests/autobahn-check-report reports/servers/index.json

View File

@ -0,0 +1,18 @@
#!/usr/bin/env python
import sys
import json
num_tests = 0
for server in json.load(open(sys.argv[1])).values():
for test, result in server.items():
is_test = 0
for k, v in result.items():
if k[:8].lower() != 'behavior':
continue
is_test = 1
if v != 'OK' and v != 'INFORMATIONAL':
raise Exception('Invalid %s %s for test %s' % (k, v, test))
num_tests += is_test
if num_tests < 100:
raise Exception('Too few tests done %s' % num_tests)
print('Output report is fine')

View File

@ -0,0 +1,11 @@
{
"outdir": "./reports/servers",
"servers": [
{
"url": "ws://127.0.0.1:7777"
}
],
"cases": ["*"],
"exclude-cases": ["6.*","12.*","13.*"],
"exclude-agent-cases": {}
}