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.

34 lines
803 B

  1. #! /bin/bash
  2. set -eu
  3. DOCKER_IMAGE=$1
  4. NETWORK_NAME=local_testnet
  5. # start the testnet on a local network
  6. bash test/p2p/local_testnet.sh $DOCKER_IMAGE $NETWORK_NAME
  7. # test atomic broadcast
  8. bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME test/p2p/atomic_broadcast/test.sh
  9. # test fast sync (from current state of network)
  10. # run it on each of them
  11. N=4
  12. for i in `seq 1 $N`; do
  13. echo "Testing fasysync on node $i"
  14. # kill peer
  15. docker rm -vf local_testnet_$i
  16. # restart peer - should have an empty blockchain
  17. SEEDS="$(test/p2p/ip.sh 1):46656"
  18. for j in `seq 2 $N`; do
  19. SEEDS="$SEEDS,$(test/p2p/ip.sh $j):46656"
  20. done
  21. bash test/p2p/peer.sh $DOCKER_IMAGE $NETWORK_NAME $i $SEEDS
  22. bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME "test/p2p/fast_sync/test.sh $i"
  23. done
  24. echo ""
  25. echo "PASS"
  26. echo ""