|
|
@ -6,27 +6,31 @@ SOURCE_DIR=$(readlink -f "${BASH_SOURCE[0]}") |
|
|
|
SOURCE_DIR=$(dirname "$SOURCE_DIR") |
|
|
|
SOURCE_DIR=$(dirname "$SOURCE_DIR") |
|
|
|
cd "${SOURCE_DIR}/.." |
|
|
|
cd "${SOURCE_DIR}/.." |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CONTAINER_NAME=fuzzingserver |
|
|
|
function cleanup() { |
|
|
|
function cleanup() { |
|
|
|
kill -9 ${FUZZINGSERVER_PID} |
|
|
|
docker container stop "${CONTAINER_NAME}" |
|
|
|
} |
|
|
|
} |
|
|
|
trap cleanup TERM EXIT |
|
|
|
trap cleanup TERM EXIT |
|
|
|
|
|
|
|
|
|
|
|
function test_diff() { |
|
|
|
function test_diff() { |
|
|
|
if ! diff -q \ |
|
|
|
if ! diff -q \ |
|
|
|
<(jq -S 'del(."Tungstenite" | .. | .duration?)' 'autobahn/client-results.json') \ |
|
|
|
<(jq -S 'del(."Tungstenite" | .. | .duration?)' 'autobahn/expected-results.json') \ |
|
|
|
<(jq -S 'del(."Tungstenite" | .. | .duration?)' 'autobahn/client/index.json') |
|
|
|
<(jq -S 'del(."Tungstenite" | .. | .duration?)' 'autobahn/client/index.json') |
|
|
|
then |
|
|
|
then |
|
|
|
echo 'Difference in results, either this is a regression or' \ |
|
|
|
echo 'Difference in results, either this is a regression or' \ |
|
|
|
'one should update autobahn/client-results.json with the new results.' \ |
|
|
|
'one should update autobahn/expected-results.json with the new results.' \ |
|
|
|
'The results are:' |
|
|
|
|
|
|
|
exit 64 |
|
|
|
exit 64 |
|
|
|
fi |
|
|
|
fi |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
cargo build --release --example autobahn-client |
|
|
|
docker run -d --rm \ |
|
|
|
|
|
|
|
-v "${PWD}/autobahn:/autobahn" \ |
|
|
|
|
|
|
|
-p 9001:9001 \ |
|
|
|
|
|
|
|
--init \ |
|
|
|
|
|
|
|
--name "${CONTAINER_NAME}" \ |
|
|
|
|
|
|
|
crossbario/autobahn-testsuite \ |
|
|
|
|
|
|
|
wstest -m fuzzingserver -s 'autobahn/fuzzingserver.json' |
|
|
|
|
|
|
|
|
|
|
|
wstest -m fuzzingserver -s 'autobahn/fuzzingserver.json' & FUZZINGSERVER_PID=$! |
|
|
|
|
|
|
|
sleep 3 |
|
|
|
sleep 3 |
|
|
|
echo "Server PID: ${FUZZINGSERVER_PID}" |
|
|
|
|
|
|
|
cargo run --release --example autobahn-client |
|
|
|
cargo run --release --example autobahn-client |
|
|
|
test_diff |
|
|
|
test_diff |
|
|
|