tests: use autobahn test suite as docker image

According to the documentation from the Autobahn Suite GitHub page, it
seems like they do not support Python 3 which is currently the default
Python version used with our GitHub Actions.

The simplest way to workaround it properly seems to be using the Docker
image that the maintainers of the project suggest to use for running the
suite. This is more future-proof way that we should rely upon.

This commit also removes some redundant steps that are not required.
pull/97/head
Daniel Abramov 4 years ago committed by Sebastian Dröge
parent fcb209d6de
commit 1c9e7ea8fb
  1. 12
      .github/workflows/ci.yml
  2. 13
      scripts/autobahn-client.sh
  3. 9
      scripts/autobahn-server.sh

@ -104,16 +104,8 @@ jobs:
with: with:
rust-version: ${{ matrix.rust }} rust-version: ${{ matrix.rust }}
- name: Install dependencies - name: Install and configure docker
run: | uses: docker-practice/actions-setup-docker@v1
sudo apt-get install libssl-dev python-unittest2
sudo pip install urllib3[secure] autobahntestsuite
- name: Build Autobahn TestSuite for client
run: cargo build --release --features async-std-runtime --example autobahn-client
- name: Build Autobahn TestSuite for server
run: cargo build --release --features async-std-runtime --example autobahn-server
- name: Running Autobahn TestSuite for client - name: Running Autobahn TestSuite for client
run: ./scripts/autobahn-client.sh run: ./scripts/autobahn-client.sh

@ -6,8 +6,9 @@ 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
@ -23,10 +24,14 @@ function test_diff() {
fi fi
} }
cargo build --release --features async-std-runtime --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 --features async-std-runtime --example autobahn-client cargo run --release --features async-std-runtime --example autobahn-client
test_diff test_diff

@ -5,7 +5,6 @@ set -x
SOURCE_DIR=$(readlink -f "${BASH_SOURCE[0]}") SOURCE_DIR=$(readlink -f "${BASH_SOURCE[0]}")
SOURCE_DIR=$(dirname "$SOURCE_DIR") SOURCE_DIR=$(dirname "$SOURCE_DIR")
cd "${SOURCE_DIR}/.." cd "${SOURCE_DIR}/.."
WSSERVER_PID=
function cleanup() { function cleanup() {
kill -9 ${WSSERVER_PID} kill -9 ${WSSERVER_PID}
@ -23,9 +22,13 @@ function test_diff() {
fi fi
} }
cargo build --release --features async-std-runtime --example autobahn-server
cargo run --release --features async-std-runtime --example autobahn-server & WSSERVER_PID=$! cargo run --release --features async-std-runtime --example autobahn-server & WSSERVER_PID=$!
echo "Server PID: ${WSSERVER_PID}"
sleep 3 sleep 3
docker run --rm \
-v "${PWD}/autobahn:/autobahn" \
--network host \
crossbario/autobahn-testsuite \
wstest -m fuzzingclient -s 'autobahn/fuzzingclient.json' wstest -m fuzzingclient -s 'autobahn/fuzzingclient.json'
test_diff test_diff

Loading…
Cancel
Save