Add IPv6 support for P2P integration tests (#4340)

This commit is contained in:
Erik Grinaker
2020-01-27 10:40:54 +01:00
committed by GitHub
parent 696e13e1ff
commit 48be9bcb09
25 changed files with 204 additions and 121 deletions
+5 -4
View File
@@ -1,7 +1,8 @@
#! /bin/bash
set -eu
NUM_OF_PEERS=$1
IPV=$1
NUM_OF_PEERS=$2
# how many attempts for each peer to catch up by height
MAX_ATTEMPTS_TO_CATCH_UP=120
@@ -9,7 +10,7 @@ MAX_ATTEMPTS_TO_CATCH_UP=120
echo "Waiting for nodes to come online"
set +e
for i in $(seq 1 "$NUM_OF_PEERS"); do
addr=$(test/p2p/ip.sh "$i"):26657
addr=$(test/p2p/address.sh $IPV $i 26657)
curl -s "$addr/status" > /dev/null
ERR=$?
while [ "$ERR" != 0 ]; do
@@ -22,7 +23,7 @@ done
set -e
# get the first peer's height
addr=$(test/p2p/ip.sh 1):26657
addr=$(test/p2p/address.sh $IPV 1 26657)
h1=$(curl -s "$addr/status" | jq .result.sync_info.latest_block_height | sed -e "s/^\"\(.*\)\"$/\1/g")
echo "1st peer is on height $h1"
@@ -32,7 +33,7 @@ for i in $(seq 2 "$NUM_OF_PEERS"); do
hi=0
while [[ $hi -le $h1 ]] ; do
addr=$(test/p2p/ip.sh "$i"):26657
addr=$(test/p2p/address.sh $IPV $i 26657)
hi=$(curl -s "$addr/status" | jq .result.sync_info.latest_block_height | sed -e "s/^\"\(.*\)\"$/\1/g")
echo "... peer $i is on height $hi"
+4 -5
View File
@@ -3,10 +3,9 @@ set -eu
DOCKER_IMAGE=$1
NETWORK_NAME=$2
NUM_OF_PEERS=$3
NUM_OF_CRASHES=$4
cd "$GOPATH/src/github.com/tendermint/tendermint"
IPV=$3
NUM_OF_PEERS=$4
NUM_OF_CRASHES=$5
###############################################################
# NUM_OF_CRASHES times:
@@ -24,7 +23,7 @@ for i in $(seq 1 "$NUM_OF_CRASHES"); do
docker start "local_testnet_$j"
done
bash test/p2p/client.sh "$DOCKER_IMAGE" "$NETWORK_NAME" kill_all_$i "test/p2p/kill_all/check_peers.sh $NUM_OF_PEERS"
bash test/p2p/client.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$IPV" kill_all_$i "test/p2p/kill_all/check_peers.sh $IPV $NUM_OF_PEERS"
done
echo ""