test/p2p: use PROXY_APP=persistent_dummy

This commit is contained in:
Anton Kalyaev
2016-12-22 01:39:06 +04:00
committed by Ethan Buchman
parent 30328548f7
commit 69a449a073
7 changed files with 23 additions and 13 deletions

View File

@@ -71,6 +71,8 @@ func DefaultClientCreator(config cfg.Config) ClientCreator {
switch addr {
case "dummy":
return NewLocalClientCreator(dummy.NewDummyApplication())
case "persistent_dummy":
return NewLocalClientCreator(dummy.NewPersistentDummyApplication(config.GetString("db_dir")))
case "nilapp":
return NewLocalClientCreator(nilapp.NewNilApplication())
default:

View File

@@ -4,12 +4,13 @@ set -eu
DOCKER_IMAGE=$1
NETWORK_NAME=$2
N=$3
PROXY_APP=$4
cd $GOPATH/src/github.com/tendermint/tendermint
# run it on each of them
for i in `seq 1 $N`; do
bash test/p2p/fast_sync/test_peer.sh $DOCKER_IMAGE $NETWORK_NAME $i $N
bash test/p2p/fast_sync/test_peer.sh $DOCKER_IMAGE $NETWORK_NAME $i $N $PROXY_APP
done

View File

@@ -5,6 +5,7 @@ DOCKER_IMAGE=$1
NETWORK_NAME=$2
ID=$3
N=$4
PROXY_APP=$5
###############################################################
# this runs on each peer:
@@ -26,7 +27,7 @@ SEEDS="$(test/p2p/ip.sh 1):46656"
for j in `seq 2 $N`; do
SEEDS="$SEEDS,$(test/p2p/ip.sh $j):46656"
done
bash test/p2p/peer.sh $DOCKER_IMAGE $NETWORK_NAME $ID $SEEDS
bash test/p2p/peer.sh $DOCKER_IMAGE $NETWORK_NAME $ID $PROXY_APP $SEEDS
# wait for peer to sync and check the app hash
bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME fs_$ID "test/p2p/fast_sync/check_peer.sh $ID"

View File

@@ -15,6 +15,9 @@ cd "$GOPATH/src/github.com/tendermint/tendermint"
###############################################################
for i in $(seq 1 "$NUM_OF_CRASHES"); do
echo ""
echo "Restarting all peers! Take $i ..."
# restart all peers
for i in $(seq 1 "$NUM_OF_PEERS"); do
docker stop "local_testnet_$i"

View File

@@ -4,6 +4,7 @@ set -eu
DOCKER_IMAGE=$1
NETWORK_NAME=$2
N=$3
APP_PROXY=$4
cd $GOPATH/src/github.com/tendermint/tendermint
@@ -17,5 +18,5 @@ done
echo "Seeds: $seeds"
for i in `seq 1 $N`; do
bash test/p2p/peer.sh $DOCKER_IMAGE $NETWORK_NAME $i $seeds
bash test/p2p/peer.sh $DOCKER_IMAGE $NETWORK_NAME $i $APP_PROXY $seeds
done

View File

@@ -4,9 +4,10 @@ set -eu
DOCKER_IMAGE=$1
NETWORK_NAME=$2
ID=$3
APP_PROXY=$4
set +u
SEEDS=$4
SEEDS=$5
set -u
if [[ "$SEEDS" != "" ]]; then
SEEDS=" --seeds $SEEDS "
@@ -15,10 +16,9 @@ fi
echo "starting tendermint peer ID=$ID"
# start tendermint container on the network
docker run -d \
--net=$NETWORK_NAME \
--ip=$(test/p2p/ip.sh $ID) \
--name local_testnet_$ID \
--entrypoint tendermint \
-v $GOPATH/src/github.com/tendermint/tendermint/test/p2p/:/go/src/github.com/tendermint/tendermint/test/p2p \
-e TMROOT=/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core \
$DOCKER_IMAGE node $SEEDS --proxy_app=dummy
--net=$NETWORK_NAME \
--ip=$(test/p2p/ip.sh $ID) \
--name local_testnet_$ID \
--entrypoint tendermint \
-e TMROOT=/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core \
$DOCKER_IMAGE node $SEEDS --proxy_app=$APP_PROXY

View File

@@ -4,6 +4,7 @@ set -eu
DOCKER_IMAGE=$1
NETWORK_NAME=local_testnet
N=4
PROXY_APP=persistent_dummy
cd $GOPATH/src/github.com/tendermint/tendermint
@@ -13,7 +14,8 @@ bash test/p2p/local_testnet_stop.sh $NETWORK_NAME $N
set -e
# start the testnet on a local network
bash test/p2p/local_testnet_start.sh $DOCKER_IMAGE $NETWORK_NAME $N
# NOTE we re-use the same network for all tests
bash test/p2p/local_testnet_start.sh $DOCKER_IMAGE $NETWORK_NAME $N $PROXY_APP
# test basic connectivity and consensus
# start client container and check the num peers and height for all nodes
@@ -25,7 +27,7 @@ bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME ab "test/p2p/atomic_broadcas
# test fast sync (from current state of network):
# for each node, kill it and readd via fast sync
bash test/p2p/fast_sync/test.sh $DOCKER_IMAGE $NETWORK_NAME $N
bash test/p2p/fast_sync/test.sh $DOCKER_IMAGE $NETWORK_NAME $N $PROXY_APP
# test killing all peers
bash test/p2p/kill_all/test.sh $DOCKER_IMAGE $NETWORK_NAME $N 3