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.

26 lines
496 B

  1. #! /bin/bash
  2. set -eu
  3. DOCKER_IMAGE=$1
  4. NETWORK_NAME=$2
  5. IPV=$3
  6. ID=$4
  7. CMD=$5
  8. NAME=test_container_$ID
  9. if [[ "$IPV" == 6 ]]; then
  10. IP_SWITCH="--ip6"
  11. else
  12. IP_SWITCH="--ip"
  13. fi
  14. echo "starting test client container with CMD=$CMD"
  15. # run the test container on the local network
  16. docker run -t --rm \
  17. -v "$PWD/test/p2p/:/go/src/github.com/tendermint/tendermint/test/p2p" \
  18. --net="$NETWORK_NAME" \
  19. $IP_SWITCH=$(test/p2p/address.sh $IPV -1) \
  20. --name "$NAME" \
  21. --entrypoint bash \
  22. "$DOCKER_IMAGE" $CMD