Autobahn-Testsuite for wsServer
367
This is a docker image that automatically runs wstest with fuzzingclient mode in Autobahn|Testsuite version 0.8.2. This docker image was made exclusively to run on the CI tests of wsServer, a small but 'fully featured' WebSocket server in C.
The script is configured to connect to port 8080 (localhost) of the host (outside of Docker). For this, a small bash script (run.sh) is responsible for detecting the IP address of the network adapter and uses it to build the fuzzingclient.json file.
Since Python 2.x is dying, this image has become more than necessary, as Autobahn|Testsuite does not support Python 3, with each passing day it becomes more difficult to run Autobahn natively .
A docker image is only as important as its Dockerfile, otherwise it becomes an irreproducible black box. Below are the files used and the commands used to generate this image:
FROM pypy:2
MAINTAINER Davidson Francis <[email protected]>
# Application home
ENV HOME /app
ENV DEBIAN_FRONTEND noninteractive
ENV NODE_PATH /usr/local/lib/node_modules/
# Copy our run.sh to /
ADD run.sh /
# make "pypy" available as "python"
RUN ln -s /usr/local/bin/pypy /usr/local/bin/python
# install Autobahn|Testsuite
RUN pip install -U pip \
&& pip install autobahntestsuite==0.8.2
# make volumes for output reports
VOLUME /wsserver_autobahn
WORKDIR /
# run wstest in fuzzingclient mode
CMD ["sh", "/run.sh"]
#!/bin/sh
IP=$(/sbin/ip route | awk '/default/ { print $3 }')
cd /
cat <<EOT > fuzzingclient.json
{
"outdir": "/wsserver_autobahn/report",
"servers": [
{
EOT
echo "\"agent\": \"wsServer\", \"url\": \"ws://$IP:8080\"" >> fuzzingclient.json
cat <<EOT >> fuzzingclient.json
}
],
"cases": ["*"],
"exclude-cases": [],
"exclude-agent-cases": {}
}
EOT
wstest --mode fuzzingclient --spec /fuzzingclient.json
The build command follows below:
docker build -t theldus/autobahn-testsuite:1.0 -f Dockerfile .
To run the docker image:
# Create 'wsserver_autobahn' if do not exists
mkdir wsserver_autobahn
docker run -it --rm -v \
"${CURDIR}/wsserver_autobahn:/wsserver_autobahn" \
theldus/autobahn-testsuite:1.0
Content type
Image
Digest
Size
359.5 MB
Last updated
over 5 years ago
docker pull theldus/autobahn-testsuite:1.0