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