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.

42 lines
1.4 KiB

  1. #! /bin/bash
  2. set -eu
  3. DOCKER_IMAGE=$1
  4. NETWORK_NAME=local_testnet
  5. N=4
  6. PROXY_APP=persistent_kvstore
  7. IPV=${2:-4} # Default to IPv4
  8. if [[ "$IPV" != "4" && "$IPV" != "6" ]]; then
  9. echo "IP version must be 4 or 6" >&2
  10. exit 1
  11. fi
  12. # stop the existing testnet and remove local network
  13. set +e
  14. bash test/p2p/local_testnet_stop.sh "$NETWORK_NAME" "$N"
  15. set -e
  16. PERSISTENT_PEERS=$(bash test/p2p/persistent_peers.sh $IPV $N $DOCKER_IMAGE)
  17. # start the testnet on a local network
  18. # NOTE we re-use the same network for all tests
  19. bash test/p2p/local_testnet_start.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$IPV" "$N" "$PROXY_APP" "$PERSISTENT_PEERS"
  20. # test basic connectivity and consensus
  21. # start client container and check the num peers and height for all nodes
  22. bash test/p2p/client.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$IPV" basic "test/p2p/basic/test.sh $IPV $N"
  23. # test atomic broadcast:
  24. # start client container and test sending a tx to each node
  25. bash test/p2p/client.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$IPV" ab "test/p2p/atomic_broadcast/test.sh $IPV $N"
  26. # test fast sync (from current state of network):
  27. # for each node, kill it and readd via fast sync
  28. bash test/p2p/fast_sync/test.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$IPV" "$N" "$PROXY_APP"
  29. # test killing all peers 3 times
  30. bash test/p2p/kill_all/test.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$IPV" "$N" 3
  31. # test pex
  32. bash test/p2p/pex/test.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$IPV" "$N" "$PROXY_APP"