blob: 3daecf30df3ffc7d564a19a7fe8b9be4d61dc7be [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#
Bence Szépkúti1e148272020-08-07 13:07:28 +02005# Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +00006# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Bence Szépkútic7da1fe2020-05-26 01:54:15 +02007#
Simon Butcher6eaf3652016-04-10 15:11:27 +01008# Purpose
9#
Janos Follath831a65f2016-03-21 09:22:58 +000010# 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.
Simon Butcher6eaf3652016-04-10 15:11:27 +010012#
Janos Follath831a65f2016-03-21 09:22:58 +000013# Some of the logs can be very long: this means usually a couple of megabytes
Simon Butcher6eaf3652016-04-10 15:11:27 +010014# 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 +000015# is more than 630 Megabytes long.
16
17if [ -d include/mbedtls ]; then :; else
18 echo "$0: must be run from root" >&2
19 exit 1
20fi
21
22FILES="o-srv-*.log o-cli-*.log c-srv-*.log c-cli-*.log o-pxy-*.log"
Simon Butcher6eaf3652016-04-10 15:11:27 +010023MAX_LOG_SIZE=1048576
Janos Follath831a65f2016-03-21 09:22:58 +000024
25for PATTERN in $FILES; do
26 for LOG in $( ls tests/$PATTERN 2>/dev/null ); do
27 echo
28 echo "****** BEGIN file: $LOG ******"
29 echo
Simon Butcher6eaf3652016-04-10 15:11:27 +010030 tail -c $MAX_LOG_SIZE $LOG
Janos Follath831a65f2016-03-21 09:22:58 +000031 echo "****** END file: $LOG ******"
32 echo
33 rm $LOG
34 done
35done