This commit is contained in:
Tobias Oberstein 2017-03-22 19:45:54 +01:00
parent eeaf5b8894
commit e156bec8f4
6 changed files with 69 additions and 8 deletions

View File

@ -165,3 +165,33 @@ test_aio_client: \
test_client: \
test_tx_client \
test_aio_client
start_cpy2_tx_server:
./venv_cpy2_tx/bin/python testee_server_tx.py --url ws://localhost:9010 &
start_cpy3_tx_server:
./venv_cpy3_tx/bin/python testee_server_tx.py --url ws://localhost:9011 &
start_pypy2_tx_server:
./venv_pypy2_tx/bin/python testee_server_tx.py --url ws://localhost:9012 &
start_pypy3_tx_server:
./venv_pypy3_tx/bin/python testee_server_tx.py --url ws://localhost:9013 &
start_cpy2_aio_server:
./venv_cpy2_aio/bin/python testee_server_aio.py --url ws://localhost:9014 &
start_cpy3_aio_server:
./venv_cpy3_aio/bin/python testee_server_aio.py --url ws://localhost:9015 &
start_pypy2_aio_server:
./venv_pypy2_aio/bin/python testee_server_aio.py --url ws://localhost:9016 &
start_pypy3_aio_server:
./venv_pypy3_aio/bin/python testee_server_aio.py --url ws://localhost:9017 &
stop_testee_server:
pkill -f "testee_server*"

View File

@ -27,3 +27,10 @@ Python 3.5.3 (b16a4363e930, Mar 20 2017, 16:13:46)
make setup
```
make wstest_server
make test_tx_client
make test_aio_client

View File

@ -3,6 +3,6 @@
"url": "ws://127.0.0.1:9001",
"outdir": "./reports/clients",
"cases": ["*"],
"exclude-cases": ["9.*", "10.*", "11.*", "12.*", "13.*"],
"exclude-cases": [],
"exclude-agent-cases": {}
}

View File

@ -91,7 +91,7 @@ class TesteeClientFactory(WebSocketClientFactory):
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Autobahn Testee Client (Twisted)')
parser = argparse.ArgumentParser(description='Autobahn Testee Client (asyncio)')
parser.add_argument('--url', dest='url', type=str, default=u'ws://127.0.0.1:9001', help='The WebSocket fuzzing server URL.')
parser.add_argument('--loglevel', dest='loglevel', type=str, default=u'info', help='Log level, eg "info" or "debug".')

View File

@ -24,6 +24,8 @@
#
###############################################################################
import argparse
import txaio
txaio.use_asyncio()
@ -34,6 +36,8 @@ except ImportError:
import autobahn
from autobahn.websocket.util import parse_url
from autobahn.asyncio.websocket import WebSocketServerProtocol, \
WebSocketServerFactory
@ -107,12 +111,20 @@ class TesteeServerFactory(WebSocketServerFactory):
if __name__ == '__main__':
txaio.start_logging(level='info')
parser = argparse.ArgumentParser(description='Autobahn Testee Server (Twisted)')
parser.add_argument('--url', dest='url', type=str, default=u'ws://127.0.0.1:9001', help='The WebSocket fuzzing server URL.')
parser.add_argument('--loglevel', dest='loglevel', type=str, default=u'info', help='Log level, eg "info" or "debug".')
factory = TesteeServerFactory(u"ws://127.0.0.1:9001")
options = parser.parse_args()
txaio.start_logging(level=options.loglevel)
factory = TesteeServerFactory(options.url)
_, _, port, _, _, _ = parse_url(options.url)
loop = asyncio.get_event_loop()
coro = loop.create_server(factory, port=9001)
coro = loop.create_server(factory, port=port)
server = loop.run_until_complete(coro)
try:

View File

@ -24,6 +24,8 @@
#
###############################################################################
import argparse
import sys
import platform
@ -34,6 +36,8 @@ from twisted.internet import reactor
import autobahn
from autobahn.websocket.util import parse_url
from autobahn.twisted.websocket import WebSocketServerProtocol, \
WebSocketServerFactory
@ -107,9 +111,17 @@ class TesteeServerFactory(WebSocketServerFactory):
if __name__ == '__main__':
txaio.start_logging(level='info')
parser = argparse.ArgumentParser(description='Autobahn Testee Server (Twisted)')
parser.add_argument('--url', dest='url', type=str, default=u'ws://127.0.0.1:9001', help='The WebSocket fuzzing server URL.')
parser.add_argument('--loglevel', dest='loglevel', type=str, default=u'info', help='Log level, eg "info" or "debug".')
factory = TesteeServerFactory(u"ws://127.0.0.1:9001")
options = parser.parse_args()
reactor.listenTCP(9001, factory)
txaio.start_logging(level=options.loglevel)
factory = TesteeServerFactory(options.url)
_, _, port, _, _, _ = parse_url(options.url)
reactor.listenTCP(port, factory)
reactor.run()