blob: 56f0774f47eeedafee3abe8a860a08c9726a0178 [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#
Simon Butcher6eaf3652016-04-10 15:11:27 +01005# Copyright (c) 2016, ARM Limited, All Rights Reserved
Bence Szépkúti4e9f7122020-06-05 13:02:18 +02006# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
7#
8# This file is provided under the Apache License 2.0, or the
9# GNU General Public License v2.0 or later.
10#
11# **********
12# Apache License 2.0:
Bence Szépkúti09b4f192020-05-26 01:54:15 +020013#
14# Licensed under the Apache License, Version 2.0 (the "License"); you may
15# not use this file except in compliance with the License.
16# You may obtain a copy of the License at
17#
18# http://www.apache.org/licenses/LICENSE-2.0
19#
20# Unless required by applicable law or agreed to in writing, software
21# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
22# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23# See the License for the specific language governing permissions and
24# limitations under the License.
25#
Bence Szépkúti4e9f7122020-06-05 13:02:18 +020026# **********
27#
28# **********
29# GNU General Public License v2.0 or later:
30#
31# This program is free software; you can redistribute it and/or modify
32# it under the terms of the GNU General Public License as published by
33# the Free Software Foundation; either version 2 of the License, or
34# (at your option) any later version.
35#
36# This program is distributed in the hope that it will be useful,
37# but WITHOUT ANY WARRANTY; without even the implied warranty of
38# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39# GNU General Public License for more details.
40#
41# You should have received a copy of the GNU General Public License along
42# with this program; if not, write to the Free Software Foundation, Inc.,
43# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
44#
45# **********
46#
Bence Szépkúti09b4f192020-05-26 01:54:15 +020047# This file is part of Mbed TLS (https://tls.mbed.org)
Simon Butcher6eaf3652016-04-10 15:11:27 +010048#
49# Purpose
50#
Janos Follath831a65f2016-03-21 09:22:58 +000051# List the server and client logs on failed ssl-opt.sh and compat.sh tests.
52# This script is used to make the logs show up in the Travis test results.
Simon Butcher6eaf3652016-04-10 15:11:27 +010053#
Janos Follath831a65f2016-03-21 09:22:58 +000054# Some of the logs can be very long: this means usually a couple of megabytes
Simon Butcher6eaf3652016-04-10 15:11:27 +010055# 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 +000056# is more than 630 Megabytes long.
57
58if [ -d include/mbedtls ]; then :; else
59 echo "$0: must be run from root" >&2
60 exit 1
61fi
62
63FILES="o-srv-*.log o-cli-*.log c-srv-*.log c-cli-*.log o-pxy-*.log"
Simon Butcher6eaf3652016-04-10 15:11:27 +010064MAX_LOG_SIZE=1048576
Janos Follath831a65f2016-03-21 09:22:58 +000065
66for PATTERN in $FILES; do
67 for LOG in $( ls tests/$PATTERN 2>/dev/null ); do
68 echo
69 echo "****** BEGIN file: $LOG ******"
70 echo
Simon Butcher6eaf3652016-04-10 15:11:27 +010071 tail -c $MAX_LOG_SIZE $LOG
Janos Follath831a65f2016-03-21 09:22:58 +000072 echo "****** END file: $LOG ******"
73 echo
74 rm $LOG
75 done
76done