travis-log-failure.sh 971 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. # travis-log-failure.sh
  3. #
  4. # This file is part of mbed TLS (https://tls.mbed.org)
  5. #
  6. # Copyright (c) 2016, ARM Limited, All Rights Reserved
  7. #
  8. # Purpose
  9. #
  10. # List the server and client logs on failed ssl-opt.sh and compat.sh tests.
  11. # This script is used to make the logs show up in the Travis test results.
  12. #
  13. # Some of the logs can be very long: this means usually a couple of megabytes
  14. # but it can be much more. For example, the client log of test 273 in ssl-opt.sh
  15. # is more than 630 Megabytes long.
  16. if [ -d include/mbedtls ]; then :; else
  17. echo "$0: must be run from root" >&2
  18. exit 1
  19. fi
  20. FILES="o-srv-*.log o-cli-*.log c-srv-*.log c-cli-*.log o-pxy-*.log"
  21. MAX_LOG_SIZE=1048576
  22. for PATTERN in $FILES; do
  23. for LOG in $( ls tests/$PATTERN 2>/dev/null ); do
  24. echo
  25. echo "****** BEGIN file: $LOG ******"
  26. echo
  27. tail -c $MAX_LOG_SIZE $LOG
  28. echo "****** END file: $LOG ******"
  29. echo
  30. rm $LOG
  31. done
  32. done