aboutsummaryrefslogtreecommitdiffstats
path: root/tests/files/ansible/test-files
diff options
context:
space:
mode:
Diffstat (limited to 'tests/files/ansible/test-files')
-rw-r--r--tests/files/ansible/test-files/create-docker-images.sh7
-rw-r--r--tests/files/ansible/test-files/docker-cpp/Dockerfile32
-rw-r--r--tests/files/ansible/test-files/docker-cppjit/Dockerfile46
-rw-r--r--tests/files/ansible/test-files/docker-go/Dockerfile47
-rw-r--r--tests/files/ansible/test-files/docker-python/Dockerfile23
-rw-r--r--tests/files/ansible/test-files/testrunner.sh57
6 files changed, 212 insertions, 0 deletions
diff --git a/tests/files/ansible/test-files/create-docker-images.sh b/tests/files/ansible/test-files/create-docker-images.sh
new file mode 100644
index 000000000..06728c6d7
--- /dev/null
+++ b/tests/files/ansible/test-files/create-docker-images.sh
@@ -0,0 +1,7 @@
+#!/bin/bash -x
+
+# creates the necessary docker images to run testrunner.sh locally
+
+docker build --tag="ethereum/cppjit-testrunner" docker-cppjit
+docker build --tag="ethereum/python-testrunner" docker-python
+docker build --tag="ethereum/go-testrunner" docker-go
diff --git a/tests/files/ansible/test-files/docker-cpp/Dockerfile b/tests/files/ansible/test-files/docker-cpp/Dockerfile
new file mode 100644
index 000000000..a3b0e4ca6
--- /dev/null
+++ b/tests/files/ansible/test-files/docker-cpp/Dockerfile
@@ -0,0 +1,32 @@
+# adjusted from https://github.com/ethereum/cpp-ethereum/blob/develop/docker/Dockerfile
+FROM ubuntu:14.04
+
+ENV DEBIAN_FRONTEND noninteractive
+RUN apt-get update
+RUN apt-get upgrade -y
+
+# Ethereum dependencies
+RUN apt-get install -qy build-essential g++-4.8 git cmake libboost-all-dev libcurl4-openssl-dev wget
+RUN apt-get install -qy automake unzip libgmp-dev libtool libleveldb-dev yasm libminiupnpc-dev libreadline-dev scons
+RUN apt-get install -qy libjsoncpp-dev libargtable2-dev
+
+# NCurses based GUI (not optional though for a succesful compilation, see https://github.com/ethereum/cpp-ethereum/issues/452 )
+RUN apt-get install -qy libncurses5-dev
+
+# Qt-based GUI
+# RUN apt-get install -qy qtbase5-dev qt5-default qtdeclarative5-dev libqt5webkit5-dev
+
+# Ethereum PPA
+RUN apt-get install -qy software-properties-common
+RUN add-apt-repository ppa:ethereum/ethereum
+RUN apt-get update
+RUN apt-get install -qy libcryptopp-dev libjson-rpc-cpp-dev
+
+# Build Ethereum (HEADLESS)
+RUN git clone --depth=1 --branch develop https://github.com/ethereum/cpp-ethereum
+RUN mkdir -p cpp-ethereum/build
+RUN cd cpp-ethereum/build && cmake .. -DCMAKE_BUILD_TYPE=Release -DHEADLESS=1 && make -j $(cat /proc/cpuinfo | grep processor | wc -l) && make install
+RUN ldconfig
+
+ENTRYPOINT ["/cpp-ethereum/build/test/createRandomTest"]
+
diff --git a/tests/files/ansible/test-files/docker-cppjit/Dockerfile b/tests/files/ansible/test-files/docker-cppjit/Dockerfile
new file mode 100644
index 000000000..2b10727f0
--- /dev/null
+++ b/tests/files/ansible/test-files/docker-cppjit/Dockerfile
@@ -0,0 +1,46 @@
+# adjusted from https://github.com/ethereum/cpp-ethereum/blob/develop/docker/Dockerfile
+FROM ubuntu:14.04
+
+ENV DEBIAN_FRONTEND noninteractive
+RUN apt-get update
+RUN apt-get upgrade -y
+
+# Ethereum dependencies
+RUN apt-get install -qy build-essential g++-4.8 git cmake libboost-all-dev libcurl4-openssl-dev wget
+RUN apt-get install -qy automake unzip libgmp-dev libtool libleveldb-dev yasm libminiupnpc-dev libreadline-dev scons
+RUN apt-get install -qy libjsoncpp-dev libargtable2-dev
+
+# NCurses based GUI (not optional though for a succesful compilation, see https://github.com/ethereum/cpp-ethereum/issues/452 )
+RUN apt-get install -qy libncurses5-dev
+
+# Qt-based GUI
+# RUN apt-get install -qy qtbase5-dev qt5-default qtdeclarative5-dev libqt5webkit5-dev
+
+RUN sudo apt-get -y install software-properties-common
+
+# LLVM-3.5
+RUN wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add -
+RUN echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.5 main\ndeb-src http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.5 main" > /etc/apt/sources.list.d/llvm-trusty.list
+RUN apt-get update
+RUN apt-get install -qy llvm-3.5 libedit-dev
+
+# Fix llvm-3.5 cmake paths
+RUN mkdir -p /usr/lib/llvm-3.5/share/llvm && ln -s /usr/share/llvm-3.5/cmake /usr/lib/llvm-3.5/share/llvm/cmake
+
+
+# Ethereum PPA
+RUN apt-get install -qy software-properties-common
+RUN add-apt-repository ppa:ethereum/ethereum
+RUN apt-get update
+RUN apt-get install -qy libcryptopp-dev libjson-rpc-cpp-dev
+
+# this is a workaround, to make sure that docker's cache is invalidated whenever the git repo changes
+ADD https://api.github.com/repos/ethereum/cpp-ethereum/git/refs/heads/develop unused.txt
+
+# Build Ethereum (HEADLESS)
+RUN git clone --depth=1 --branch develop https://github.com/ethereum/cpp-ethereum
+RUN mkdir -p cpp-ethereum/build
+RUN cd cpp-ethereum/build && cmake .. -DCMAKE_BUILD_TYPE=Debug -DVMTRACE=1 -DPARANOIA=1 -DEVMJIT=1 && make -j $(cat /proc/cpuinfo | grep processor | wc -l) && make install
+RUN ldconfig
+
+ENTRYPOINT ["/cpp-ethereum/build/test/checkRandomStateTest"]
diff --git a/tests/files/ansible/test-files/docker-go/Dockerfile b/tests/files/ansible/test-files/docker-go/Dockerfile
new file mode 100644
index 000000000..a5a2f0f23
--- /dev/null
+++ b/tests/files/ansible/test-files/docker-go/Dockerfile
@@ -0,0 +1,47 @@
+# Adjusted from https://github.com/ethereum/go-ethereum/blob/develop/Dockerfile
+FROM ubuntu:14.04
+
+## Environment setup
+ENV HOME /root
+ENV GOPATH /root/go
+ENV PATH /golang/bin:/root/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
+ENV PKG_CONFIG_PATH /opt/qt54/lib/pkgconfig
+
+RUN mkdir -p /root/go
+ENV DEBIAN_FRONTEND noninteractive
+
+## Install base dependencies
+RUN apt-get update && apt-get upgrade -y
+RUN apt-get install -y git mercurial build-essential software-properties-common pkg-config libgmp3-dev libreadline6-dev libpcre3-dev libpcre++-dev mesa-common-dev libglu1-mesa-dev
+
+## Install Qt5.4 dependencies from PPA
+RUN add-apt-repository ppa:beineri/opt-qt54-trusty -y
+RUN apt-get update -y
+RUN apt-get install -y qt54quickcontrols qt54webengine
+
+## Build and install latest Go
+RUN git clone https://go.googlesource.com/go golang
+RUN cd golang && git checkout go1.4.1
+RUN cd golang/src && ./make.bash && go version
+
+## Fetch and install QML
+RUN go get -u -v -d github.com/obscuren/qml
+WORKDIR $GOPATH/src/github.com/obscuren/qml
+RUN git checkout v1
+RUN go install -v
+
+# this is a workaround, to make sure that docker's cache is invalidated whenever the git repo changes
+ADD https://api.github.com/repos/ethereum/go-ethereum/git/refs/heads/develop unused.txt
+
+## Fetch and install go-ethereum
+RUN go get -u -v -d github.com/ethereum/go-ethereum/...
+WORKDIR $GOPATH/src/github.com/ethereum/go-ethereum
+
+RUN git checkout develop
+RUN git pull
+
+
+RUN ETH_DEPS=$(go list -f '{{.Imports}} {{.TestImports}} {{.XTestImports}}' github.com/ethereum/go-ethereum/... | sed -e 's/\[//g' | sed -e 's/\]//g' | sed -e 's/C //g'); if [ "$ETH_DEPS" ]; then go get $ETH_DEPS; fi
+RUN go install -v ./cmd/ethtest
+
+ENTRYPOINT ["ethtest"]
diff --git a/tests/files/ansible/test-files/docker-python/Dockerfile b/tests/files/ansible/test-files/docker-python/Dockerfile
new file mode 100644
index 000000000..e83faf3d6
--- /dev/null
+++ b/tests/files/ansible/test-files/docker-python/Dockerfile
@@ -0,0 +1,23 @@
+FROM ubuntu:14.04
+
+ENV DEBIAN_FRONTEND noninteractive
+RUN apt-get update
+RUN apt-get upgrade -y
+
+RUN apt-get install -qy curl git python2.7 python-pip python-dev
+
+# this is a workaround, to make sure that docker's cache is invalidated whenever the git repo changes
+ADD https://api.github.com/repos/ethereum/pyethereum/git/refs/heads/develop unused.txt
+
+RUN git clone --branch develop --recursive https://github.com/ethereum/pyethereum.git
+
+RUN cd pyethereum && curl https://bootstrap.pypa.io/bootstrap-buildout.py | python
+
+RUN cd pyethereum && bin/buildout
+
+#default port for incoming requests
+EXPOSE 30303
+
+WORKDIR /pyethereum
+
+ENTRYPOINT ["bin/python", "tests/test_vm.py"]
diff --git a/tests/files/ansible/test-files/testrunner.sh b/tests/files/ansible/test-files/testrunner.sh
new file mode 100644
index 000000000..c7763b1f1
--- /dev/null
+++ b/tests/files/ansible/test-files/testrunner.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+# create random virtual machine test
+
+mkdir --parents ~/testout
+cd ~/testout
+export EVMJIT="-cache=0"
+while [ 1 ]
+do
+ TEST="$(docker run --rm --entrypoint=\"/cpp-ethereum/build/test/createRandomStateTest\" ethereum/cppjit-testrunner)"
+ # echo "$TEST"
+
+ # test pyethereum
+ OUTPUT_PYTHON="$(docker run --rm ethereum/python-testrunner --notrace <<< "$TEST")"
+ RESULT_PYTHON=$?
+
+ # test go
+ OUTPUT_GO="$(docker run --rm ethereum/go-testrunner "$TEST")"
+ RESULT_GO=$?
+
+ # test cpp-jit
+ OUTPUT_CPPJIT="$(docker run --rm ethereum/cppjit-testrunner "$TEST")"
+ RESULT_CPPJIT=$?
+
+ # go fails
+ if [ "$RESULT_GO" -ne 0 ]; then
+ echo Failed:
+ echo Output_GO:
+ echo $OUTPUT_GO
+ echo Test:
+ echo "$TEST"
+ echo "$TEST" > FailedTest.json
+ mv FailedTest.json $(date -d "today" +"%Y%m%d%H%M")GO.json # replace with scp to central server
+ fi
+
+ # python fails
+ if [ "$RESULT_PYTHON" -ne 0 ]; then
+ echo Failed:
+ echo Output_PYTHON:
+ echo $OUTPUT_PYTHON
+ echo Test:
+ echo "$TEST"
+ echo "$TEST" > FailedTest.json
+ mv FailedTest.json $(date -d "today" +"%Y%m%d%H%M")PYTHON.json
+ fi
+
+ # cppjit fails
+ if [ "$RESULT_CPPJIT" -ne 0 ]; then
+ echo Failed:
+ echo Output_CPPJIT:
+ echo $OUTPUT_CPPJIT
+ echo Test:
+ echo "$TEST"
+ echo "$TEST" > FailedTest.json
+ mv FailedTest.json $(date -d "today" +"%Y%m%d%H%M")CPPJIT.json
+ fi
+done