Skip to content

Commit

Permalink
Add Dockerfile.test to enable testing with Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
physicsdude committed May 16, 2017
1 parent 3c266b7 commit 2f6afdc
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Dockerfile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM debian:latest

ENV HOME /home/dev

WORKDIR /home/dev/code/Nexus

VOLUME /home/dev/.Nexus

RUN apt-get update && apt-get -y --no-install-recommends install \
build-essential \
ca-certificates \
git \
libboost-all-dev \
libdb-dev \
libdb++-dev \
libgmp3-dev \
libminiupnpc-dev \
libqrencode-dev \
libqt4-dev \
libssl-dev \
psmisc \
qt4-default \
qt4-qmake \
screen \
vim \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY . /home/dev/code/Nexus

RUN cp makefile.unix Makefile && USE_LLD=1 make -j$(nproc) && rm -f Makefile

RUN qmake nexus-qt.pro "RELEASE=1" "USE_UPNP=-" "USE_LLD=1" && make -j$(nproc)

RUN cd qa/smoke && /bin/bash setup-two-local-test-nodes.sh

RUN cd /home/dev/code && git clone https://github.com/Nexusoft/PrimeSoloMiner.git && cd PrimeSoloMiner && ln -s makefile.unix Makefile && make -j$(nproc)

CMD /bin/bash qa/smoke/start-local-testnet.sh
24 changes: 24 additions & 0 deletions qa/smoke/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,30 @@ in your ~/.Nexus/ directory.

If you choose to do this be careful not to run any other instances of nexus on this computer.

# Docker

You can run a test environment using Docker.

Change into the directory containing Dockerfile.test - this is currently the root directory of this project (two levels down from this readme).

To build:

```Bash
docker build -t nexus-test-build -f Dockerfile.test .
```

To run:

```Bash
docker run -it nexus-test-build bash
```

From inside, run this command to start two nexus daemons and the prime solo miner:

```Bash
/bin/bash /home/dev/code/Nexus/qa/smoke/start-local-testnet.sh
```

# Local Nexus smoke testing info.

The other scripts in this directory are designed help you smoke test nexus locally.
Expand Down
21 changes: 21 additions & 0 deletions qa/smoke/start-local-testnet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -vex

echo "starting local regression test nodes"

cd /home/dev/nexustest

cd testnet1

./run-test-nexus.sh &

cd ../testnet2

./run-test-nexus.sh &

cd $HOME/code/Nexus/qa/smoke

./startminerfortest.sh &

exit 0

0 comments on commit 2f6afdc

Please sign in to comment.