travis: add automated autobahn tests
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
This commit is contained in:
parent
06308b1b3f
commit
758c522b31
12
.travis.yml
12
.travis.yml
|
@ -1 +1,13 @@
|
|||
language: rust
|
||||
|
||||
before_script:
|
||||
- export PATH="$PATH:$HOME/.cargo/bin"
|
||||
|
||||
script:
|
||||
- cargo test --release
|
||||
|
||||
after_success:
|
||||
- sudo apt-get install python-unittest2
|
||||
- sudo pip install ghp-import urllib3[secure] autobahntestsuite
|
||||
- echo "Running Autobahn TestSuite for client" && ./scripts/autobahn-client.sh
|
||||
- echo "Running Autobahn TestSuite for server" && ./scripts/autobahn-server.sh
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"outdir": "./autobahn/server",
|
||||
"servers": [
|
||||
{
|
||||
"agent": "rust-websocket",
|
||||
"url": "ws://127.0.0.1:9002"
|
||||
}
|
||||
],
|
||||
"cases": ["*"],
|
||||
"exclude-cases": [],
|
||||
"exclude-agent-cases": {}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"url": "ws://127.0.0.1:9001",
|
||||
"outdir": "./autobahn/client",
|
||||
"cases": ["*"],
|
||||
"exclude-cases": [],
|
||||
"exclude-agent-cases": {}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -33,7 +33,7 @@ fn handle_client(stream: TcpStream) -> Result<()> {
|
|||
fn main() {
|
||||
env_logger::init();
|
||||
|
||||
let server = TcpListener::bind("127.0.0.1:9001").unwrap();
|
||||
let server = TcpListener::bind("127.0.0.1:9002").unwrap();
|
||||
|
||||
for stream in server.incoming() {
|
||||
spawn(move || {
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
# Author michael <themichaeleden@gmail.com>
|
||||
set -euo pipefail
|
||||
set -x
|
||||
SOURCE_DIR=$(readlink -f "${BASH_SOURCE[0]}")
|
||||
SOURCE_DIR=$(dirname "$SOURCE_DIR")
|
||||
cd "${SOURCE_DIR}/.."
|
||||
|
||||
function cleanup() {
|
||||
kill -9 ${FUZZINGSERVER_PID}
|
||||
}
|
||||
trap cleanup TERM EXIT
|
||||
|
||||
function test_diff() {
|
||||
DIFF=$(diff \
|
||||
<(jq -S 'del(."rust-websocket" | .. | .duration?)' 'autobahn/client-results.json') \
|
||||
<(jq -S 'del(."rust-websocket" | .. | .duration?)' 'autobahn/client/index.json') )
|
||||
|
||||
if [[ $DIFF ]]; then
|
||||
echo 'Difference in results, either this is a regression or' \
|
||||
'one should update autobahn/client-results.json with the new results.' \
|
||||
'The results are:'
|
||||
echo $DIFF
|
||||
exit 64
|
||||
fi
|
||||
}
|
||||
|
||||
cargo build --release --example autobahn-client
|
||||
|
||||
wstest -m fuzzingserver -s 'autobahn/fuzzingserver.json' & FUZZINGSERVER_PID=$!
|
||||
sleep 3
|
||||
echo "Server PID: ${WSSERVER_PID}"
|
||||
cargo run --release --example autobahn-client
|
||||
test_diff
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
# Author michael <themichaeleden@gmail.com>
|
||||
set -euo pipefail
|
||||
set -x
|
||||
SOURCE_DIR=$(readlink -f "${BASH_SOURCE[0]}")
|
||||
SOURCE_DIR=$(dirname "$SOURCE_DIR")
|
||||
cd "${SOURCE_DIR}/.."
|
||||
WSSERVER_PID=
|
||||
|
||||
function cleanup() {
|
||||
kill -9 ${WSSERVER_PID}
|
||||
}
|
||||
trap cleanup TERM EXIT
|
||||
|
||||
function test_diff() {
|
||||
DIFF=$(diff \
|
||||
<(jq -S 'del(."rust-websocket" | .. | .duration?)' 'autobahn/client-results.json') \
|
||||
<(jq -S 'del(."rust-websocket" | .. | .duration?)' 'autobahn/server/index.json') )
|
||||
|
||||
if [[ $DIFF ]]; then
|
||||
echo Difference in results, either this is a regression or \
|
||||
one should update autobahn/server-results.json with the new results. \
|
||||
The results are:
|
||||
echo $DIFF
|
||||
exit 64
|
||||
fi
|
||||
}
|
||||
|
||||
cargo build --release --example autobahn-server
|
||||
./target/debug/examples/autobahn-server & WSSERVER_PID=$!
|
||||
echo "Server PID: ${WSSERVER_PID}"
|
||||
sleep 3
|
||||
wstest -m fuzzingclient -s 'autobahn/fuzzingclient.json'
|
||||
test_diff
|
Loading…
Reference in New Issue