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

     1  #! /bin/bash
     2  set -eux
     3  
     4  # Take IP version as parameter
     5  IPV="${1:-4}"
     6  
     7  # Get the directory of where this script is.
     8  SOURCE="${BASH_SOURCE[0]}"
     9  while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
    10  DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
    11  
    12  # Enable IPv6 support in Docker daemon
    13  if [[ "$IPV" == "6" ]]; then
    14  	echo
    15  	echo "* [$(date +"%T")] enabling IPv6 stack in Docker daemon"
    16  	cat <<'EOF' | sudo tee /etc/docker/daemon.json
    17  {
    18  	"ipv6": true,
    19  	"fixed-cidr-v6": "2001:db8:1::/64"
    20  }
    21  EOF
    22  	sudo service docker restart
    23  fi
    24  
    25  LOGS_DIR="$DIR/logs"
    26  echo
    27  echo "* [$(date +"%T")] cleaning up $LOGS_DIR"
    28  rm -rf "$LOGS_DIR"
    29  mkdir -p "$LOGS_DIR"
    30  
    31  set +e
    32  echo
    33  echo "* [$(date +"%T")] removing run_test container"
    34  docker rm -vf run_test
    35  set -e
    36  
    37  echo
    38  echo "* [$(date +"%T")] starting rsyslog container"
    39  docker rm -f rsyslog || true
    40  docker run -d -v "$LOGS_DIR:/var/log/" -p 127.0.0.1:5514:514/udp --name rsyslog voxxit/rsyslog
    41  
    42  set +u
    43  if [[ "$SKIP_BUILD" == "" ]]; then
    44  	echo
    45  	echo "* [$(date +"%T")] building docker image"
    46  	bash "$DIR/../docker/build.sh"
    47  fi
    48  
    49  echo
    50  echo "* [$(date +"%T")] running IPv$IPV p2p tests on a local docker network"
    51  bash "$DIR/../p2p/test.sh" tester $IPV
    52  
    53  echo
    54  echo "* [$(date +"%T")] copying log files out of docker container into $LOGS_DIR"
    55  docker cp rsyslog:/var/log $LOGS_DIR