blob: 9866ca7da82f129060521db960fcee799582a0f7 [file] [log] [blame]
Janos Follath831a65f2016-03-21 09:22:58 +00001#!/bin/sh
2
Simon Butcher6eaf3652016-04-10 15:11:27 +01003# 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 Follath831a65f2016-03-21 09:22:58 +000011# 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 Butcher6eaf3652016-04-10 15:11:27 +010013#
Janos Follath831a65f2016-03-21 09:22:58 +000014# Some of the logs can be very long: this means usually a couple of megabytes
Simon Butcher6eaf3652016-04-10 15:11:27 +010015# but it can be much more. For example, the client log of test 273 in ssl-opt.sh
Janos Follath831a65f2016-03-21 09:22:58 +000016# is more than 630 Megabytes long.
17
18if [ -d include/mbedtls ]; then :; else
19 echo "$0: must be run from root" >&2
20 exit 1
21fi
22
23FILES="o-srv-*.log o-cli-*.log c-srv-*.log c-cli-*.log o-pxy-*.log"
Simon Butcher6eaf3652016-04-10 15:11:27 +010024MAX_LOG_SIZE=1048576
Janos Follath831a65f2016-03-21 09:22:58 +000025
26for 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 Butcher6eaf3652016-04-10 15:11:27 +010031 tail -c $MAX_LOG_SIZE $LOG
Janos Follath831a65f2016-03-21 09:22:58 +000032 echo "****** END file: $LOG ******"
33 echo
34 rm $LOG
35 done
36done