Regression tester for BlocknetDX.
The tool uses a .dxregress.yml
config at $HOME/.dxregress.yml
.
Use --config=
to load configurations of various setups.
- Install Prerequisites:
- Docker CE is required: https://www.docker.com/community-edition#/download
- Go v1.8+ (https://golang.org/dl/)
- Install dxregress via go get:
go get -u github.com/BlocknetDX/dxregress
- Add go/bin to $PATH (linux):
touch ~/.profile
echo "export GOPATH=/path/to/go" >> ~/.profile
echo "PATH=$GOPATH/bin:$PATH" >> ~/.profile
- Run docker without sudo requires adding
$USER
to docker group (may need to logout):
sudo groupadd docker
sudo gpasswd -a $USER docker
dxregress localenv -h
The testenv
command is used to create a quick test environment with an activator and servicenode. The activator will begin staking to kickoff the chain.
dxregress testenv up 3.7.36
dxregress testenv up -w=SYS,SRGU54nrCQWdKj4TUX1yT5PLabo9ESxJKt,test,testAbc -w=MONA,MRPfADFi2ohhmVqgnDrrUx7TuVCmiEY9bB,test,testAbc 3.7.36
Make sure you specify the wallets' RPC IP address after the RPC password.
dxregress testenv up -w=SYS,SRGU54nrCQWdKj4TUX1yT5PLabo9ESxJKt,test,testAbc,192.168.1.200 -w=MONA,MRPfADFi2ohhmVqgnDrrUx7TuVCmiEY9bB,test,testAbc,192.168.1.201 3.7.36
dxregress testenv down
The localenv
command is used to test a development branch, including uncommitted code changes. This command applies a genesis patch to the codebase enabling regression testing in a local environment. Docker containers are used to facilitate communication between nodes. The local environment consists of 1 activator, 2 servicenodes and subsequent wallet nodes. The genesis patch is applied to the local codebase, as a result, building and running the code will result in the node joining the localenv
environment. Normal debug operations are permitted as a result.
dxregress localenv up -w=SYS,SRGU54nrCQWdKj4TUX1yT5PLabo9ESxJKt,test,testAbc -w=MONA,MRPfADFi2ohhmVqgnDrrUx7TuVCmiEY9bB,test,testAbc /path/to/codebase
dxregress localenv up -w=SYS,SRGU54nrCQWdKj4TUX1yT5PLabo9ESxJKt,test,testAbc,192.168.1.200 -w=MONA,MRPfADFi2ohhmVqgnDrrUx7TuVCmiEY9bB,test,testAbc,192.168.1.201 /path/to/codebase
dxregress localenv down /path/to/codebase
Docker commands can be used to interact with the regression test environment.
docker ps
docker exec dxregress-localenv-MONA monacoin-cli getnewaddress
docker exec dxregress-localenv-MONA tail -f /opt/blockchain/data/debug.log
docker exec dxregress-localenv-sn1 tail -f /opt/blockchain/dxregress/testnet4/debug.log
// Copyright © 2017 The Blocknet Developers
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.