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.

35 lines
864 B

  1. #!/usr/bin/env bash
  2. #
  3. # This is a convenience script that takes a list of testnet manifests
  4. # as arguments and runs each one of them sequentially. If a testnet
  5. # fails, the container logs are dumped to stdout along with the testnet
  6. # manifest.
  7. #
  8. # This is mostly used to run generated networks in nightly CI jobs.
  9. #
  10. # Don't set -e, since we explicitly check status codes ourselves.
  11. set -u
  12. if [[ $# == 0 ]]; then
  13. echo "Usage: $0 [MANIFEST...]" >&2
  14. exit 1
  15. fi
  16. for MANIFEST in "$@"; do
  17. START=$SECONDS
  18. echo "==> Running testnet $MANIFEST..."
  19. ./build/runner -f "$MANIFEST"
  20. if [[ $? -ne 0 ]]; then
  21. echo "==> Testnet $MANIFEST failed, dumping manifest..."
  22. cat "$MANIFEST"
  23. echo "==> Dumping container logs for $MANIFEST..."
  24. ./build/runner -f "$MANIFEST" logs
  25. exit 1
  26. fi
  27. echo "==> Completed testnet $MANIFEST in $(( SECONDS - START ))s"
  28. echo ""
  29. done