blob: b8cca1c6a941b333b563632468a5d1db8180bb02 [file] [log] [blame]
Andres AG31f9b5b2016-10-04 17:14:38 +01001#! /usr/bin/env sh
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +01002
Simon Butcher3ea7f522016-03-07 23:22:10 +00003# all.sh
4#
SimonB2e23c822016-04-16 21:54:39 +01005# This file is part of mbed TLS (https://tls.mbed.org)
6#
Gilles Peskine192c72f2017-12-21 15:59:21 +01007# Copyright (c) 2014-2017, ARM Limited, All Rights Reserved
8
9
10
11################################################################
12#### Documentation
13################################################################
14
Simon Butcher3ea7f522016-03-07 23:22:10 +000015# Purpose
Gilles Peskine192c72f2017-12-21 15:59:21 +010016# -------
Simon Butcher3ea7f522016-03-07 23:22:10 +000017#
SimonB2e23c822016-04-16 21:54:39 +010018# To run all tests possible or available on the platform.
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +010019#
Gilles Peskine192c72f2017-12-21 15:59:21 +010020# Notes for users
21# ---------------
22#
SimonB2e23c822016-04-16 21:54:39 +010023# Warning: the test is destructive. It includes various build modes and
24# configurations, and can and will arbitrarily change the current CMake
Gilles Peskine192c72f2017-12-21 15:59:21 +010025# configuration. The following files must be committed into git:
26# * include/mbedtls/config.h
27# * Makefile, library/Makefile, programs/Makefile, tests/Makefile
28# After running this script, the CMake cache will be lost and CMake
29# will no longer be initialised.
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +010030#
Gilles Peskine192c72f2017-12-21 15:59:21 +010031# The script assumes the presence of a number of tools:
32# * Basic Unix tools (Windows users note: a Unix-style find must be before
33# the Windows find in the PATH)
34# * Perl
35# * GNU Make
36# * CMake
37# * GCC and Clang (recent enough for using ASan with gcc and MemSan with clang, or valgrind)
38# * arm-gcc and mingw-gcc
39# * ArmCC 5 and ArmCC 6, unless invoked with --no-armcc
40# * Yotta build dependencies, unless invoked with --no-yotta
41# * OpenSSL and GnuTLS command line tools, recent enough for the
42# interoperability tests. If they don't support SSLv3 then a legacy
43# version of these tools must be present as well (search for LEGACY
44# below).
45# See the invocation of check_tools below for details.
46#
47# This script must be invoked from the toplevel directory of a git
48# working copy of Mbed TLS.
49#
50# Note that the output is not saved. You may want to run
51# script -c tests/scripts/all.sh
52# or
53# tests/scripts/all.sh >all.log 2>&1
54#
55# Notes for maintainers
56# ---------------------
57#
58# The tests are roughly in order from fastest to slowest. This doesn't
59# have to be exact, but in general you should add slower tests towards
60# the end and fast checks near the beginning.
61#
62# Sanity checks have the following form:
63# 1. msg "short description of what is about to be done"
64# 2. run sanity check (failure stops the script)
65#
66# Build or build-and-test steps have the following form:
67# 1. msg "short description of what is about to be done"
68# 2. cleanup
69# 3. preparation (config.pl, cmake, ...) (failure stops the script)
70# 4. make
71# 5. Run tests if relevant. All tests must be prefixed with
72# if_build_successful for the sake of --keep-going.
73
74
75
76################################################################
77#### Initialization and command line parsing
78################################################################
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +010079
SimonB2e23c822016-04-16 21:54:39 +010080# Abort on errors (and uninitialised variables)
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +010081set -eu
82
Andres AG38495a32016-07-12 16:54:33 +010083if [ "$( uname )" != "Linux" ]; then
84 echo "This script only works in Linux" >&2
85 exit 1
86elif [ -d library -a -d include -a -d tests ]; then :; else
87 echo "Must be run from mbed TLS root" >&2
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +010088 exit 1
89fi
90
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000091CONFIG_H='include/mbedtls/config.h'
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +020092CONFIG_BAK="$CONFIG_H.bak"
93
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +010094MEMORY=0
SimonB2e23c822016-04-16 21:54:39 +010095FORCE=0
Gilles Peskine7c652162017-12-11 00:01:40 +010096KEEP_GOING=0
Gilles Peskinebca6ab92017-12-19 18:24:31 +010097RUN_ARMCC=1
Gilles Peskineda519252017-11-30 13:22:04 +010098YOTTA=1
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +010099
Andres AGd9eba4b2016-08-26 14:42:14 +0100100# Default commands, can be overriden by the environment
101: ${OPENSSL:="openssl"}
102: ${OPENSSL_LEGACY:="$OPENSSL"}
Manuel Pégourié-Gonnard6b368922018-02-20 12:02:07 +0100103: ${OPENSSL_NEXT:="$OPENSSL"}
Andres AGd9eba4b2016-08-26 14:42:14 +0100104: ${GNUTLS_CLI:="gnutls-cli"}
105: ${GNUTLS_SERV:="gnutls-serv"}
106: ${GNUTLS_LEGACY_CLI:="$GNUTLS_CLI"}
107: ${GNUTLS_LEGACY_SERV:="$GNUTLS_SERV"}
Andres AGdc192212016-08-31 17:33:13 +0100108: ${OUT_OF_SOURCE_DIR:=./mbedtls_out_of_source_build}
Andres AG87bb5772016-09-27 15:05:15 +0100109: ${ARMC5_BIN_DIR:=/usr/bin}
110: ${ARMC6_BIN_DIR:=/usr/bin}
Andres AGdc192212016-08-31 17:33:13 +0100111
Andres AG38495a32016-07-12 16:54:33 +0100112# if MAKEFLAGS is not set add the -j option to speed up invocations of make
113if [ -n "${MAKEFLAGS+set}" ]; then
114 export MAKEFLAGS="-j"
115fi
116
Simon Butcher41eeccf2016-09-07 00:07:09 +0100117usage()
SimonB2e23c822016-04-16 21:54:39 +0100118{
Gilles Peskine709346a2017-12-10 23:43:39 +0100119 cat <<EOF
120Usage: $0 [OPTION]...
121 -h|--help Print this help.
122
123General options:
124 -f|--force Force the tests to overwrite any modified files.
Gilles Peskine7c652162017-12-11 00:01:40 +0100125 -k|--keep-going Run all tests and report errors at the end.
Gilles Peskine709346a2017-12-10 23:43:39 +0100126 -m|--memory Additional optional memory tests.
Gilles Peskinebca6ab92017-12-19 18:24:31 +0100127 --armcc Run ARM Compiler builds (on by default).
128 --no-armcc Skip ARM Compiler builds.
Gilles Peskine38d81652018-03-21 08:40:26 +0100129 --no-force Refuse to overwrite modified files (default).
130 --no-keep-going Stop at the first error (default).
131 --no-memory No additional memory tests (default).
Gilles Peskine2a22a802017-12-21 15:19:00 +0100132 --no-yotta Skip yotta module build.
Gilles Peskine709346a2017-12-10 23:43:39 +0100133 --out-of-source-dir=<path> Directory used for CMake out-of-source build tests.
Gilles Peskine38d81652018-03-21 08:40:26 +0100134 --random-seed Use a random seed value for randomized tests (default).
Gilles Peskine709346a2017-12-10 23:43:39 +0100135 -r|--release-test Run this script in release mode. This fixes the seed value to 1.
136 -s|--seed Integer seed value to use for this test run.
Gilles Peskine2a22a802017-12-21 15:19:00 +0100137 --yotta Build yotta module (on by default).
Gilles Peskine709346a2017-12-10 23:43:39 +0100138
139Tool path options:
140 --armc5-bin-dir=<ARMC5_bin_dir_path> ARM Compiler 5 bin directory.
141 --armc6-bin-dir=<ARMC6_bin_dir_path> ARM Compiler 6 bin directory.
142 --gnutls-cli=<GnuTLS_cli_path> GnuTLS client executable to use for most tests.
143 --gnutls-serv=<GnuTLS_serv_path> GnuTLS server executable to use for most tests.
144 --gnutls-legacy-cli=<GnuTLS_cli_path> GnuTLS client executable to use for legacy tests.
145 --gnutls-legacy-serv=<GnuTLS_serv_path> GnuTLS server executable to use for legacy tests.
146 --openssl=<OpenSSL_path> OpenSSL executable to use for most tests.
147 --openssl-legacy=<OpenSSL_path> OpenSSL executable to use for legacy tests e.g. SSLv3.
Manuel Pégourié-Gonnard6b368922018-02-20 12:02:07 +0100148 --openssl-next=<OpenSSL_path> OpenSSL executable to use for recent things like ARIA
Gilles Peskine709346a2017-12-10 23:43:39 +0100149EOF
SimonB2e23c822016-04-16 21:54:39 +0100150}
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100151
152# remove built files as well as the cmake cache/config
153cleanup()
154{
Gilles Peskinea71d64c2018-03-21 12:16:57 +0100155 if [ -n "${MBEDTLS_ROOT_DIR+set}" ]; then
156 cd "$MBEDTLS_ROOT_DIR"
157 fi
158
Gilles Peskine7c652162017-12-11 00:01:40 +0100159 command make clean
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200160
Gilles Peskine31b07e22018-03-21 12:15:06 +0100161 # Remove CMake artefacts
162 find . -name .git -prune -o -name yotta -prune -o \
163 -iname CMakeFiles -exec rm -rf {} \+ -o \
164 \( -iname cmake_install.cmake -o \
165 -iname CTestTestfile.cmake -o \
166 -iname CMakeCache.txt \) -exec rm {} \+
167 # Recover files overwritten by in-tree CMake builds
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +0000168 rm -f include/Makefile include/mbedtls/Makefile programs/*/Makefile
Paul Bakkerfe0984d2014-06-13 00:13:45 +0200169 git update-index --no-skip-worktree Makefile library/Makefile programs/Makefile tests/Makefile
170 git checkout -- Makefile library/Makefile programs/Makefile tests/Makefile
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200171
172 if [ -f "$CONFIG_BAK" ]; then
173 mv "$CONFIG_BAK" "$CONFIG_H"
174 fi
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100175}
176
Gilles Peskine7c652162017-12-11 00:01:40 +0100177# Executed on exit. May be redefined depending on command line options.
178final_report () {
179 :
180}
181
182fatal_signal () {
183 cleanup
184 final_report $1
185 trap - $1
186 kill -$1 $$
187}
188
189trap 'fatal_signal HUP' HUP
190trap 'fatal_signal INT' INT
191trap 'fatal_signal TERM' TERM
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200192
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100193msg()
194{
195 echo ""
196 echo "******************************************************************"
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +0100197 echo "* $1 "
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +0000198 printf "* "; date
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100199 echo "******************************************************************"
Gilles Peskine7c652162017-12-11 00:01:40 +0100200 current_section=$1
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100201}
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100202
Gilles Peskinebca6ab92017-12-19 18:24:31 +0100203if [ $RUN_ARMCC -ne 0 ]; then
204 armc6_build_test()
205 {
206 FLAGS="$1"
Andres AGa5cd9732016-10-17 15:23:10 +0100207
Gilles Peskinebca6ab92017-12-19 18:24:31 +0100208 msg "build: ARM Compiler 6 ($FLAGS), make"
209 ARM_TOOL_VARIANT="ult" CC="$ARMC6_CC" AR="$ARMC6_AR" CFLAGS="$FLAGS" \
210 WARNING_CFLAGS='-xc -std=c99' make lib
211 make clean
212 }
213fi
Andres AGa5cd9732016-10-17 15:23:10 +0100214
Andres AGd9eba4b2016-08-26 14:42:14 +0100215err_msg()
216{
217 echo "$1" >&2
218}
219
220check_tools()
221{
222 for TOOL in "$@"; do
223 if ! `hash "$TOOL" >/dev/null 2>&1`; then
224 err_msg "$TOOL not found!"
225 exit 1
226 fi
227 done
228}
229
SimonB2e23c822016-04-16 21:54:39 +0100230while [ $# -gt 0 ]; do
231 case "$1" in
Gilles Peskine8a244c92018-03-21 08:39:32 +0100232 --armcc) RUN_ARMCC=1;;
233 --armc5-bin-dir) shift; ARMC5_BIN_DIR="$1";;
234 --armc6-bin-dir) shift; ARMC6_BIN_DIR="$1";;
235 --force|-f) FORCE=1;;
236 --gnutls-cli) shift; GNUTLS_CLI="$1";;
237 --gnutls-legacy-cli) shift; GNUTLS_LEGACY_CLI="$1";;
238 --gnutls-legacy-serv) shift; GNUTLS_LEGACY_SERV="$1";;
239 --gnutls-serv) shift; GNUTLS_SERV="$1";;
240 --help|-h) usage; exit;;
241 --keep-going|-k) KEEP_GOING=1;;
242 --memory|-m) MEMORY=1;;
243 --no-armcc) RUN_ARMCC=0;;
Gilles Peskine38d81652018-03-21 08:40:26 +0100244 --no-force) FORCE=0;;
245 --no-keep-going) KEEP_GOING=0;;
246 --no-memory) MEMORY=0;;
Gilles Peskine8a244c92018-03-21 08:39:32 +0100247 --no-yotta) YOTTA=0;;
248 --openssl) shift; OPENSSL="$1";;
249 --openssl-legacy) shift; OPENSSL_LEGACY="$1";;
Manuel Pégourié-Gonnarda3712be2018-05-22 15:58:50 +0200250 --openssl-next) shift; OPENSSL_NEXT="$1";;
Gilles Peskine8a244c92018-03-21 08:39:32 +0100251 --out-of-source-dir) shift; OUT_OF_SOURCE_DIR="$1";;
Gilles Peskine38d81652018-03-21 08:40:26 +0100252 --random-seed) unset SEED;;
253 --release-test|-r) SEED=1;;
Gilles Peskine8a244c92018-03-21 08:39:32 +0100254 --seed|-s) shift; SEED="$1";;
255 --yotta) YOTTA=1;;
Gilles Peskine709346a2017-12-10 23:43:39 +0100256 *)
257 echo >&2 "Unknown option: $1"
258 echo >&2 "Run $0 --help for usage."
259 exit 120
SimonB2e23c822016-04-16 21:54:39 +0100260 ;;
261 esac
262 shift
263done
264
265if [ $FORCE -eq 1 ]; then
Gilles Peskineda519252017-11-30 13:22:04 +0100266 if [ $YOTTA -eq 1 ]; then
267 rm -rf yotta/module "$OUT_OF_SOURCE_DIR"
268 fi
SimonB2e23c822016-04-16 21:54:39 +0100269 git checkout-index -f -q $CONFIG_H
270 cleanup
271else
272
Gilles Peskine2a22a802017-12-21 15:19:00 +0100273 if [ $YOTTA -ne 0 ] && [ -d yotta/module ]; then
Andres AGd9eba4b2016-08-26 14:42:14 +0100274 err_msg "Warning - there is an existing yotta module in the directory 'yotta/module'"
SimonB2e23c822016-04-16 21:54:39 +0100275 echo "You can either delete your work and retry, or force the test to overwrite the"
276 echo "test by rerunning the script as: $0 --force"
277 exit 1
278 fi
279
Andres AGdc192212016-08-31 17:33:13 +0100280 if [ -d "$OUT_OF_SOURCE_DIR" ]; then
281 echo "Warning - there is an existing directory at '$OUT_OF_SOURCE_DIR'" >&2
282 echo "You can either delete this directory manually, or force the test by rerunning"
283 echo "the script as: $0 --force --out-of-source-dir $OUT_OF_SOURCE_DIR"
284 exit 1
285 fi
286
SimonB2e23c822016-04-16 21:54:39 +0100287 if ! git diff-files --quiet include/mbedtls/config.h; then
Andres AGd9eba4b2016-08-26 14:42:14 +0100288 err_msg "Warning - the configuration file 'include/mbedtls/config.h' has been edited. "
SimonB2e23c822016-04-16 21:54:39 +0100289 echo "You can either delete or preserve your work, or force the test by rerunning the"
290 echo "script as: $0 --force"
291 exit 1
292 fi
293fi
294
Gilles Peskine7c652162017-12-11 00:01:40 +0100295build_status=0
296if [ $KEEP_GOING -eq 1 ]; then
297 failure_summary=
298 failure_count=0
299 start_red=
300 end_color=
301 if [ -t 1 ]; then
Gilles Peskine9736b9d2018-01-02 21:54:17 +0100302 case "${TERM:-}" in
Gilles Peskine7c652162017-12-11 00:01:40 +0100303 *color*|cygwin|linux|rxvt*|screen|[Eex]term*)
304 start_red=$(printf '\033[31m')
305 end_color=$(printf '\033[0m')
306 ;;
307 esac
308 fi
309 record_status () {
310 if "$@"; then
311 last_status=0
312 else
313 last_status=$?
314 text="$current_section: $* -> $last_status"
315 failure_summary="$failure_summary
316$text"
317 failure_count=$((failure_count + 1))
318 echo "${start_red}^^^^$text^^^^${end_color}"
319 fi
320 }
321 make () {
322 case "$*" in
323 *test|*check)
324 if [ $build_status -eq 0 ]; then
325 record_status command make "$@"
326 else
327 echo "(skipped because the build failed)"
328 fi
329 ;;
330 *)
331 record_status command make "$@"
332 build_status=$last_status
333 ;;
334 esac
335 }
336 final_report () {
337 if [ $failure_count -gt 0 ]; then
338 echo
339 echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
340 echo "${start_red}FAILED: $failure_count${end_color}$failure_summary"
341 echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
Jaeden Amero7c1258d2018-07-20 16:42:14 +0100342 exit 1
Gilles Peskine7c652162017-12-11 00:01:40 +0100343 elif [ -z "${1-}" ]; then
344 echo "SUCCESS :)"
345 fi
346 if [ -n "${1-}" ]; then
347 echo "Killed by SIG$1."
348 fi
349 }
350else
351 record_status () {
352 "$@"
353 }
354fi
355if_build_succeeded () {
356 if [ $build_status -eq 0 ]; then
357 record_status "$@"
358 fi
359}
360
Manuel Pégourié-Gonnard2adb3752018-06-07 10:51:44 +0200361# to be used instead of ! for commands run with
362# record_status or if_build_succeeded
363not() {
364 ! "$@"
365}
366
Andres AGd9eba4b2016-08-26 14:42:14 +0100367msg "info: $0 configuration"
368echo "MEMORY: $MEMORY"
369echo "FORCE: $FORCE"
Andres AG7770ea82016-10-10 15:46:20 +0100370echo "SEED: ${SEED-"UNSET"}"
Andres AGd9eba4b2016-08-26 14:42:14 +0100371echo "OPENSSL: $OPENSSL"
372echo "OPENSSL_LEGACY: $OPENSSL_LEGACY"
Manuel Pégourié-Gonnard6b368922018-02-20 12:02:07 +0100373echo "OPENSSL_NEXT: $OPENSSL_NEXT"
Andres AGd9eba4b2016-08-26 14:42:14 +0100374echo "GNUTLS_CLI: $GNUTLS_CLI"
375echo "GNUTLS_SERV: $GNUTLS_SERV"
376echo "GNUTLS_LEGACY_CLI: $GNUTLS_LEGACY_CLI"
377echo "GNUTLS_LEGACY_SERV: $GNUTLS_LEGACY_SERV"
Andres AG87bb5772016-09-27 15:05:15 +0100378echo "ARMC5_BIN_DIR: $ARMC5_BIN_DIR"
379echo "ARMC6_BIN_DIR: $ARMC6_BIN_DIR"
380
381ARMC5_CC="$ARMC5_BIN_DIR/armcc"
382ARMC5_AR="$ARMC5_BIN_DIR/armar"
383ARMC6_CC="$ARMC6_BIN_DIR/armclang"
384ARMC6_AR="$ARMC6_BIN_DIR/armar"
Andres AGd9eba4b2016-08-26 14:42:14 +0100385
Andres AGb2fdd042016-09-22 14:17:46 +0100386# To avoid setting OpenSSL and GnuTLS for each call to compat.sh and ssl-opt.sh
387# we just export the variables they require
388export OPENSSL_CMD="$OPENSSL"
389export GNUTLS_CLI="$GNUTLS_CLI"
390export GNUTLS_SERV="$GNUTLS_SERV"
391
Andres AG7770ea82016-10-10 15:46:20 +0100392# Avoid passing --seed flag in every call to ssl-opt.sh
Gilles Peskine38d81652018-03-21 08:40:26 +0100393if [ -n "${SEED-}" ]; then
394 export SEED
395fi
Andres AG7770ea82016-10-10 15:46:20 +0100396
Andres AGd9eba4b2016-08-26 14:42:14 +0100397# Make sure the tools we need are available.
Manuel Pégourié-Gonnard6b368922018-02-20 12:02:07 +0100398check_tools "$OPENSSL" "$OPENSSL_LEGACY" "$OPENSSL_NEXT" \
399 "$GNUTLS_CLI" "$GNUTLS_SERV" \
Gilles Peskine7ad603e2017-12-10 23:22:20 +0100400 "$GNUTLS_LEGACY_CLI" "$GNUTLS_LEGACY_SERV" "doxygen" "dot" \
Andres Amaya Garciaddebc492017-10-24 22:16:34 +0100401 "arm-none-eabi-gcc" "i686-w64-mingw32-gcc" "gdb"
Gilles Peskinebca6ab92017-12-19 18:24:31 +0100402if [ $RUN_ARMCC -ne 0 ]; then
403 check_tools "$ARMC5_CC" "$ARMC5_AR" "$ARMC6_CC" "$ARMC6_AR"
404fi
Andres AGd9eba4b2016-08-26 14:42:14 +0100405
Gilles Peskine192c72f2017-12-21 15:59:21 +0100406
407
408################################################################
409#### Basic checks
410################################################################
SimonB2e23c822016-04-16 21:54:39 +0100411
412#
413# Test Suites to be executed
414#
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200415# The test ordering tries to optimize for the following criteria:
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100416# 1. Catch possible problems early, by running first tests that run quickly
Manuel Pégourié-Gonnard61bc57a2014-08-14 11:29:06 +0200417# and/or are more likely to fail than others (eg I use Clang most of the
418# time, so start with a GCC build).
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200419# 2. Minimize total running time, by avoiding useless rebuilds
420#
421# Indicative running times are given for reference.
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100422
Janos Follathb72c6782016-07-19 14:54:17 +0100423msg "info: output_env.sh"
Andres AGd9eba4b2016-08-26 14:42:14 +0100424OPENSSL="$OPENSSL" OPENSSL_LEGACY="$OPENSSL_LEGACY" GNUTLS_CLI="$GNUTLS_CLI" \
425 GNUTLS_SERV="$GNUTLS_SERV" GNUTLS_LEGACY_CLI="$GNUTLS_LEGACY_CLI" \
Andres AG87bb5772016-09-27 15:05:15 +0100426 GNUTLS_LEGACY_SERV="$GNUTLS_LEGACY_SERV" ARMC5_CC="$ARMC5_CC" \
Gilles Peskine26232962018-03-21 08:35:07 +0100427 ARMC6_CC="$ARMC6_CC" RUN_ARMCC="$RUN_ARMCC" scripts/output_env.sh
Janos Follathb72c6782016-07-19 14:54:17 +0100428
Manuel Pégourié-Gonnardea29d152014-11-20 17:32:33 +0100429msg "test: recursion.pl" # < 1s
Manuel Pégourié-Gonnardd09a6b52015-04-09 17:19:23 +0200430tests/scripts/recursion.pl library/*.c
Manuel Pégourié-Gonnardea29d152014-11-20 17:32:33 +0100431
Manuel Pégourié-Gonnardb3b8e432015-02-13 14:52:19 +0000432msg "test: freshness of generated source files" # < 1s
433tests/scripts/check-generated-files.sh
434
Manuel Pégourié-Gonnardd09a6b52015-04-09 17:19:23 +0200435msg "test: doxygen markup outside doxygen blocks" # < 1s
436tests/scripts/check-doxy-blocks.pl
437
Darryl Greena07039c2018-03-13 16:48:16 +0000438msg "test: check-files.py" # < 1s
439cleanup
440tests/scripts/check-files.py
441
Manuel Pégourié-Gonnarda687baf2015-04-09 11:09:03 +0200442msg "test/build: declared and exported names" # < 3s
443cleanup
444tests/scripts/check-names.sh
445
Andres AGd9eba4b2016-08-26 14:42:14 +0100446msg "test: doxygen warnings" # ~ 3s
447cleanup
448tests/scripts/doxygen.sh
Manuel Pégourié-Gonnard1d552e72016-01-04 16:49:09 +0100449
Gilles Peskine192c72f2017-12-21 15:59:21 +0100450
451
452################################################################
453#### Build and test many configurations and targets
454################################################################
455
Gilles Peskinebca6ab92017-12-19 18:24:31 +0100456if [ $RUN_ARMCC -ne 0 ] && [ $YOTTA -ne 0 ]; then
457 # Note - use of yotta is deprecated, and yotta also requires armcc to be on the
458 # path, and uses whatever version of armcc it finds there.
Gilles Peskineda519252017-11-30 13:22:04 +0100459 msg "build: create and build yotta module" # ~ 30s
460 cleanup
Gilles Peskine7c652162017-12-11 00:01:40 +0100461 record_status tests/scripts/yotta-build.sh
Gilles Peskineda519252017-11-30 13:22:04 +0100462fi
Manuel Pégourié-Gonnard77d56bb2015-07-28 15:00:37 +0200463
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100464msg "build: cmake, gcc, ASan" # ~ 1 min 50s
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100465cleanup
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +0100466CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100467make
468
Simon Butcher8e3afc72016-09-15 17:13:08 +0100469msg "test: main suites (inc. selftests) (ASan build)" # ~ 50s
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +0100470make test
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200471
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100472msg "test: ssl-opt.sh (ASan build)" # ~ 1 min
Gilles Peskine7c652162017-12-11 00:01:40 +0100473if_build_succeeded tests/ssl-opt.sh
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200474
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100475msg "test/build: ref-configs (ASan build)" # ~ 6 min 20s
Gilles Peskine396fac12018-03-22 22:26:03 +0100476record_status tests/scripts/test-ref-configs.pl
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200477
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200478msg "build: with ASan (rebuild after ref-configs)" # ~ 1 min
479make
480
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100481msg "test: compat.sh (ASan build)" # ~ 6 min
Gilles Peskine7c652162017-12-11 00:01:40 +0100482if_build_succeeded tests/compat.sh
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200483
Simon Butcher3ea7f522016-03-07 23:22:10 +0000484msg "build: Default + SSLv3 (ASan build)" # ~ 6 min
485cleanup
Simon Butcherf413b6f2016-03-14 22:32:42 +0000486cp "$CONFIG_H" "$CONFIG_BAK"
Simon Butcher3ea7f522016-03-07 23:22:10 +0000487scripts/config.pl set MBEDTLS_SSL_PROTO_SSL3
488CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
489make
490
Simon Butcher8e3afc72016-09-15 17:13:08 +0100491msg "test: SSLv3 - main suites (inc. selftests) (ASan build)" # ~ 50s
Simon Butcher3ea7f522016-03-07 23:22:10 +0000492make test
Simon Butcher3ea7f522016-03-07 23:22:10 +0000493
494msg "build: SSLv3 - compat.sh (ASan build)" # ~ 6 min
Gilles Peskine7c652162017-12-11 00:01:40 +0100495if_build_succeeded tests/compat.sh -m 'tls1 tls1_1 tls1_2 dtls1 dtls1_2'
496if_build_succeeded env OPENSSL_CMD="$OPENSSL_LEGACY" tests/compat.sh -m 'ssl3'
Simon Butcher3ea7f522016-03-07 23:22:10 +0000497
498msg "build: SSLv3 - ssl-opt.sh (ASan build)" # ~ 6 min
Gilles Peskine7c652162017-12-11 00:01:40 +0100499if_build_succeeded tests/ssl-opt.sh
Simon Butcher3ea7f522016-03-07 23:22:10 +0000500
Hanno Becker134c2ab2017-10-12 15:29:50 +0100501msg "build: Default + !MBEDTLS_SSL_RENEGOTIATION (ASan build)" # ~ 6 min
502cleanup
503cp "$CONFIG_H" "$CONFIG_BAK"
504scripts/config.pl unset MBEDTLS_SSL_RENEGOTIATION
505CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
506make
507
508msg "test: !MBEDTLS_SSL_RENEGOTIATION - main suites (inc. selftests) (ASan build)" # ~ 50s
509make test
510
511msg "test: !MBEDTLS_SSL_RENEGOTIATION - ssl-opt.sh (ASan build)" # ~ 6 min
Gilles Peskine7c652162017-12-11 00:01:40 +0100512if_build_succeeded tests/ssl-opt.sh
Manuel Pégourié-Gonnard246978d2014-11-20 13:29:53 +0100513
Hanno Beckerd5ba5ef2017-09-28 12:53:51 +0100514msg "build: Default + RSA_NO_CRT (ASan build)" # ~ 6 min
515cleanup
516cp "$CONFIG_H" "$CONFIG_BAK"
517scripts/config.pl set MBEDTLS_RSA_NO_CRT
518CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
519make
520
521msg "test: RSA_NO_CRT - main suites (inc. selftests) (ASan build)" # ~ 50s
522make test
523
524msg "test: RSA_NO_CRT - RSA-related part of ssl-opt.sh (ASan build)" # ~ 5s
525tests/ssl-opt.sh -f RSA
526
527msg "test: RSA_NO_CRT - RSA-related part of compat.sh (ASan build)" # ~ 3 min
528tests/compat.sh -t RSA
529
Angus Grattonc4dd0732018-04-11 16:28:39 +1000530msg "build: small SSL_OUT_CONTENT_LEN (ASan build)"
531cleanup
532cp "$CONFIG_H" "$CONFIG_BAK"
533scripts/config.pl set MBEDTLS_SSL_IN_CONTENT_LEN 16384
534scripts/config.pl set MBEDTLS_SSL_OUT_CONTENT_LEN 4096
535CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
536make
537
538msg "test: small SSL_OUT_CONTENT_LEN - ssl-opt.sh MFL and large packet tests"
539if_build_succeeded tests/ssl-opt.sh -f "Max fragment\|Large packet"
540
541msg "build: small SSL_IN_CONTENT_LEN (ASan build)"
542cleanup
543cp "$CONFIG_H" "$CONFIG_BAK"
544scripts/config.pl set MBEDTLS_SSL_IN_CONTENT_LEN 4096
545scripts/config.pl set MBEDTLS_SSL_OUT_CONTENT_LEN 16384
546CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
547make
548
549msg "test: small SSL_IN_CONTENT_LEN - ssl-opt.sh MFL tests"
550if_build_succeeded tests/ssl-opt.sh -f "Max fragment"
551
Manuel Pégourié-Gonnard602544e2017-06-20 10:49:24 +0200552msg "build: cmake, full config, clang" # ~ 50s
Manuel Pégourié-Gonnard61bc57a2014-08-14 11:29:06 +0200553cleanup
Janos Follath35d48cb2016-04-22 14:45:00 +0100554cp "$CONFIG_H" "$CONFIG_BAK"
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200555scripts/config.pl full
556scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests
Simon Butcherf95c1762016-11-10 17:25:58 +0000557CC=clang cmake -D CMAKE_BUILD_TYPE:String=Check -D ENABLE_TESTING=On .
Manuel Pégourié-Gonnard602544e2017-06-20 10:49:24 +0200558make
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100559
560msg "test: main suites (full config)" # ~ 5s
Manuel Pégourié-Gonnard602544e2017-06-20 10:49:24 +0200561make test
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200562
Jaeden Amerod9c71da2018-06-15 20:31:26 +0100563msg "test: ssl-opt.sh default, ECJPAKE, SSL async (full config)" # ~ 1s
564if_build_succeeded tests/ssl-opt.sh -f 'Default\|ECJPAKE\|SSL async private'
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200565
566msg "test: compat.sh RC4, DES & NULL (full config)" # ~ 2 min
Gilles Peskine7c652162017-12-11 00:01:40 +0100567if_build_succeeded env OPENSSL_CMD="$OPENSSL_LEGACY" GNUTLS_CLI="$GNUTLS_LEGACY_CLI" GNUTLS_SERV="$GNUTLS_LEGACY_SERV" tests/compat.sh -e '3DES\|DES-CBC3' -f 'NULL\|DES\|RC4\|ARCFOUR'
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200568
Manuel Pégourié-Gonnard6b368922018-02-20 12:02:07 +0100569msg "test: compat.sh ARIA"
570if_build_succeeded env OPENSSL_CMD="$OPENSSL_NEXT" tests/compat.sh -e '^$' -f 'ARIA'
571
Gilles Peskineb4ef45b2018-03-01 22:23:50 +0100572msg "build: make, full config + DEPRECATED_WARNING, gcc -O" # ~ 30s
573cleanup
574cp "$CONFIG_H" "$CONFIG_BAK"
575scripts/config.pl full
Gilles Peskine0afe6242018-02-21 19:28:12 +0100576scripts/config.pl set MBEDTLS_DEPRECATED_WARNING
Gilles Peskineb4ef45b2018-03-01 22:23:50 +0100577# Build with -O -Wextra to catch a maximum of issues.
578make CC=gcc CFLAGS='-O -Werror -Wall -Wextra' lib programs
579make CC=gcc CFLAGS='-O -Werror -Wall -Wextra -Wno-unused-function' tests
580
581msg "build: make, full config + DEPRECATED_REMOVED, clang -O" # ~ 30s
582# No cleanup, just tweak the configuration and rebuild
583make clean
584scripts/config.pl unset MBEDTLS_DEPRECATED_WARNING
Gilles Peskine0afe6242018-02-21 19:28:12 +0100585scripts/config.pl set MBEDTLS_DEPRECATED_REMOVED
Gilles Peskineb4ef45b2018-03-01 22:23:50 +0100586# Build with -O -Wextra to catch a maximum of issues.
587make CC=clang CFLAGS='-O -Werror -Wall -Wextra' lib programs
588make CC=clang CFLAGS='-O -Werror -Wall -Wextra -Wno-unused-function' tests
Gilles Peskine0afe6242018-02-21 19:28:12 +0100589
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200590msg "test/build: curves.pl (gcc)" # ~ 4 min
591cleanup
Gilles Peskine396fac12018-03-22 22:26:03 +0100592record_status tests/scripts/curves.pl
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200593
Manuel Pégourié-Gonnard1fe6bb92017-06-06 11:36:16 +0200594msg "test/build: depends-hashes.pl (gcc)" # ~ 2 min
595cleanup
Gilles Peskine396fac12018-03-22 22:26:03 +0100596record_status tests/scripts/depends-hashes.pl
Manuel Pégourié-Gonnard1fe6bb92017-06-06 11:36:16 +0200597
Manuel Pégourié-Gonnard43be6cd2017-06-20 09:53:42 +0200598msg "test/build: depends-pkalgs.pl (gcc)" # ~ 2 min
599cleanup
Gilles Peskine396fac12018-03-22 22:26:03 +0100600record_status tests/scripts/depends-pkalgs.pl
Manuel Pégourié-Gonnard43be6cd2017-06-20 09:53:42 +0200601
Manuel Pégourié-Gonnard503a5ef2015-10-23 09:04:45 +0200602msg "test/build: key-exchanges (gcc)" # ~ 1 min
603cleanup
Gilles Peskine396fac12018-03-22 22:26:03 +0100604record_status tests/scripts/key-exchanges.pl
Manuel Pégourié-Gonnard503a5ef2015-10-23 09:04:45 +0200605
Manuel Pégourié-Gonnard61fe8b02015-03-13 14:33:16 +0000606msg "build: Unix make, -Os (gcc)" # ~ 30s
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100607cleanup
Gilles Peskine7c652162017-12-11 00:01:40 +0100608make CC=gcc CFLAGS='-Werror -Wall -Wextra -Os'
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100609
Simon Butcherf95c1762016-11-10 17:25:58 +0000610# Full configuration build, without platform support, file IO and net sockets.
611# This should catch missing mbedtls_printf definitions, and by disabling file
612# IO, it should catch missing '#include <stdio.h>'
613msg "build: full config except platform/fsio/net, make, gcc, C99" # ~ 30s
Manuel Pégourié-Gonnarda71780e2015-02-13 13:56:55 +0000614cleanup
615cp "$CONFIG_H" "$CONFIG_BAK"
616scripts/config.pl full
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200617scripts/config.pl unset MBEDTLS_PLATFORM_C
Simon Butcherf95c1762016-11-10 17:25:58 +0000618scripts/config.pl unset MBEDTLS_NET_C
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200619scripts/config.pl unset MBEDTLS_PLATFORM_MEMORY
Manuel Pégourié-Gonnard3d4755b2015-06-03 14:03:17 +0100620scripts/config.pl unset MBEDTLS_PLATFORM_PRINTF_ALT
621scripts/config.pl unset MBEDTLS_PLATFORM_FPRINTF_ALT
622scripts/config.pl unset MBEDTLS_PLATFORM_SNPRINTF_ALT
Simon Butcherb9283432016-07-13 11:02:41 +0100623scripts/config.pl unset MBEDTLS_PLATFORM_TIME_ALT
Manuel Pégourié-Gonnard3d4755b2015-06-03 14:03:17 +0100624scripts/config.pl unset MBEDTLS_PLATFORM_EXIT_ALT
Simon Butcher284b4c92016-06-26 13:10:00 +0100625scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200626scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C
627scripts/config.pl unset MBEDTLS_FS_IO
Simon Butchercb587002017-01-06 16:14:44 +0000628# Note, _DEFAULT_SOURCE needs to be defined for platforms using glibc version >2.19,
629# to re-enable platform integration features otherwise disabled in C99 builds
Gilles Peskine7c652162017-12-11 00:01:40 +0100630make CC=gcc CFLAGS='-Werror -Wall -Wextra -std=c99 -pedantic -O0 -D_DEFAULT_SOURCE' lib programs
631make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0' test
Manuel Pégourié-Gonnarda71780e2015-02-13 13:56:55 +0000632
Manuel Pégourié-Gonnarddccb80b2015-06-03 10:20:33 +0100633# catch compile bugs in _uninit functions
634msg "build: full config with NO_STD_FUNCTION, make, gcc" # ~ 30s
635cleanup
636cp "$CONFIG_H" "$CONFIG_BAK"
637scripts/config.pl full
Manuel Pégourié-Gonnard7ee5ddd2015-06-03 10:33:55 +0100638scripts/config.pl set MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
Simon Butchereebf1b92016-06-27 01:42:39 +0100639scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED
Gilles Peskine7c652162017-12-11 00:01:40 +0100640make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0'
Manuel Pégourié-Gonnarddccb80b2015-06-03 10:20:33 +0100641
Manuel Pégourié-Gonnard66b8e952015-05-20 11:13:56 +0200642msg "build: full config except ssl_srv.c, make, gcc" # ~ 30s
643cleanup
644cp "$CONFIG_H" "$CONFIG_BAK"
645scripts/config.pl full
646scripts/config.pl unset MBEDTLS_SSL_SRV_C
Gilles Peskine7c652162017-12-11 00:01:40 +0100647make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0'
Manuel Pégourié-Gonnard66b8e952015-05-20 11:13:56 +0200648
649msg "build: full config except ssl_cli.c, make, gcc" # ~ 30s
650cleanup
651cp "$CONFIG_H" "$CONFIG_BAK"
652scripts/config.pl full
653scripts/config.pl unset MBEDTLS_SSL_CLI_C
Hanno Beckerd485c312018-01-05 13:03:53 +0000654make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0'
Manuel Pégourié-Gonnard66b8e952015-05-20 11:13:56 +0200655
Simon Butcherf95c1762016-11-10 17:25:58 +0000656# Note, C99 compliance can also be tested with the sockets support disabled,
657# as that requires a POSIX platform (which isn't the same as C99).
Andres AG788aa4a2016-09-14 14:32:09 +0100658msg "build: full config except net_sockets.c, make, gcc -std=c99 -pedantic" # ~ 30s
Manuel Pégourié-Gonnard009a2642015-05-29 10:31:13 +0200659cleanup
660cp "$CONFIG_H" "$CONFIG_BAK"
661scripts/config.pl full
Manuel Pégourié-Gonnardf78e4de2015-05-29 10:52:14 +0200662scripts/config.pl unset MBEDTLS_NET_C # getaddrinfo() undeclared, etc.
663scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY # uses syscall() on GNU/Linux
Gilles Peskine7c652162017-12-11 00:01:40 +0100664make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0 -std=c99 -pedantic' lib
Manuel Pégourié-Gonnard009a2642015-05-29 10:31:13 +0200665
Angus Grattonc4dd0732018-04-11 16:28:39 +1000666# Run max fragment length tests with MFL disabled
Hanno Becker5175ac62017-09-18 15:36:25 +0100667msg "build: default config except MFL extension (ASan build)" # ~ 30s
668cleanup
669cp "$CONFIG_H" "$CONFIG_BAK"
670scripts/config.pl unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
671CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
672make
673
674msg "test: ssl-opt.sh, MFL-related tests"
Gilles Peskine7c652162017-12-11 00:01:40 +0100675if_build_succeeded tests/ssl-opt.sh -f "Max fragment length"
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +0000676
Angus Grattonc4dd0732018-04-11 16:28:39 +1000677msg "build: no MFL extension, small SSL_OUT_CONTENT_LEN (ASan build)"
678cleanup
679cp "$CONFIG_H" "$CONFIG_BAK"
680scripts/config.pl unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
681scripts/config.pl set MBEDTLS_SSL_IN_CONTENT_LEN 16384
682scripts/config.pl set MBEDTLS_SSL_OUT_CONTENT_LEN 4096
683CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
684make
685
686msg "test: MFL tests (disabled MFL extension case) & large packet tests"
687if_build_succeeded tests/ssl-opt.sh -f "Max fragment length\|Large buffer"
688
Simon Butcherab5df402016-06-11 02:31:21 +0100689msg "build: default config with MBEDTLS_TEST_NULL_ENTROPY (ASan build)"
Janos Follath06c54002016-06-09 13:57:40 +0100690cleanup
691cp "$CONFIG_H" "$CONFIG_BAK"
Simon Butcherab5df402016-06-11 02:31:21 +0100692scripts/config.pl set MBEDTLS_TEST_NULL_ENTROPY
Janos Follath06c54002016-06-09 13:57:40 +0100693scripts/config.pl set MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
694scripts/config.pl set MBEDTLS_ENTROPY_C
695scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED
696scripts/config.pl unset MBEDTLS_ENTROPY_HARDWARE_ALT
697scripts/config.pl unset MBEDTLS_HAVEGE_C
Simon Butchereebf1b92016-06-27 01:42:39 +0100698CC=gcc cmake -D UNSAFE_BUILD=ON -D CMAKE_C_FLAGS:String="-fsanitize=address -fno-common -O3" .
Janos Follath06c54002016-06-09 13:57:40 +0100699make
700
Simon Butcher8e3afc72016-09-15 17:13:08 +0100701msg "test: MBEDTLS_TEST_NULL_ENTROPY - main suites (inc. selftests) (ASan build)"
Janos Follath06c54002016-06-09 13:57:40 +0100702make test
Janos Follath06c54002016-06-09 13:57:40 +0100703
Hanno Becker83ebf782017-07-07 12:29:15 +0100704msg "build: default config with AES_FEWER_TABLES enabled"
705cleanup
706cp "$CONFIG_H" "$CONFIG_BAK"
707scripts/config.pl set MBEDTLS_AES_FEWER_TABLES
Hanno Becker98a67862018-03-27 17:10:09 +0100708make CC=gcc CFLAGS='-Werror -Wall -Wextra'
Hanno Becker83ebf782017-07-07 12:29:15 +0100709
710msg "test: AES_FEWER_TABLES"
711make test
712
713msg "build: default config with AES_ROM_TABLES enabled"
714cleanup
715cp "$CONFIG_H" "$CONFIG_BAK"
716scripts/config.pl set MBEDTLS_AES_ROM_TABLES
Hanno Becker98a67862018-03-27 17:10:09 +0100717make CC=gcc CFLAGS='-Werror -Wall -Wextra'
Hanno Becker83ebf782017-07-07 12:29:15 +0100718
719msg "test: AES_ROM_TABLES"
720make test
721
722msg "build: default config with AES_ROM_TABLES and AES_FEWER_TABLES enabled"
723cleanup
724cp "$CONFIG_H" "$CONFIG_BAK"
725scripts/config.pl set MBEDTLS_AES_FEWER_TABLES
726scripts/config.pl set MBEDTLS_AES_ROM_TABLES
Hanno Becker98a67862018-03-27 17:10:09 +0100727make CC=gcc CFLAGS='-Werror -Wall -Wextra'
Hanno Becker83ebf782017-07-07 12:29:15 +0100728
729msg "test: AES_FEWER_TABLES + AES_ROM_TABLES"
730make test
731
Manuel Pégourié-Gonnard9b06abe2015-06-25 09:56:07 +0200732if uname -a | grep -F Linux >/dev/null; then
Gilles Peskine7ad603e2017-12-10 23:22:20 +0100733 msg "build/test: make shared" # ~ 40s
734 cleanup
735 make SHARED=1 all check
Manuel Pégourié-Gonnard9b06abe2015-06-25 09:56:07 +0200736fi
737
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +0000738if uname -a | grep -F x86_64 >/dev/null; then
Gilles Peskine7ad603e2017-12-10 23:22:20 +0100739 msg "build: i386, make, gcc" # ~ 30s
740 cleanup
Gilles Peskine7c652162017-12-11 00:01:40 +0100741 make CC=gcc CFLAGS='-Werror -Wall -Wextra -m32'
Andres Amaya Garcia84e6ce82017-05-04 11:35:51 +0100742
Andres Amaya Garciaf4fbdda2017-05-08 11:19:19 +0100743 msg "test: i386, make, gcc"
744 make test
745
746 msg "build: 64-bit ILP32, make, gcc" # ~ 30s
747 cleanup
748 make CC=gcc CFLAGS='-Werror -Wall -Wextra -mx32'
749
750 msg "test: 64-bit ILP32, make, gcc"
751 make test
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +0000752fi # x86_64
753
Gilles Peskine14c3c062018-01-29 21:25:12 +0100754msg "build: gcc, force 32-bit bignum limbs"
Andres Amaya Garcia84e6ce82017-05-04 11:35:51 +0100755cleanup
756cp "$CONFIG_H" "$CONFIG_BAK"
757scripts/config.pl unset MBEDTLS_HAVE_ASM
758scripts/config.pl unset MBEDTLS_AESNI_C
759scripts/config.pl unset MBEDTLS_PADLOCK_C
Gilles Peskine14c3c062018-01-29 21:25:12 +0100760make CC=gcc CFLAGS='-Werror -Wall -Wextra -DMBEDTLS_HAVE_INT32'
Andres Amaya Garcia84e6ce82017-05-04 11:35:51 +0100761
Gilles Peskine14c3c062018-01-29 21:25:12 +0100762msg "test: gcc, force 32-bit bignum limbs"
Andres Amaya Garcia84e6ce82017-05-04 11:35:51 +0100763make test
Andres Amaya Garciafe843a32017-07-20 13:21:34 +0100764
Gilles Peskine14c3c062018-01-29 21:25:12 +0100765msg "build: gcc, force 64-bit bignum limbs"
Andres Amaya Garciafe843a32017-07-20 13:21:34 +0100766cleanup
767cp "$CONFIG_H" "$CONFIG_BAK"
768scripts/config.pl unset MBEDTLS_HAVE_ASM
769scripts/config.pl unset MBEDTLS_AESNI_C
770scripts/config.pl unset MBEDTLS_PADLOCK_C
Gilles Peskine14c3c062018-01-29 21:25:12 +0100771make CC=gcc CFLAGS='-Werror -Wall -Wextra -DMBEDTLS_HAVE_INT64'
772
773msg "test: gcc, force 64-bit bignum limbs"
774make test
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +0000775
Manuel Pégourié-Gonnard2adb3752018-06-07 10:51:44 +0200776
777msg "build: MBEDTLS_NO_UDBL_DIVISION native" # ~ 10s
778cleanup
779cp "$CONFIG_H" "$CONFIG_BAK"
780scripts/config.pl full
781scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests
782scripts/config.pl set MBEDTLS_NO_UDBL_DIVISION
783make CFLAGS='-Werror -O1'
784
785msg "test: MBEDTLS_NO_UDBL_DIVISION native" # ~ 10s
786make test
787
788
789msg "build: MBEDTLS_NO_64BIT_MULTIPLICATION native" # ~ 10s
790cleanup
791cp "$CONFIG_H" "$CONFIG_BAK"
792scripts/config.pl full
793scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests
794scripts/config.pl set MBEDTLS_NO_64BIT_MULTIPLICATION
795make CFLAGS='-Werror -O1'
796
797msg "test: MBEDTLS_NO_64BIT_MULTIPLICATION native" # ~ 10s
798make test
799
800
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +0000801msg "build: arm-none-eabi-gcc, make" # ~ 10s
802cleanup
803cp "$CONFIG_H" "$CONFIG_BAK"
804scripts/config.pl full
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200805scripts/config.pl unset MBEDTLS_NET_C
806scripts/config.pl unset MBEDTLS_TIMING_C
807scripts/config.pl unset MBEDTLS_FS_IO
Simon Butchereebf1b92016-06-27 01:42:39 +0100808scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED
Simon Butcherbc6a4862016-03-07 17:35:59 +0000809scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +0000810# following things are not in the default config
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200811scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c
812scripts/config.pl unset MBEDTLS_THREADING_PTHREAD
813scripts/config.pl unset MBEDTLS_THREADING_C
814scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h
815scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit
Gilles Peskine7c652162017-12-11 00:01:40 +0100816make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra' lib
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +0000817
Gilles Peskineed942f82017-06-08 15:19:20 +0200818msg "build: arm-none-eabi-gcc -DMBEDTLS_NO_UDBL_DIVISION, make" # ~ 10s
819cleanup
Simon Butcher940737f2017-07-23 13:42:36 +0200820cp "$CONFIG_H" "$CONFIG_BAK"
Andres Amaya Garcia05931972017-07-20 13:27:35 +0100821scripts/config.pl full
822scripts/config.pl unset MBEDTLS_NET_C
823scripts/config.pl unset MBEDTLS_TIMING_C
824scripts/config.pl unset MBEDTLS_FS_IO
825scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED
826scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY
827# following things are not in the default config
828scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c
829scripts/config.pl unset MBEDTLS_THREADING_PTHREAD
830scripts/config.pl unset MBEDTLS_THREADING_C
831scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h
832scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit
Gilles Peskineed942f82017-06-08 15:19:20 +0200833scripts/config.pl set MBEDTLS_NO_UDBL_DIVISION
Gilles Peskine7c652162017-12-11 00:01:40 +0100834make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra' lib
Gilles Peskineed942f82017-06-08 15:19:20 +0200835echo "Checking that software 64-bit division is not required"
Manuel Pégourié-Gonnard2adb3752018-06-07 10:51:44 +0200836if_build_succeeded not grep __aeabi_uldiv library/*.o
837
838msg "build: arm-none-eabi-gcc MBEDTLS_NO_64BIT_MULTIPLICATION, make" # ~ 10s
839cleanup
840cp "$CONFIG_H" "$CONFIG_BAK"
841scripts/config.pl full
842scripts/config.pl unset MBEDTLS_NET_C
843scripts/config.pl unset MBEDTLS_TIMING_C
844scripts/config.pl unset MBEDTLS_FS_IO
845scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED
846scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY
847# following things are not in the default config
848scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c
849scripts/config.pl unset MBEDTLS_THREADING_PTHREAD
850scripts/config.pl unset MBEDTLS_THREADING_C
851scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h
852scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit
853scripts/config.pl set MBEDTLS_NO_64BIT_MULTIPLICATION
854make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -O1 -march=armv6-m -mthumb' lib
855echo "Checking that software 64-bit multiplication is not required"
856if_build_succeeded not grep __aeabi_lmul library/*.o
Gilles Peskineed942f82017-06-08 15:19:20 +0200857
Andres AG87bb5772016-09-27 15:05:15 +0100858msg "build: ARM Compiler 5, make"
Manuel Pégourié-Gonnardc5c59392015-02-10 17:38:54 +0100859cleanup
860cp "$CONFIG_H" "$CONFIG_BAK"
861scripts/config.pl full
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200862scripts/config.pl unset MBEDTLS_NET_C
863scripts/config.pl unset MBEDTLS_TIMING_C
864scripts/config.pl unset MBEDTLS_FS_IO
Simon Butcher1c719652016-06-27 19:02:12 +0100865scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200866scripts/config.pl unset MBEDTLS_HAVE_TIME
Manuel Pégourié-Gonnardbbc60db2015-06-22 14:31:50 +0200867scripts/config.pl unset MBEDTLS_HAVE_TIME_DATE
Simon Butcherbc6a4862016-03-07 17:35:59 +0000868scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY
Manuel Pégourié-Gonnardc5c59392015-02-10 17:38:54 +0100869# following things are not in the default config
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200870scripts/config.pl unset MBEDTLS_DEPRECATED_WARNING
871scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c
872scripts/config.pl unset MBEDTLS_THREADING_PTHREAD
873scripts/config.pl unset MBEDTLS_THREADING_C
874scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h
875scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit
Simon Butcher4df5eaf2016-08-24 22:58:31 +0300876scripts/config.pl unset MBEDTLS_PLATFORM_TIME_ALT # depends on MBEDTLS_HAVE_TIME
Andres AG87bb5772016-09-27 15:05:15 +0100877
Gilles Peskinebca6ab92017-12-19 18:24:31 +0100878if [ $RUN_ARMCC -ne 0 ]; then
879 make CC="$ARMC5_CC" AR="$ARMC5_AR" WARNING_CFLAGS='--strict --c99' lib
880 make clean
Andres AG87bb5772016-09-27 15:05:15 +0100881
Gilles Peskinebca6ab92017-12-19 18:24:31 +0100882 # ARM Compiler 6 - Target ARMv7-A
883 armc6_build_test "--target=arm-arm-none-eabi -march=armv7-a"
Simon Butcher940737f2017-07-23 13:42:36 +0200884
Gilles Peskinebca6ab92017-12-19 18:24:31 +0100885 # ARM Compiler 6 - Target ARMv7-M
886 armc6_build_test "--target=arm-arm-none-eabi -march=armv7-m"
Simon Butcher940737f2017-07-23 13:42:36 +0200887
Gilles Peskinebca6ab92017-12-19 18:24:31 +0100888 # ARM Compiler 6 - Target ARMv8-A - AArch32
889 armc6_build_test "--target=arm-arm-none-eabi -march=armv8.2-a"
Simon Butcher940737f2017-07-23 13:42:36 +0200890
Gilles Peskinebca6ab92017-12-19 18:24:31 +0100891 # ARM Compiler 6 - Target ARMv8-M
892 armc6_build_test "--target=arm-arm-none-eabi -march=armv8-m.main"
Simon Butcher940737f2017-07-23 13:42:36 +0200893
Gilles Peskinebca6ab92017-12-19 18:24:31 +0100894 # ARM Compiler 6 - Target ARMv8-A - AArch64
895 armc6_build_test "--target=aarch64-arm-none-eabi -march=armv8.2-a"
896fi
Manuel Pégourié-Gonnardc5c59392015-02-10 17:38:54 +0100897
Gilles Peskine2a458da2017-05-12 15:26:58 +0200898msg "build: allow SHA1 in certificates by default"
899cleanup
900cp "$CONFIG_H" "$CONFIG_BAK"
901scripts/config.pl set MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
Gilles Peskine7c652162017-12-11 00:01:40 +0100902make CFLAGS='-Werror -Wall -Wextra'
Gilles Peskine2a458da2017-05-12 15:26:58 +0200903msg "test: allow SHA1 in certificates by default"
904make test
Gilles Peskine7c652162017-12-11 00:01:40 +0100905if_build_succeeded tests/ssl-opt.sh -f SHA-1
Gilles Peskine2a458da2017-05-12 15:26:58 +0200906
Hanno Beckerd485c312018-01-05 13:03:53 +0000907msg "build: Default + MBEDTLS_RSA_NO_CRT (ASan build)" # ~ 6 min
Hanno Beckere963efa2018-01-03 10:03:43 +0000908cleanup
909cp "$CONFIG_H" "$CONFIG_BAK"
910scripts/config.pl set MBEDTLS_RSA_NO_CRT
Hanno Beckerd485c312018-01-05 13:03:53 +0000911CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
912make
Hanno Beckere963efa2018-01-03 10:03:43 +0000913
914msg "test: MBEDTLS_RSA_NO_CRT - main suites (inc. selftests) (ASan build)"
915make test
Simon Butcher002bc622016-11-17 09:27:45 +0000916
917msg "build: Windows cross build - mingw64, make (Link Library)" # ~ 30s
918cleanup
Gilles Peskine7c652162017-12-11 00:01:40 +0100919make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra' WINDOWS_BUILD=1 lib programs
Manuel Pégourié-Gonnard52fa38a2015-06-23 14:29:58 +0200920
Manuel Pégourié-Gonnarde33316c2015-08-07 13:17:23 +0200921# note Make tests only builds the tests, but doesn't run them
Gilles Peskine7c652162017-12-11 00:01:40 +0100922make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror' WINDOWS_BUILD=1 tests
923make WINDOWS_BUILD=1 clean
Manuel Pégourié-Gonnard6448bce2015-02-16 17:18:36 +0100924
925msg "build: Windows cross build - mingw64, make (DLL)" # ~ 30s
Gilles Peskine7c652162017-12-11 00:01:40 +0100926make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra' WINDOWS_BUILD=1 SHARED=1 lib programs
927make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra' WINDOWS_BUILD=1 SHARED=1 tests
928make WINDOWS_BUILD=1 clean
Manuel Pégourié-Gonnard6448bce2015-02-16 17:18:36 +0100929
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +0000930# MemSan currently only available on Linux 64 bits
931if uname -a | grep 'Linux.*x86_64' >/dev/null; then
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +0000932
Gilles Peskine7ad603e2017-12-10 23:22:20 +0100933 msg "build: MSan (clang)" # ~ 1 min 20s
934 cleanup
935 cp "$CONFIG_H" "$CONFIG_BAK"
936 scripts/config.pl unset MBEDTLS_AESNI_C # memsan doesn't grok asm
937 CC=clang cmake -D CMAKE_BUILD_TYPE:String=MemSan .
938 make
Manuel Pégourié-Gonnard4a9dc2a2014-05-09 13:46:59 +0200939
Gilles Peskine7ad603e2017-12-10 23:22:20 +0100940 msg "test: main suites (MSan)" # ~ 10s
941 make test
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +0100942
Gilles Peskine7ad603e2017-12-10 23:22:20 +0100943 msg "test: ssl-opt.sh (MSan)" # ~ 1 min
Gilles Peskine7c652162017-12-11 00:01:40 +0100944 if_build_succeeded tests/ssl-opt.sh
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +0100945
Gilles Peskine7ad603e2017-12-10 23:22:20 +0100946 # Optional part(s)
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +0100947
Gilles Peskine7ad603e2017-12-10 23:22:20 +0100948 if [ "$MEMORY" -gt 0 ]; then
949 msg "test: compat.sh (MSan)" # ~ 6 min 20s
Gilles Peskine7c652162017-12-11 00:01:40 +0100950 if_build_succeeded tests/compat.sh
Gilles Peskine7ad603e2017-12-10 23:22:20 +0100951 fi
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100952
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +0000953else # no MemSan
954
Gilles Peskine7ad603e2017-12-10 23:22:20 +0100955 msg "build: Release (clang)"
956 cleanup
957 CC=clang cmake -D CMAKE_BUILD_TYPE:String=Release .
958 make
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +0000959
Gilles Peskine7ad603e2017-12-10 23:22:20 +0100960 msg "test: main suites valgrind (Release)"
961 make memcheck
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +0000962
Gilles Peskine7ad603e2017-12-10 23:22:20 +0100963 # Optional part(s)
964 # Currently broken, programs don't seem to receive signals
965 # under valgrind on OS X
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +0000966
Gilles Peskine7ad603e2017-12-10 23:22:20 +0100967 if [ "$MEMORY" -gt 0 ]; then
968 msg "test: ssl-opt.sh --memcheck (Release)"
Gilles Peskine7c652162017-12-11 00:01:40 +0100969 if_build_succeeded tests/ssl-opt.sh --memcheck
Gilles Peskine7ad603e2017-12-10 23:22:20 +0100970 fi
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +0000971
Gilles Peskine7ad603e2017-12-10 23:22:20 +0100972 if [ "$MEMORY" -gt 1 ]; then
973 msg "test: compat.sh --memcheck (Release)"
Gilles Peskine7c652162017-12-11 00:01:40 +0100974 if_build_succeeded tests/compat.sh --memcheck
Gilles Peskine7ad603e2017-12-10 23:22:20 +0100975 fi
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +0000976
977fi # MemSan
978
Andres AGdc192212016-08-31 17:33:13 +0100979msg "build: cmake 'out-of-source' build"
980cleanup
981MBEDTLS_ROOT_DIR="$PWD"
982mkdir "$OUT_OF_SOURCE_DIR"
983cd "$OUT_OF_SOURCE_DIR"
984cmake "$MBEDTLS_ROOT_DIR"
985make
986
987msg "test: cmake 'out-of-source' build"
988make test
Gilles Peskine0114ffc2018-03-21 12:17:20 +0100989# Test an SSL option that requires an auxiliary script in test/scripts/.
990# Also ensure that there are no error messages such as
991# "No such file or directory", which would indicate that some required
992# file is missing (ssl-opt.sh tolerates the absence of some files so
993# may exit with status 0 but emit errors).
994if_build_succeeded ./tests/ssl-opt.sh -f 'Fallback SCSV: beginning of list' 2>ssl-opt.err
995if [ -s ssl-opt.err ]; then
996 cat ssl-opt.err >&2
997 record_status [ ! -s ssl-opt.err ]
998 rm ssl-opt.err
999fi
Andres AGdc192212016-08-31 17:33:13 +01001000cd "$MBEDTLS_ROOT_DIR"
1001rm -rf "$OUT_OF_SOURCE_DIR"
Gilles Peskinea71d64c2018-03-21 12:16:57 +01001002unset MBEDTLS_ROOT_DIR
Andres AGdc192212016-08-31 17:33:13 +01001003
Andres Amaya Garcia29673812017-10-25 10:35:51 +01001004for optimization_flag in -O2 -O3 -Ofast -Os; do
1005 for compiler in clang gcc; do
Andres Amaya Garcia708c5cb2018-04-24 08:33:31 -05001006 msg "test: $compiler $optimization_flag, mbedtls_platform_zeroize()"
Andres Amaya Garcia29673812017-10-25 10:35:51 +01001007 cleanup
1008 CC="$compiler" DEBUG=1 CFLAGS="$optimization_flag" make programs
1009 gdb -x tests/scripts/test_zeroize.gdb -nw -batch -nx
1010 done
1011done
Andres Amaya Garciad0d7bf62017-10-25 09:01:31 +01001012
Gilles Peskine192c72f2017-12-21 15:59:21 +01001013
1014
1015################################################################
1016#### Termination
1017################################################################
1018
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +01001019msg "Done, cleaning up"
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +01001020cleanup
1021
Gilles Peskine7c652162017-12-11 00:01:40 +01001022final_report