blob: 795075c5051388ff117770f0f56cbb14599767a2 [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 Zhang32355382023-04-25 17:49:06 +080033no_reg_tests_monitors_cfg = {
Xinyu Zhang22a12752022-10-10 17:21:21 +080034 '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 Zhang32355382023-04-25 17:49:06 +080044mcuboot_tests_monitor_cfg = {
Xinyu Zhang22a12752022-10-10 17:21:21 +080045 '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 Zhang32355382023-04-25 17:49:06 +080052s_reg_tests_monitors_cfg = {
Xinyu Zhang22a12752022-10-10 17:21:21 +080053 '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 Zhang32355382023-04-25 17:49:06 +080060ns_reg_tests_monitors_cfg = {
Xinyu Zhang22a12752022-10-10 17:21:21 +080061 '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 Zhang32355382023-04-25 17:49:06 +080068arch_tests_monitors_cfg = {
Xinyu Zhang22a12752022-10-10 17:21:21 +080069 '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
Xinyu Zhang32355382023-04-25 17:49:06 +080078# Group related monitors into same list to simplify the code
79no_reg_tests_monitors = [no_reg_tests_monitors_cfg]
80
81reg_tests_monitors = [] + \
82 ([mcuboot_tests_monitor_cfg] if "RegBL2" in os.getenv("TEST_REGRESSION") and os.getenv("BL2") == "True" else []) + \
83 ([s_reg_tests_monitors_cfg] if "RegS" in os.getenv("TEST_REGRESSION") else []) + \
84 ([ns_reg_tests_monitors_cfg] if "RegNS" in os.getenv("TEST_REGRESSION") else [])
85
86arch_tests_monitors = [arch_tests_monitors_cfg]
87
Paul Sokolovsky6024d012022-01-22 20:21:07 +030088
Xinyu Zhang22a12752022-10-10 17:21:21 +080089# MPS2 with BL2 bootloader for AN521
Fathi Boudracaa90bd2020-12-04 22:00:14 +010090# IMAGE0ADDRESS: 0x10000000
91# IMAGE0FILE: \Software\bl2.bin ; BL2 bootloader
92# IMAGE1ADDRESS: 0x10080000
93# IMAGE1FILE: \Software\tfm_s_ns_signed.bin ; TF-M example application binary blob
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +010094tfm_mps2_sse_200 = {
Matthew Hart2c2688f2020-05-26 13:09:20 +010095 "templ": "mps2.jinja2",
96 "job_name": "mps2_an521_bl2",
Minos Galanakisafb43152019-09-25 14:17:39 +010097 "device_type": "mps",
Matthew Hart2c2688f2020-05-26 13:09:20 +010098 "job_timeout": 15,
99 "action_timeout": 10,
Xinyu Zhangd8703f02021-05-18 20:30:07 +0800100 "monitor_timeout": 15,
Matthew Hart2c2688f2020-05-26 13:09:20 +0100101 "poweroff_timeout": 1,
102 "recovery_store_url": "https://ci.trustedfirmware.org/userContent/",
Xinyu Zhang22a12752022-10-10 17:21:21 +0800103 "platforms": {"arm/mps2/an521": "mps2_sse200_an512_new.tar.gz"},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800104 "binaries": {
105 "firmware": "tfm_s_ns_signed.bin",
106 "bootloader": "bl2.bin"
107 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800108 "monitors": {
Xinyu Zhang32355382023-04-25 17:49:06 +0800109 'no_reg_tests': no_reg_tests_monitors,
Jianliang Shen9798e552022-11-21 12:55:42 +0800110 # FPU test on FPGA not supported yet
Xinyu Zhang32355382023-04-25 17:49:06 +0800111 'reg_tests': (reg_tests_monitors if 'FPON' not in os.getenv("EXTRA_PARAMS") else [mcuboot_tests_monitor_cfg]),
112 # FF test on FPGA not supported in LAVA yet
113 'arch_tests': (arch_tests_monitors if os.getenv("TEST_PSA_API") != "IPC" else []),
Xinyu Zhang22a12752022-10-10 17:21:21 +0800114 }
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100115}
116
Xinyu Zhang22a12752022-10-10 17:21:21 +0800117# FVP with BL2 bootloader for AN552
Bence Balogh4fe9b882022-03-30 15:23:47 +0200118# firmware <-> ns <-> application: --application cpu0=bl2.axf
119# bootloader <-> s <-> data: --data cpu0=tfm_s_ns_signed.bin@0x01000000
120fvp_mps3_an552_bl2 = {
121 "templ": "fvp_mps3.jinja2",
122 "job_name": "fvp_mps3_an552_bl2",
123 "device_type": "fvp",
124 "job_timeout": 15,
125 "action_timeout": 10,
126 "monitor_timeout": 15,
127 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800128 "platforms": {"arm/mps3/an552": ""},
Bence Balogh4fe9b882022-03-30 15:23:47 +0200129 "data_bin_offset": "0x01000000",
130 "binaries": {
131 "application": "bl2.axf",
132 "data": "tfm_s_ns_signed.bin"
133 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800134 "monitors": {
Xinyu Zhang32355382023-04-25 17:49:06 +0800135 'no_reg_tests': no_reg_tests_monitors,
136 'reg_tests': reg_tests_monitors,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800137 }
Bence Balogh4fe9b882022-03-30 15:23:47 +0200138}
Dean Bircha6ede7e2020-03-13 14:00:33 +0000139
Satish Kumar1cfdd912022-08-01 09:24:07 +0100140
Xinyu Zhang22a12752022-10-10 17:21:21 +0800141# FVP with BL2 bootloader for AN521
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800142# application: --application cpu0=bl2.axf
143# data: --data cpu0=tfm_s_ns_signed.bin@0x10080000
Matthew Hart2c2688f2020-05-26 13:09:20 +0100144fvp_mps2_an521_bl2 = {
145 "templ": "fvp_mps2.jinja2",
146 "job_name": "fvp_mps2_an521_bl2",
Dean Bircha6ede7e2020-03-13 14:00:33 +0000147 "device_type": "fvp",
Matthew Hart2c2688f2020-05-26 13:09:20 +0100148 "job_timeout": 15,
149 "action_timeout": 10,
Xinyu Zhangd8703f02021-05-18 20:30:07 +0800150 "monitor_timeout": 15,
Matthew Hartfb6fd362020-03-04 21:03:59 +0000151 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800152 "platforms": {"arm/mps2/an521": ""},
Matthew Hartfb6fd362020-03-04 21:03:59 +0000153 "data_bin_offset": "0x10080000",
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800154 "binaries": {
155 "application": "bl2.axf",
156 "data": "tfm_s_ns_signed.bin"
157 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800158 "monitors": {
Xinyu Zhang32355382023-04-25 17:49:06 +0800159 'no_reg_tests': no_reg_tests_monitors,
160 'reg_tests': reg_tests_monitors,
161 'arch_tests': arch_tests_monitors,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800162 }
Matthew Hartfb6fd362020-03-04 21:03:59 +0000163}
164
165
Xinyu Zhang22a12752022-10-10 17:21:21 +0800166# FVP with BL2 bootloader for AN519
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800167# application: --application cpu0=bl2.axf
168# data: --data cpu0=tfm_s_ns_signed.bin@0x10080000
Matthew Hart2c2688f2020-05-26 13:09:20 +0100169fvp_mps2_an519_bl2 = {
170 "templ": "fvp_mps2.jinja2",
171 "job_name": "fvp_mps2_an519_bl2",
172 "device_type": "fvp",
173 "job_timeout": 15,
174 "action_timeout": 10,
Xinyu Zhangd8703f02021-05-18 20:30:07 +0800175 "monitor_timeout": 15,
Matthew Hart2c2688f2020-05-26 13:09:20 +0100176 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800177 "platforms": {"arm/mps2/an519": ""},
Matthew Hart2c2688f2020-05-26 13:09:20 +0100178 "data_bin_offset": "0x10080000",
179 "cpu0_baseline": 1,
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800180 "binaries": {
181 "application": "bl2.axf",
182 "data": "tfm_s_ns_signed.bin"
183 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800184 "monitors": {
Xinyu Zhang32355382023-04-25 17:49:06 +0800185 'no_reg_tests': no_reg_tests_monitors,
186 'reg_tests': reg_tests_monitors,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800187 }
Matthew Hart2c2688f2020-05-26 13:09:20 +0100188}
189
190
Xinyu Zhang22a12752022-10-10 17:21:21 +0800191# QEMU for AN521 with BL2 bootloader
Fathi Boudracaa90bd2020-12-04 22:00:14 +0100192qemu_mps2_bl2 = {
193 "templ": "qemu_mps2_bl2.jinja2",
194 "job_name": "qemu_mps2_bl2",
195 "device_type": "qemu",
Xinyu Zhang5dcb0d52022-10-24 14:10:19 +0800196 "job_timeout": 30,
197 "action_timeout": 20,
198 "monitor_timeout": 20,
Xinyu Zhangaad0e642022-08-09 14:28:58 +0800199 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800200 "platforms": {"arm/mps2/an521": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800201 "binaries": {
202 "firmware": "tfm_s_ns_signed.bin",
203 "bootloader": "bl2.bin"
204 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800205 "monitors": {
Jianliang Shen9798e552022-11-21 12:55:42 +0800206 # FPU test on AN521 qemu not supported yet
Xinyu Zhang32355382023-04-25 17:49:06 +0800207 'reg_tests': (reg_tests_monitors if 'FPON' not in os.getenv("EXTRA_PARAMS") else [mcuboot_tests_monitor_cfg]),
Xinyu Zhange89f45c2021-09-14 21:11:59 +0800208 }
Fathi Boudracaa90bd2020-12-04 22:00:14 +0100209}
210
211
212# Musca-B1 with BL2 bootloader
213# unified hex file comprising of both bl2.bin and tfm_s_ns_signed.bin
214# 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 +0100215musca_b1_bl2 = {
216 "templ": "musca_b1.jinja2",
217 "job_name": "musca_b1_bl2",
218 "device_type": "musca-b",
Xinyu Zhang630dfe62021-06-17 14:38:11 +0800219 "job_timeout": 40,
220 "action_timeout": 20,
221 "monitor_timeout": 30,
Ryan Harkinf6981082020-12-18 14:54:33 +0000222 "poweroff_timeout": 40,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800223 "platforms": {"arm/musca_b1": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800224 "binaries": {
225 "firmware": "tfm.hex",
226 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800227 "monitors": {
Xinyu Zhang32355382023-04-25 17:49:06 +0800228 'no_reg_tests': no_reg_tests_monitors,
229 'reg_tests': reg_tests_monitors,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800230 }
Fathi Boudra31225f72020-11-25 13:51:07 +0100231}
232
Arthur She07c91b52021-07-15 15:03:10 -0700233# STM32L562E-DK
234stm32l562e_dk = {
235 "templ": "stm32l562e_dk.jinja2",
236 "job_name": "stm32l562e_dk",
237 "device_type": "stm32l562e-dk",
238 "job_timeout": 24,
239 "action_timeout": 15,
240 "monitor_timeout": 15,
241 "poweroff_timeout": 5,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800242 "platforms": {"stm/stm32l562e_dk": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800243 "binaries": {
244 "tarball": "stm32l562e-dk-tfm.tar.bz2",
245 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800246 "monitors": {
Xinyu Zhang32355382023-04-25 17:49:06 +0800247 'reg_tests': reg_tests_monitors,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800248 }
Arthur She07c91b52021-07-15 15:03:10 -0700249}
Xinyu Zhang97114342021-01-21 14:08:03 +0800250
Arthur She96c6f772023-05-09 21:32:50 -0700251# STM32U5 B-U585I-IOT02A
252b_u585i_iot02a = {
253 "templ": "b_u585i_iot02a.jinja2",
254 "job_name": "b_u585i_iot02a",
255 "device_type": "b-u585i-iot02a",
256 "job_timeout": 5,
257 "action_timeout": 3,
258 "monitor_timeout": 3,
259 "poweroff_timeout": 2,
260 "platforms": {"stm/b_u585i_iot02a": ""},
261 "binaries": {
262 "tarball": "b_u585i_iot02a-tfm.tar.bz2",
263 },
264 "monitors": {
265 'reg_tests': reg_tests_monitors,
266 }
267}
268
Arthur She3c0dadd2021-11-18 21:17:48 -0800269# LPCxpresso55S69
270lpcxpresso55s69 = {
271 "templ": "lpcxpresso55s69.jinja2",
272 "job_name": "lpcxpresso55s69",
273 "device_type": "lpcxpresso55s69",
274 "job_timeout": 24,
275 "action_timeout": 15,
276 "monitor_timeout": 15,
277 "poweroff_timeout": 5,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800278 "platforms": {"nxp/lpcxpresso55s69": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800279 "binaries": {
280 "tarball": "lpcxpresso55s69-tfm.tar.bz2",
281 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800282 "monitors": {
Xinyu Zhang32355382023-04-25 17:49:06 +0800283 'no_reg_tests': no_reg_tests_monitors,
284 'reg_tests': reg_tests_monitors,
Arthur She3c0dadd2021-11-18 21:17:48 -0800285 }
286}
287
Arthur She87602dc2022-02-06 14:42:18 -0800288# Cypress PSoC64
289psoc64 = {
290 "templ": "psoc64.jinja2",
291 "job_name": "psoc64",
292 "device_type": "cy8ckit-064s0s2-4343w",
Xinyu Zhange8bb1b12022-10-18 17:42:30 +0800293 "job_timeout": 30,
294 "action_timeout": 20,
295 "monitor_timeout": 20,
Arthur She87602dc2022-02-06 14:42:18 -0800296 "poweroff_timeout": 5,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800297 "platforms": {"cypress/psoc64": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800298 "binaries": {
299 "spe": "tfm_s_signed.hex",
300 "nspe": "tfm_ns_signed.hex",
301 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800302 "monitors": {
Xinyu Zhang32355382023-04-25 17:49:06 +0800303 'reg_tests': reg_tests_monitors,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800304 }
Arthur She87602dc2022-02-06 14:42:18 -0800305}
306
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100307# All configurations should be mapped here
Fathi Boudra31225f72020-11-25 13:51:07 +0100308lava_gen_config_map = {
309 "mps2_an521_bl2": tfm_mps2_sse_200,
Bence Balogh4fe9b882022-03-30 15:23:47 +0200310 "fvp_mps3_an552_bl2": fvp_mps3_an552_bl2,
Fathi Boudra31225f72020-11-25 13:51:07 +0100311 "fvp_mps2_an521_bl2": fvp_mps2_an521_bl2,
Fathi Boudra31225f72020-11-25 13:51:07 +0100312 "fvp_mps2_an519_bl2": fvp_mps2_an519_bl2,
Fathi Boudracaa90bd2020-12-04 22:00:14 +0100313 "qemu_mps2_bl2": qemu_mps2_bl2,
Fathi Boudra31225f72020-11-25 13:51:07 +0100314 "musca_b1": musca_b1_bl2,
Arthur She07c91b52021-07-15 15:03:10 -0700315 "stm32l562e_dk": stm32l562e_dk,
Arthur She54b10a52023-04-11 22:30:11 -0700316 "lpcxpresso55s69": lpcxpresso55s69,
Arthur She96c6f772023-05-09 21:32:50 -0700317 "b_u585i_iot02a": b_u585i_iot02a,
Arthur She87602dc2022-02-06 14:42:18 -0800318 "psoc64": psoc64,
Fathi Boudra31225f72020-11-25 13:51:07 +0100319}
Matthew Hart2c2688f2020-05-26 13:09:20 +0100320
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100321lavagen_config_sort_order = [
322 "templ",
323 "job_name",
324 "device_type",
325 "job_timeout",
326 "action_timeout",
327 "monitor_timeout",
328 "recovery_store_url",
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100329 "platforms",
Xinyu Zhang22a12752022-10-10 17:21:21 +0800330 "monitors"
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100331]
332
333lava_gen_monitor_sort_order = [
334 'name',
335 'start',
336 'end',
337 'pattern',
338 'fixup',
339]