From 83a5ae3deff15da6aef3860f1c89401be9823eea Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Mon, 3 Jun 2019 11:47:28 +0200 Subject: [PATCH] ci: download monero tests binary in docker closes #212 --- ci/Dockerfile | 10 ++++++++++ core/tests/run_tests_device_emu_monero.sh | 2 ++ 2 files changed, 12 insertions(+) diff --git a/ci/Dockerfile b/ci/Dockerfile index 9e69427e2..033052e10 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -75,6 +75,16 @@ RUN $PYTHON -m zipfile -e "protoc-${PROTOBUF_VERSION}-linux-x86_64.zip" /usr/loc ENV WORKON_HOME=/tmp/.venvs +# download monero tests binary + +ENV TREZOR_MONERO_TESTS_SHA256SUM=140a16b3d6105b5e8e88a93b451e9600a36ed23928ea3cf2f975f9c83f36dab7 +ENV TREZOR_MONERO_TESTS_URL="https://github.com/ph4r05/monero/releases/download/v0.14.1.0-tests-u14.04-01/trezor_tests" +ENV TREZOR_MONERO_TESTS_PATH="/opt/trezor_monero_tests" + +RUN wget "$TREZOR_MONERO_TESTS_URL" -O "$TREZOR_MONERO_TESTS_PATH" \ + && chmod +x "$TREZOR_MONERO_TESTS_PATH" +RUN echo "${TREZOR_MONERO_TESTS_SHA256SUM} ${TREZOR_MONERO_TESTS_PATH}" | sha256sum -c + # install python dependencies RUN pip install pipenv diff --git a/core/tests/run_tests_device_emu_monero.sh b/core/tests/run_tests_device_emu_monero.sh index 19241cf02..90659a152 100755 --- a/core/tests/run_tests_device_emu_monero.sh +++ b/core/tests/run_tests_device_emu_monero.sh @@ -66,6 +66,8 @@ if [[ ! -f "$TREZOR_MONERO_TESTS_PATH" || "`shasum -a256 "$TREZOR_MONERO_TESTS_P curl -L -o "$TREZOR_MONERO_TESTS_PATH" "$TREZOR_MONERO_TESTS_URL" \ && chmod +x "$TREZOR_MONERO_TESTS_PATH" \ && test "`shasum -a256 "$TREZOR_MONERO_TESTS_PATH" | cut -d' ' -f1`" == "$TREZOR_MONERO_TESTS_SHA256SUM" || exit 1 +else + echo "Trezor monero binary with valid hash already present at $TREZOR_MONERO_TESTS_PATH - not downloading again." fi echo "Running tests"