1
0
mirror of https://github.com/square/okhttp.git synced 2025-11-26 06:43:09 +03:00
Files
okhttp/okhttp-tests/fuzzingserver-test.sh
Jake Wharton 039bcf92db Move WebSockets from separate artifact to main.
The factory method has moved to OkHttpClient and WebSocketCall has changed to an interface.
2016-09-13 12:29:19 -04:00

29 lines
673 B
Bash
Executable File

#!/usr/bin/env bash
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
cd "$SCRIPT_DIR"
which wstest
if [ $? != 0 ]; then
echo "Run 'pip install autobahntestsuite', maybe with 'sudo'."
exit 1
fi
which jq
if [ $? != 0 ]; then
echo "Run 'brew install jq'"
exit 1
fi
trap 'kill $(jobs -pr)' SIGINT SIGTERM EXIT
set -ex
wstest -m fuzzingserver -s fuzzingserver-config.json &
sleep 2 # wait for wstest to start
java -jar target/okhttp-tests-*-jar-with-dependencies.jar
jq '.[] as $in | $in | keys[] | . + " " + $in[.].behavior' target/fuzzingserver-report/index.json > target/fuzzingserver-actual.txt
diff fuzzingserver-expected.txt target/fuzzingserver-actual.txt