Tobias Thierer | 6c251e2 | 2016-06-24 19:04:17 +0100 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" |
| 4 | cd "$SCRIPT_DIR" |
| 5 | |
| 6 | which wstest |
| 7 | if [ $? != 0 ]; then |
| 8 | echo "Run 'pip install autobahntestsuite', maybe with 'sudo'." |
| 9 | exit 1 |
| 10 | fi |
| 11 | which jq |
| 12 | if [ $? != 0 ]; then |
| 13 | echo "Run 'brew install jq'" |
| 14 | exit 1 |
| 15 | fi |
| 16 | |
| 17 | trap 'kill $(jobs -pr)' SIGINT SIGTERM EXIT |
| 18 | |
| 19 | set -ex |
| 20 | |
| 21 | wstest -m fuzzingserver -s fuzzingserver-config.json & |
| 22 | sleep 2 # wait for wstest to start |
| 23 | |
| 24 | java -jar target/okhttp-ws-tests-*-jar-with-dependencies.jar |
| 25 | |
| 26 | jq '.[] as $in | $in | keys[] | . + " " + $in[.].behavior' target/fuzzingserver-report/index.json > target/fuzzingserver-actual.txt |
| 27 | |
| 28 | diff fuzzingserver-expected.txt target/fuzzingserver-actual.txt |