Mate Toth-Pal | 5495f20 | 2020-07-16 08:33:48 +0200 | [diff] [blame] | 1 | #!/bin/bash -x |
| 2 | |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 3 | # Copyright (c) 2020-2021 Arm Limited |
Mate Toth-Pal | 5495f20 | 2020-07-16 08:33:48 +0200 | [diff] [blame] | 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | set -e |
| 18 | |
| 19 | WORKING_DIRECTORY=/root/work/tfm |
| 20 | MCUBOOT_PATH=$WORKING_DIRECTORY/mcuboot |
Mate Toth-Pal | 6298067 | 2020-11-09 16:42:04 +0100 | [diff] [blame] | 21 | TFM_DIR=$WORKING_DIRECTORY/trusted-firmware-m |
Mate Toth-Pal | 5495f20 | 2020-07-16 08:33:48 +0200 | [diff] [blame] | 22 | TFM_BUILD_DIR=$TFM_DIR/build |
Mate Toth-Pal | 6298067 | 2020-11-09 16:42:04 +0100 | [diff] [blame] | 23 | |
| 24 | SKIP_SIZE=$1 |
| 25 | BUILD_TYPE=$2 |
| 26 | DAMAGE_TYPE=$3 |
| 27 | FIH_LEVEL=$4 |
Mate Toth-Pal | 5495f20 | 2020-07-16 08:33:48 +0200 | [diff] [blame] | 28 | |
Mate Toth-Pal | 6298067 | 2020-11-09 16:42:04 +0100 | [diff] [blame] | 29 | if test -z "$FIH_LEVEL"; then |
| 30 | # Use the default level |
| 31 | CMAKE_FIH_LEVEL="" |
| 32 | else |
| 33 | CMAKE_FIH_LEVEL="-DMCUBOOT_FIH_PROFILE=\"$FIH_LEVEL\"" |
| 34 | fi |
| 35 | |
Mate Toth-Pal | 5495f20 | 2020-07-16 08:33:48 +0200 | [diff] [blame] | 36 | # build TF-M with MCUBoot |
| 37 | mkdir -p $TFM_BUILD_DIR |
| 38 | cd $TFM_DIR |
| 39 | cmake -B $TFM_BUILD_DIR \ |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 40 | -DTFM_SPM_LOG_LEVEL=TFM_SPM_LOG_LEVEL_INFO \ |
Mate Toth-Pal | 6298067 | 2020-11-09 16:42:04 +0100 | [diff] [blame] | 41 | -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ |
Mate Toth-Pal | 5495f20 | 2020-07-16 08:33:48 +0200 | [diff] [blame] | 42 | -DTFM_TOOLCHAIN_FILE=toolchain_GNUARM.cmake \ |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 43 | -DTFM_PLATFORM=arm/mps2/an521 \ |
Mate Toth-Pal | 5495f20 | 2020-07-16 08:33:48 +0200 | [diff] [blame] | 44 | -DTEST_NS=ON \ |
| 45 | -DTEST_S=ON \ |
| 46 | -DTFM_PSA_API=ON \ |
| 47 | -DMCUBOOT_PATH=$MCUBOOT_PATH \ |
| 48 | -DMCUBOOT_LOG_LEVEL=INFO \ |
Mate Toth-Pal | 6298067 | 2020-11-09 16:42:04 +0100 | [diff] [blame] | 49 | $CMAKE_FIH_LEVEL \ |
Mate Toth-Pal | 5495f20 | 2020-07-16 08:33:48 +0200 | [diff] [blame] | 50 | . |
| 51 | cd $TFM_BUILD_DIR |
| 52 | make -j install |
| 53 | |
Roman Okhrimenko | 977b375 | 2022-03-31 14:40:48 +0300 | [diff] [blame] | 54 | BOOTLOADER_AXF='./install/outputs/ARM/MPS2/AN521/bl2.axf' |
Mate Toth-Pal | 5495f20 | 2020-07-16 08:33:48 +0200 | [diff] [blame] | 55 | |
Mate Toth-Pal | 6298067 | 2020-11-09 16:42:04 +0100 | [diff] [blame] | 56 | $MCUBOOT_PATH/ci/fih_test_docker/run_fi_test.sh $BOOTLOADER_AXF $SKIP_SIZE $DAMAGE_TYPE> fih_test_output.yaml |
Mate Toth-Pal | 5495f20 | 2020-07-16 08:33:48 +0200 | [diff] [blame] | 57 | |
Mate Toth-Pal | 6298067 | 2020-11-09 16:42:04 +0100 | [diff] [blame] | 58 | echo "" |
| 59 | echo "test finished with" |
| 60 | echo " - BUILD_TYPE: $BUILD_TYPE" |
| 61 | echo " - FIH_LEVEL: $FIH_LEVEL" |
| 62 | echo " - SKIP_SIZE: $SKIP_SIZE" |
| 63 | echo " - DAMAGE_TYPE: $DAMAGE_TYPE" |
| 64 | |
Raef Coles | f684738 | 2021-01-05 11:36:49 +0000 | [diff] [blame] | 65 | python3 $MCUBOOT_PATH/ci/fih_test_docker/generate_test_report.py fih_test_output.yaml |