diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 870b44c..23ed9a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,16 +104,8 @@ jobs: with: rust-version: ${{ matrix.rust }} - - name: Install dependencies - run: | - 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: Install and configure docker + uses: docker-practice/actions-setup-docker@v1 - name: Running Autobahn TestSuite for client run: ./scripts/autobahn-client.sh diff --git a/scripts/autobahn-client.sh b/scripts/autobahn-client.sh index cd63693..cd24caf 100755 --- a/scripts/autobahn-client.sh +++ b/scripts/autobahn-client.sh @@ -6,8 +6,9 @@ SOURCE_DIR=$(readlink -f "${BASH_SOURCE[0]}") SOURCE_DIR=$(dirname "$SOURCE_DIR") cd "${SOURCE_DIR}/.." +CONTAINER_NAME=fuzzingserver function cleanup() { - kill -9 ${FUZZINGSERVER_PID} + docker container stop "${CONTAINER_NAME}" } trap cleanup TERM EXIT @@ -23,10 +24,14 @@ function test_diff() { 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 -echo "Server PID: ${FUZZINGSERVER_PID}" cargo run --release --features async-std-runtime --example autobahn-client test_diff diff --git a/scripts/autobahn-server.sh b/scripts/autobahn-server.sh index 86be38a..d41408a 100755 --- a/scripts/autobahn-server.sh +++ b/scripts/autobahn-server.sh @@ -5,7 +5,6 @@ set -x SOURCE_DIR=$(readlink -f "${BASH_SOURCE[0]}") SOURCE_DIR=$(dirname "$SOURCE_DIR") cd "${SOURCE_DIR}/.." -WSSERVER_PID= function cleanup() { kill -9 ${WSSERVER_PID} @@ -23,9 +22,13 @@ function test_diff() { fi } -cargo build --release --features async-std-runtime --example autobahn-server cargo run --release --features async-std-runtime --example autobahn-server & WSSERVER_PID=$! -echo "Server PID: ${WSSERVER_PID}" sleep 3 -wstest -m fuzzingclient -s 'autobahn/fuzzingclient.json' + +docker run --rm \ + -v "${PWD}/autobahn:/autobahn" \ + --network host \ + crossbario/autobahn-testsuite \ + wstest -m fuzzingclient -s 'autobahn/fuzzingclient.json' + test_diff