github.com/pokt-network/tendermint@v0.32.11-0.20230426215212-59310158d3e9/test/p2p/kill_all/test.sh (about)

     1  #! /bin/bash
     2  set -eu
     3  
     4  DOCKER_IMAGE=$1
     5  NETWORK_NAME=$2
     6  IPV=$3
     7  NUM_OF_PEERS=$4
     8  NUM_OF_CRASHES=$5
     9  
    10  ###############################################################
    11  # NUM_OF_CRASHES times:
    12  # 	restart all peers
    13  # 	wait for them to sync and check that they are making progress
    14  ###############################################################
    15  
    16  for i in $(seq 1 "$NUM_OF_CRASHES"); do
    17    echo ""
    18    echo "Restarting all peers! Take $i ..."
    19  
    20    # restart all peers
    21    for j in $(seq 1 "$NUM_OF_PEERS"); do
    22      docker stop "local_testnet_$j"
    23      docker start "local_testnet_$j"
    24    done
    25  
    26    bash test/p2p/client.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$IPV" kill_all_$i "test/p2p/kill_all/check_peers.sh $IPV $NUM_OF_PEERS"
    27  done
    28  
    29  echo ""
    30  echo "PASS"
    31  echo ""