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 | # |
Simon Butcher | 6eaf365 | 2016-04-10 15:11:27 +0100 | [diff] [blame] | 5 | # Copyright (c) 2016, ARM Limited, All Rights Reserved |
Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 |
| 7 | # |
| 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 9 | # not use this file except in compliance with the License. |
| 10 | # You may obtain a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, software |
| 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | # See the License for the specific language governing permissions and |
| 18 | # limitations under the License. |
| 19 | # |
| 20 | # This file is part of Mbed TLS (https://tls.mbed.org) |
Simon Butcher | 6eaf365 | 2016-04-10 15:11:27 +0100 | [diff] [blame] | 21 | # |
| 22 | # Purpose |
| 23 | # |
Janos Follath | 831a65f | 2016-03-21 09:22:58 +0000 | [diff] [blame] | 24 | # List the server and client logs on failed ssl-opt.sh and compat.sh tests. |
| 25 | # 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] | 26 | # |
Janos Follath | 831a65f | 2016-03-21 09:22:58 +0000 | [diff] [blame] | 27 | # 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] | 28 | # 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] | 29 | # is more than 630 Megabytes long. |
| 30 | |
| 31 | if [ -d include/mbedtls ]; then :; else |
| 32 | echo "$0: must be run from root" >&2 |
| 33 | exit 1 |
| 34 | fi |
| 35 | |
| 36 | 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] | 37 | MAX_LOG_SIZE=1048576 |
Janos Follath | 831a65f | 2016-03-21 09:22:58 +0000 | [diff] [blame] | 38 | |
| 39 | for PATTERN in $FILES; do |
| 40 | for LOG in $( ls tests/$PATTERN 2>/dev/null ); do |
| 41 | echo |
| 42 | echo "****** BEGIN file: $LOG ******" |
| 43 | echo |
Simon Butcher | 6eaf365 | 2016-04-10 15:11:27 +0100 | [diff] [blame] | 44 | tail -c $MAX_LOG_SIZE $LOG |
Janos Follath | 831a65f | 2016-03-21 09:22:58 +0000 | [diff] [blame] | 45 | echo "****** END file: $LOG ******" |
| 46 | echo |
| 47 | rm $LOG |
| 48 | done |
| 49 | done |