blob: 3896444fc2b2e295628ac800a9be76fa0c00382e [file] [log] [blame]
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +01001#!/usr/bin/env python3
2
3""" lava_job_generator_configs.py:
4
5 Default configurations for lava job generator """
6
7from __future__ import print_function
8
9__copyright__ = """
10/*
Xinyu Zhang04d77472022-03-21 14:37:37 +080011 * Copyright (c) 2018-2022, Arm Limited. All rights reserved.
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +010012 *
13 * SPDX-License-Identifier: BSD-3-Clause
14 *
15 */
16 """
Karl Zhang08681e62020-10-30 13:56:03 +080017
18__author__ = "tf-m@lists.trustedfirmware.org"
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +010019__project__ = "Trusted Firmware-M Open CI"
Xinyu Zhang06286a92021-07-22 14:00:51 +080020__version__ = "1.4.0"
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +010021
Xinyu Zhang22a12752022-10-10 17:21:21 +080022
23import os
24
25
Leonardo Sandoval66386a22021-04-15 14:35:08 -050026tf_downloads="https://downloads.trustedfirmware.org"
27coverage_trace_plugin=tf_downloads + "/coverage-plugin/qa-tools/coverage-tool/coverage-plugin/coverage_trace.so"
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +010028
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +010029
Xinyu Zhang22a12752022-10-10 17:21:21 +080030# LAVA test-monitor definition for configs without regression tests.
Xinyu Zhangf724cd22022-03-21 15:46:26 +080031# "Non-Secure system starting..." is expected to indicate
32# that TF-M has been booted successfully.
Xinyu Zhang22a12752022-10-10 17:21:21 +080033monitors_no_reg_tests = {
34 'name': 'NS_SYSTEM_BOOTING',
35 'start': 'Non-Secure system',
36 'end': r'starting\\.{3}',
37 'pattern': r'Non-Secure system starting\\.{3}',
38 'fixup': {"pass": "!", "fail": ""},
39}
Xinyu Zhangf724cd22022-03-21 15:46:26 +080040
Xinyu Zhang22a12752022-10-10 17:21:21 +080041# LAVA test-monitor definitions for configs with tests.
Paul Sokolovsky65671e62022-03-23 21:09:12 +030042# Results of each test case is parsed separately, capturing test case id.
43# Works across any test suites enabled.
Xinyu Zhang22a12752022-10-10 17:21:21 +080044monitors_mcuboot_tests = {
45 'name': 'mcuboot_suite',
46 'start': 'Execute test suites for the MCUBOOT area',
47 'end': 'End of MCUBOOT test suites',
48 'pattern': r"TEST: (?P<test_case_id>.+?) - (?P<result>(PASSED|FAILED|SKIPPED))",
49 'fixup': {"pass": "PASSED", "fail": "FAILED", "skip": "SKIPPED"},
50}
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +010051
Xinyu Zhang22a12752022-10-10 17:21:21 +080052monitors_s_reg_tests = {
53 'name': 'secure_regression_suite',
54 'start': 'Execute test suites for the Secure area',
55 'end': 'End of Secure test suites',
56 'pattern': r"TEST: (?P<test_case_id>.+?) - (?P<result>(PASSED|FAILED|SKIPPED))",
57 'fixup': {"pass": "PASSED", "fail": "FAILED", "skip": "SKIPPED"},
58}
Paul Sokolovsky6024d012022-01-22 20:21:07 +030059
Xinyu Zhang22a12752022-10-10 17:21:21 +080060monitors_ns_reg_tests = {
61 'name': 'non_secure_regression_suite',
62 'start': 'Execute test suites for the Non-secure area',
63 'end': 'End of Non-secure test suites',
64 'pattern': r"TEST: (?P<test_case_id>.+?) - (?P<result>(PASSED|FAILED|SKIPPED))",
65 'fixup': {"pass": "PASSED", "fail": "FAILED", "skip": "SKIPPED"},
66}
Paul Sokolovsky6024d012022-01-22 20:21:07 +030067
Xinyu Zhang22a12752022-10-10 17:21:21 +080068monitors_arch_tests = {
69 'name': 'psa_api_suite',
70 'start': 'Running..',
71 'end': 'Entering standby..',
72 'pattern': r" DESCRIPTION: +(?P<test_case_id>.+?)\r?\n"
73 r".+?"
74 r"TEST RESULT: (?P<result>(PASSED|FAILED|SKIPPED|SIM ERROR))",
75 'fixup': {"pass": "PASSED", "fail": "FAILED", "skip": "SKIPPED", "sim_error": "SIM ERROR"},
76}
Paul Sokolovskye3d2bb12022-06-06 17:04:34 +030077
Paul Sokolovsky6024d012022-01-22 20:21:07 +030078
Xinyu Zhang22a12752022-10-10 17:21:21 +080079# MPS2 with BL2 bootloader for AN521
Fathi Boudracaa90bd2020-12-04 22:00:14 +010080# IMAGE0ADDRESS: 0x10000000
81# IMAGE0FILE: \Software\bl2.bin ; BL2 bootloader
82# IMAGE1ADDRESS: 0x10080000
83# IMAGE1FILE: \Software\tfm_s_ns_signed.bin ; TF-M example application binary blob
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +010084tfm_mps2_sse_200 = {
Matthew Hart2c2688f2020-05-26 13:09:20 +010085 "templ": "mps2.jinja2",
86 "job_name": "mps2_an521_bl2",
Minos Galanakisafb43152019-09-25 14:17:39 +010087 "device_type": "mps",
Matthew Hart2c2688f2020-05-26 13:09:20 +010088 "job_timeout": 15,
89 "action_timeout": 10,
Xinyu Zhangd8703f02021-05-18 20:30:07 +080090 "monitor_timeout": 15,
Matthew Hart2c2688f2020-05-26 13:09:20 +010091 "poweroff_timeout": 1,
92 "recovery_store_url": "https://ci.trustedfirmware.org/userContent/",
Xinyu Zhang22a12752022-10-10 17:21:21 +080093 "platforms": {"arm/mps2/an521": "mps2_sse200_an512_new.tar.gz"},
Xinyu Zhang28d61b42022-03-21 16:46:35 +080094 "binaries": {
95 "firmware": "tfm_s_ns_signed.bin",
96 "bootloader": "bl2.bin"
97 },
Xinyu Zhang22a12752022-10-10 17:21:21 +080098 "monitors": {
99 'no_reg_tests': [monitors_no_reg_tests],
Jianliang Shen9798e552022-11-21 12:55:42 +0800100 # FPU test on FPGA not supported yet
Jianliang Shene09f8b92023-03-20 14:07:41 +0800101 'reg_tests': ([monitors_s_reg_tests, monitors_ns_reg_tests] if 'FPON' not in os.getenv("EXTRA_PARAMS") else []) + ([monitors_mcuboot_tests] if os.getenv("BL2") == "Ture" else []),
Xinyu Zhang22a12752022-10-10 17:21:21 +0800102 'arch_tests': [monitors_arch_tests] if os.getenv("TEST_PSA_API") != "IPC" else [], # FF test on FPGA not supported in LAVA yet
103 }
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100104}
105
Xinyu Zhang22a12752022-10-10 17:21:21 +0800106# FVP with BL2 bootloader for AN552
Bence Balogh4fe9b882022-03-30 15:23:47 +0200107# firmware <-> ns <-> application: --application cpu0=bl2.axf
108# bootloader <-> s <-> data: --data cpu0=tfm_s_ns_signed.bin@0x01000000
109fvp_mps3_an552_bl2 = {
110 "templ": "fvp_mps3.jinja2",
111 "job_name": "fvp_mps3_an552_bl2",
112 "device_type": "fvp",
113 "job_timeout": 15,
114 "action_timeout": 10,
115 "monitor_timeout": 15,
116 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800117 "platforms": {"arm/mps3/an552": ""},
Bence Balogh4fe9b882022-03-30 15:23:47 +0200118 "data_bin_offset": "0x01000000",
119 "binaries": {
120 "application": "bl2.axf",
121 "data": "tfm_s_ns_signed.bin"
122 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800123 "monitors": {
124 'no_reg_tests': [monitors_no_reg_tests],
Jianliang Shene09f8b92023-03-20 14:07:41 +0800125 'reg_tests': [monitors_s_reg_tests, monitors_ns_reg_tests] + ([monitors_mcuboot_tests] if os.getenv("BL2") == "Ture" else []),
Xinyu Zhang22a12752022-10-10 17:21:21 +0800126 }
Bence Balogh4fe9b882022-03-30 15:23:47 +0200127}
Dean Bircha6ede7e2020-03-13 14:00:33 +0000128
Satish Kumar1cfdd912022-08-01 09:24:07 +0100129
Xinyu Zhang22a12752022-10-10 17:21:21 +0800130# FVP with BL2 bootloader for AN521
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800131# application: --application cpu0=bl2.axf
132# data: --data cpu0=tfm_s_ns_signed.bin@0x10080000
Matthew Hart2c2688f2020-05-26 13:09:20 +0100133fvp_mps2_an521_bl2 = {
134 "templ": "fvp_mps2.jinja2",
135 "job_name": "fvp_mps2_an521_bl2",
Dean Bircha6ede7e2020-03-13 14:00:33 +0000136 "device_type": "fvp",
Matthew Hart2c2688f2020-05-26 13:09:20 +0100137 "job_timeout": 15,
138 "action_timeout": 10,
Xinyu Zhangd8703f02021-05-18 20:30:07 +0800139 "monitor_timeout": 15,
Matthew Hartfb6fd362020-03-04 21:03:59 +0000140 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800141 "platforms": {"arm/mps2/an521": ""},
Matthew Hartfb6fd362020-03-04 21:03:59 +0000142 "data_bin_offset": "0x10080000",
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800143 "binaries": {
144 "application": "bl2.axf",
145 "data": "tfm_s_ns_signed.bin"
146 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800147 "monitors": {
148 'no_reg_tests': [monitors_no_reg_tests],
Jianliang Shene09f8b92023-03-20 14:07:41 +0800149 'reg_tests': [monitors_s_reg_tests, monitors_ns_reg_tests] + ([monitors_mcuboot_tests] if os.getenv("BL2") == "Ture" else []),
Xinyu Zhang22a12752022-10-10 17:21:21 +0800150 'arch_tests': [monitors_arch_tests],
151 }
Matthew Hartfb6fd362020-03-04 21:03:59 +0000152}
153
154
Xinyu Zhang22a12752022-10-10 17:21:21 +0800155# FVP with BL2 bootloader for AN519
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800156# application: --application cpu0=bl2.axf
157# data: --data cpu0=tfm_s_ns_signed.bin@0x10080000
Matthew Hart2c2688f2020-05-26 13:09:20 +0100158fvp_mps2_an519_bl2 = {
159 "templ": "fvp_mps2.jinja2",
160 "job_name": "fvp_mps2_an519_bl2",
161 "device_type": "fvp",
162 "job_timeout": 15,
163 "action_timeout": 10,
Xinyu Zhangd8703f02021-05-18 20:30:07 +0800164 "monitor_timeout": 15,
Matthew Hart2c2688f2020-05-26 13:09:20 +0100165 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800166 "platforms": {"arm/mps2/an519": ""},
Matthew Hart2c2688f2020-05-26 13:09:20 +0100167 "data_bin_offset": "0x10080000",
168 "cpu0_baseline": 1,
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800169 "binaries": {
170 "application": "bl2.axf",
171 "data": "tfm_s_ns_signed.bin"
172 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800173 "monitors": {
174 'no_reg_tests': [monitors_no_reg_tests],
Jianliang Shene09f8b92023-03-20 14:07:41 +0800175 'reg_tests': [monitors_s_reg_tests, monitors_ns_reg_tests] + ([monitors_mcuboot_tests] if os.getenv("BL2") == "Ture" else []),
Xinyu Zhang22a12752022-10-10 17:21:21 +0800176 }
Matthew Hart2c2688f2020-05-26 13:09:20 +0100177}
178
179
Xinyu Zhang22a12752022-10-10 17:21:21 +0800180# QEMU for AN521 with BL2 bootloader
Fathi Boudracaa90bd2020-12-04 22:00:14 +0100181qemu_mps2_bl2 = {
182 "templ": "qemu_mps2_bl2.jinja2",
183 "job_name": "qemu_mps2_bl2",
184 "device_type": "qemu",
Xinyu Zhang5dcb0d52022-10-24 14:10:19 +0800185 "job_timeout": 30,
186 "action_timeout": 20,
187 "monitor_timeout": 20,
Xinyu Zhangaad0e642022-08-09 14:28:58 +0800188 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800189 "platforms": {"arm/mps2/an521": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800190 "binaries": {
191 "firmware": "tfm_s_ns_signed.bin",
192 "bootloader": "bl2.bin"
193 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800194 "monitors": {
Jianliang Shen9798e552022-11-21 12:55:42 +0800195 # FPU test on AN521 qemu not supported yet
Jianliang Shene09f8b92023-03-20 14:07:41 +0800196 'reg_tests': ([monitors_s_reg_tests, monitors_ns_reg_tests] if 'FPON' not in os.getenv("EXTRA_PARAMS") else []) + ([monitors_mcuboot_tests] if os.getenv("BL2") == "Ture" else []),
Xinyu Zhange89f45c2021-09-14 21:11:59 +0800197 }
Fathi Boudracaa90bd2020-12-04 22:00:14 +0100198}
199
200
201# Musca-B1 with BL2 bootloader
202# unified hex file comprising of both bl2.bin and tfm_s_ns_signed.bin
203# srec_cat bin/bl2.bin -Binary -offset 0xA000000 bin/tfm_s_ns_signed.bin -Binary -offset 0xA020000 -o tfm.hex -Intel
Fathi Boudra31225f72020-11-25 13:51:07 +0100204musca_b1_bl2 = {
205 "templ": "musca_b1.jinja2",
206 "job_name": "musca_b1_bl2",
207 "device_type": "musca-b",
Xinyu Zhang630dfe62021-06-17 14:38:11 +0800208 "job_timeout": 40,
209 "action_timeout": 20,
210 "monitor_timeout": 30,
Ryan Harkinf6981082020-12-18 14:54:33 +0000211 "poweroff_timeout": 40,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800212 "platforms": {"arm/musca_b1": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800213 "binaries": {
214 "firmware": "tfm.hex",
215 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800216 "monitors": {
217 'no_reg_tests': [monitors_no_reg_tests],
Jianliang Shene09f8b92023-03-20 14:07:41 +0800218 'reg_tests': [monitors_s_reg_tests, monitors_ns_reg_tests] + ([monitors_mcuboot_tests] if os.getenv("BL2") == "Ture" else []),
Xinyu Zhang22a12752022-10-10 17:21:21 +0800219 }
Fathi Boudra31225f72020-11-25 13:51:07 +0100220}
221
Arthur She07c91b52021-07-15 15:03:10 -0700222# STM32L562E-DK
223stm32l562e_dk = {
224 "templ": "stm32l562e_dk.jinja2",
225 "job_name": "stm32l562e_dk",
226 "device_type": "stm32l562e-dk",
227 "job_timeout": 24,
228 "action_timeout": 15,
229 "monitor_timeout": 15,
230 "poweroff_timeout": 5,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800231 "platforms": {"stm/stm32l562e_dk": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800232 "binaries": {
233 "tarball": "stm32l562e-dk-tfm.tar.bz2",
234 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800235 "monitors": {
Jianliang Shene09f8b92023-03-20 14:07:41 +0800236 'reg_tests': [monitors_s_reg_tests, monitors_ns_reg_tests] + ([monitors_mcuboot_tests] if os.getenv("BL2") == "Ture" else []),
Xinyu Zhang22a12752022-10-10 17:21:21 +0800237 }
Arthur She07c91b52021-07-15 15:03:10 -0700238}
Xinyu Zhang97114342021-01-21 14:08:03 +0800239
Arthur She3c0dadd2021-11-18 21:17:48 -0800240# LPCxpresso55S69
241lpcxpresso55s69 = {
242 "templ": "lpcxpresso55s69.jinja2",
243 "job_name": "lpcxpresso55s69",
244 "device_type": "lpcxpresso55s69",
245 "job_timeout": 24,
246 "action_timeout": 15,
247 "monitor_timeout": 15,
248 "poweroff_timeout": 5,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800249 "platforms": {"nxp/lpcxpresso55s69": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800250 "binaries": {
251 "tarball": "lpcxpresso55s69-tfm.tar.bz2",
252 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800253 "monitors": {
254 'no_reg_tests': [monitors_no_reg_tests],
255 'reg_tests': [monitors_s_reg_tests, monitors_ns_reg_tests],
Arthur She3c0dadd2021-11-18 21:17:48 -0800256 }
257}
258
Arthur She87602dc2022-02-06 14:42:18 -0800259# Cypress PSoC64
260psoc64 = {
261 "templ": "psoc64.jinja2",
262 "job_name": "psoc64",
263 "device_type": "cy8ckit-064s0s2-4343w",
Xinyu Zhange8bb1b12022-10-18 17:42:30 +0800264 "job_timeout": 30,
265 "action_timeout": 20,
266 "monitor_timeout": 20,
Arthur She87602dc2022-02-06 14:42:18 -0800267 "poweroff_timeout": 5,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800268 "platforms": {"cypress/psoc64": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800269 "binaries": {
270 "spe": "tfm_s_signed.hex",
271 "nspe": "tfm_ns_signed.hex",
272 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800273 "monitors": {
274 'reg_tests': [monitors_s_reg_tests, monitors_ns_reg_tests],
275 }
Arthur She87602dc2022-02-06 14:42:18 -0800276}
277
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100278# All configurations should be mapped here
Fathi Boudra31225f72020-11-25 13:51:07 +0100279lava_gen_config_map = {
280 "mps2_an521_bl2": tfm_mps2_sse_200,
Bence Balogh4fe9b882022-03-30 15:23:47 +0200281 "fvp_mps3_an552_bl2": fvp_mps3_an552_bl2,
Fathi Boudra31225f72020-11-25 13:51:07 +0100282 "fvp_mps2_an521_bl2": fvp_mps2_an521_bl2,
Fathi Boudra31225f72020-11-25 13:51:07 +0100283 "fvp_mps2_an519_bl2": fvp_mps2_an519_bl2,
Fathi Boudracaa90bd2020-12-04 22:00:14 +0100284 "qemu_mps2_bl2": qemu_mps2_bl2,
Fathi Boudra31225f72020-11-25 13:51:07 +0100285 "musca_b1": musca_b1_bl2,
Arthur She07c91b52021-07-15 15:03:10 -0700286 "stm32l562e_dk": stm32l562e_dk,
Arthur She54b10a52023-04-11 22:30:11 -0700287 "lpcxpresso55s69": lpcxpresso55s69,
Arthur She87602dc2022-02-06 14:42:18 -0800288 "psoc64": psoc64,
Fathi Boudra31225f72020-11-25 13:51:07 +0100289}
Matthew Hart2c2688f2020-05-26 13:09:20 +0100290
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100291lavagen_config_sort_order = [
292 "templ",
293 "job_name",
294 "device_type",
295 "job_timeout",
296 "action_timeout",
297 "monitor_timeout",
298 "recovery_store_url",
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100299 "platforms",
Xinyu Zhang22a12752022-10-10 17:21:21 +0800300 "monitors"
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100301]
302
303lava_gen_monitor_sort_order = [
304 'name',
305 'start',
306 'end',
307 'pattern',
308 'fixup',
309]