commit
b8279d424c
|
@ -40,6 +40,7 @@ for i in $(seq 2 "$NUM_OF_PEERS"); do
|
||||||
((attempt++))
|
((attempt++))
|
||||||
if [ "$attempt" -ge $MAX_ATTEMPTS_TO_CATCH_UP ] ; then
|
if [ "$attempt" -ge $MAX_ATTEMPTS_TO_CATCH_UP ] ; then
|
||||||
echo "$attempt unsuccessful attempts were made to catch up"
|
echo "$attempt unsuccessful attempts were made to catch up"
|
||||||
|
curl -s "$addr/dump_consensus_state" | jq .result[1]
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -13,16 +13,30 @@ if [[ "$SEEDS" != "" ]]; then
|
||||||
SEEDS=" --seeds $SEEDS "
|
SEEDS=" --seeds $SEEDS "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
set +eu
|
||||||
|
|
||||||
echo "starting tendermint peer ID=$ID"
|
echo "starting tendermint peer ID=$ID"
|
||||||
# start tendermint container on the network
|
# start tendermint container on the network
|
||||||
docker run -d \
|
if [[ "$CIRCLECI" == true ]]; then
|
||||||
--net=$NETWORK_NAME \
|
set -u
|
||||||
--ip=$(test/p2p/ip.sh $ID) \
|
docker run -d \
|
||||||
--name local_testnet_$ID \
|
--net=$NETWORK_NAME \
|
||||||
--entrypoint tendermint \
|
--ip=$(test/p2p/ip.sh $ID) \
|
||||||
-e TMROOT=/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core \
|
--name local_testnet_$ID \
|
||||||
--log-driver=syslog \
|
--entrypoint tendermint \
|
||||||
--log-opt syslog-address=udp://127.0.0.1:5514 \
|
-e TMROOT=/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$ID/core \
|
||||||
--log-opt syslog-facility=daemon \
|
--log-driver=syslog \
|
||||||
--log-opt tag="{{.Name}}" \
|
--log-opt syslog-address=udp://127.0.0.1:5514 \
|
||||||
$DOCKER_IMAGE node $SEEDS --proxy_app=$APP_PROXY
|
--log-opt syslog-facility=daemon \
|
||||||
|
--log-opt tag="{{.Name}}" \
|
||||||
|
$DOCKER_IMAGE node $SEEDS --log_level=debug --proxy_app=$APP_PROXY
|
||||||
|
else
|
||||||
|
set -u
|
||||||
|
docker run -d \
|
||||||
|
--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 --log_level=info --proxy_app=$APP_PROXY
|
||||||
|
fi
|
||||||
|
|
|
@ -46,29 +46,6 @@ function kill_procs(){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# wait till node is up, send txs
|
|
||||||
function send_txs(){
|
|
||||||
addr="127.0.0.1:46657"
|
|
||||||
curl -s $addr/status > /dev/null
|
|
||||||
ERR=$?
|
|
||||||
while [ "$ERR" != 0 ]; do
|
|
||||||
sleep 1
|
|
||||||
curl -s $addr/status > /dev/null
|
|
||||||
ERR=$?
|
|
||||||
done
|
|
||||||
|
|
||||||
# send a bunch of txs over a few blocks
|
|
||||||
echo "Node is up, sending txs"
|
|
||||||
for i in $(seq 1 5); do
|
|
||||||
for _ in $(seq 1 100); do
|
|
||||||
tx=$(head -c 8 /dev/urandom | hexdump -ve '1/1 "%.2X"')
|
|
||||||
curl -s "$addr/broadcast_tx_async?tx=0x$tx" &> /dev/null
|
|
||||||
done
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
failsStart=0
|
failsStart=0
|
||||||
fails=$(grep -r "fail.Fail" --include \*.go . | wc -l)
|
fails=$(grep -r "fail.Fail" --include \*.go . | wc -l)
|
||||||
failsEnd=$((fails-1))
|
failsEnd=$((fails-1))
|
||||||
|
@ -78,12 +55,13 @@ for failIndex in $(seq $failsStart $failsEnd); do
|
||||||
echo "* Test FailIndex $failIndex"
|
echo "* Test FailIndex $failIndex"
|
||||||
# test failure at failIndex
|
# test failure at failIndex
|
||||||
|
|
||||||
send_txs &
|
bash ./test/utils/txs.sh "localhost:46657" &
|
||||||
start_procs 1 "$failIndex"
|
start_procs 1 "$failIndex"
|
||||||
|
|
||||||
# tendermint should fail when it hits the fail index
|
# tendermint should fail when it hits the fail index
|
||||||
kill -9 "$PID_DUMMY"
|
kill -9 "$PID_DUMMY"
|
||||||
wait "$PID_DUMMY"
|
wait "$PID_DUMMY"
|
||||||
|
wait "$PID_TENDERMINT"
|
||||||
|
|
||||||
start_procs 2
|
start_procs 2
|
||||||
|
|
||||||
|
|
12
test/test.sh
12
test/test.sh
|
@ -12,10 +12,14 @@ echo "* [$(date +"%T")] cleaning up $LOGS_DIR"
|
||||||
rm -rf "$LOGS_DIR"
|
rm -rf "$LOGS_DIR"
|
||||||
mkdir -p "$LOGS_DIR"
|
mkdir -p "$LOGS_DIR"
|
||||||
|
|
||||||
echo
|
set +u
|
||||||
echo "* [$(date +"%T")] starting rsyslog container"
|
if [[ "$CIRCLECI" == true ]]; then
|
||||||
docker rm -f rsyslog || true
|
set -u
|
||||||
docker run -d -v "$LOGS_DIR:/var/log/" -p 127.0.0.1:5514:514/udp --name rsyslog voxxit/rsyslog
|
echo
|
||||||
|
echo "* [$(date +"%T")] starting rsyslog container"
|
||||||
|
docker rm -f rsyslog || true
|
||||||
|
docker run -d -v "$LOGS_DIR:/var/log/" -p 127.0.0.1:5514:514/udp --name rsyslog voxxit/rsyslog
|
||||||
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "* [$(date +"%T")] building docker image"
|
echo "* [$(date +"%T")] building docker image"
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
#! /bin/bash
|
||||||
|
set -u
|
||||||
|
|
||||||
|
# wait till node is up, send txs
|
||||||
|
ADDR=$1 #="127.0.0.1:46657"
|
||||||
|
curl -s $ADDR/status > /dev/null
|
||||||
|
ERR=$?
|
||||||
|
while [ "$ERR" != 0 ]; do
|
||||||
|
sleep 1
|
||||||
|
curl -s $ADDR/status > /dev/null
|
||||||
|
ERR=$?
|
||||||
|
done
|
||||||
|
|
||||||
|
# send a bunch of txs over a few blocks
|
||||||
|
echo "Node is up, sending txs"
|
||||||
|
for i in $(seq 1 5); do
|
||||||
|
for _ in $(seq 1 100); do
|
||||||
|
tx=$(head -c 8 /dev/urandom | hexdump -ve '1/1 "%.2X"')
|
||||||
|
curl -s "$ADDR/broadcast_tx_async?tx=0x$tx" &> /dev/null
|
||||||
|
done
|
||||||
|
echo "sent 100"
|
||||||
|
sleep 1
|
||||||
|
done
|
Loading…
Reference in New Issue