From 4443e910ac1f5c7cf52e1b75c99e0aef50827f7c Mon Sep 17 00:00:00 2001 From: Alexey Galakhov Date: Fri, 17 May 2019 01:51:11 +0200 Subject: [PATCH] test: autobahn: correct configuration Signed-off-by: Alexey Galakhov --- autobahn/fuzzingclient.json | 4 ++-- scripts/autobahn-client.sh | 12 +++++------- scripts/autobahn-server.sh | 15 ++++++--------- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/autobahn/fuzzingclient.json b/autobahn/fuzzingclient.json index 776abfc..a265c37 100644 --- a/autobahn/fuzzingclient.json +++ b/autobahn/fuzzingclient.json @@ -2,11 +2,11 @@ "outdir": "./autobahn/server", "servers": [ { - "agent": "rust-websocket", + "agent": "Tungstenite", "url": "ws://127.0.0.1:9002" } ], "cases": ["*"], "exclude-cases": [], "exclude-agent-cases": {} -} \ No newline at end of file +} diff --git a/scripts/autobahn-client.sh b/scripts/autobahn-client.sh index 243ae87..d78b52d 100755 --- a/scripts/autobahn-client.sh +++ b/scripts/autobahn-client.sh @@ -12,15 +12,13 @@ function cleanup() { 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 + if ! diff -q \ + <(jq -S 'del(."Tungstenite" | .. | .duration?)' 'autobahn/client-results.json') \ + <(jq -S 'del(."Tungstenite" | .. | .duration?)' 'autobahn/client/index.json') + 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 } @@ -29,6 +27,6 @@ cargo build --release --example autobahn-client wstest -m fuzzingserver -s 'autobahn/fuzzingserver.json' & FUZZINGSERVER_PID=$! sleep 3 -echo "Server PID: ${WSSERVER_PID}" +echo "Server PID: ${FUZZINGSERVER_PID}" cargo run --release --example autobahn-client test_diff diff --git a/scripts/autobahn-server.sh b/scripts/autobahn-server.sh index a1fcc18..b244d73 100755 --- a/scripts/autobahn-server.sh +++ b/scripts/autobahn-server.sh @@ -13,21 +13,18 @@ function cleanup() { 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 + if ! diff -q \ + <(jq -S 'del(."Tungstenite" | .. | .duration?)' 'autobahn/client-results.json') \ + <(jq -S 'del(."Tungstenite" | .. | .duration?)' 'autobahn/server/index.json') + 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 + one should update autobahn/server-results.json with the new results. exit 64 fi } cargo build --release --example autobahn-server -./target/debug/examples/autobahn-server & WSSERVER_PID=$! +cargo run --release --example autobahn-server & WSSERVER_PID=$! echo "Server PID: ${WSSERVER_PID}" sleep 3 wstest -m fuzzingclient -s 'autobahn/fuzzingclient.json'