You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
735 B

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