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.

54 lines
1.3 KiB

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