diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 087abe9..7a110cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,16 +79,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 --example autobahn-client - - - name: Build Autobahn TestSuite for server - run: cargo build --release --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/.travis.yml b/.travis.yml index 531a26d..32457c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,8 @@ language: rust rust: - stable -install: - - sudo apt-get install python-unittest2 - - sudo pip install ghp-import urllib3[secure] autobahntestsuite +services: + - docker before_script: - export PATH="$PATH:$HOME/.cargo/bin" diff --git a/scripts/autobahn-client.sh b/scripts/autobahn-client.sh index d78b52d..851297f 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 --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 --example autobahn-client test_diff diff --git a/scripts/autobahn-server.sh b/scripts/autobahn-server.sh index b244d73..ce18f95 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 --example autobahn-server cargo run --release --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