blob: 35ca4b49fff83c2c1795a032811faa29ce9cb245 [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],
100 'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
101 'arch_tests': [monitors_arch_tests] if os.getenv("TEST_PSA_API") != "IPC" else [], # FF test on FPGA not supported in LAVA yet
102 }
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100103}
104
Xinyu Zhang22a12752022-10-10 17:21:21 +0800105# FVP with BL2 bootloader for AN552
Bence Balogh4fe9b882022-03-30 15:23:47 +0200106# firmware <-> ns <-> application: --application cpu0=bl2.axf
107# bootloader <-> s <-> data: --data cpu0=tfm_s_ns_signed.bin@0x01000000
108fvp_mps3_an552_bl2 = {
109 "templ": "fvp_mps3.jinja2",
110 "job_name": "fvp_mps3_an552_bl2",
111 "device_type": "fvp",
112 "job_timeout": 15,
113 "action_timeout": 10,
114 "monitor_timeout": 15,
115 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800116 "platforms": {"arm/mps3/an552": ""},
Bence Balogh4fe9b882022-03-30 15:23:47 +0200117 "data_bin_offset": "0x01000000",
118 "binaries": {
119 "application": "bl2.axf",
120 "data": "tfm_s_ns_signed.bin"
121 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800122 "monitors": {
123 'no_reg_tests': [monitors_no_reg_tests],
124 'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
125 }
Bence Balogh4fe9b882022-03-30 15:23:47 +0200126}
Dean Bircha6ede7e2020-03-13 14:00:33 +0000127
Xinyu Zhang22a12752022-10-10 17:21:21 +0800128# FVP with BL1 and BL2 bootloader for Corstone1000
Satish Kumar1cfdd912022-08-01 09:24:07 +0100129fvp_corstone1000 = {
130 "templ": "fvp_corstone1000.jinja2",
131 "job_name": "fvp_corstone1000",
132 "device_type": "fvp",
133 "job_timeout": 15,
134 "action_timeout": 10,
135 "monitor_timeout": 15,
136 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800137 "platforms": {"arm/corstone1000": ""},
Satish Kumar1cfdd912022-08-01 09:24:07 +0100138 "data_bin_offset": "0x68100000",
139 "binaries": {
140 "application": "bl1.bin",
141 "data": "flash.bin"
142 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800143 "monitors": {
144 'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests] if "FVP" in os.getenv('EXTRA_PARAMS') else [],
145 }
Satish Kumar1cfdd912022-08-01 09:24:07 +0100146}
147
Xinyu Zhang22a12752022-10-10 17:21:21 +0800148# FVP with BL2 bootloader for AN521
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800149# application: --application cpu0=bl2.axf
150# data: --data cpu0=tfm_s_ns_signed.bin@0x10080000
Matthew Hart2c2688f2020-05-26 13:09:20 +0100151fvp_mps2_an521_bl2 = {
152 "templ": "fvp_mps2.jinja2",
153 "job_name": "fvp_mps2_an521_bl2",
Dean Bircha6ede7e2020-03-13 14:00:33 +0000154 "device_type": "fvp",
Matthew Hart2c2688f2020-05-26 13:09:20 +0100155 "job_timeout": 15,
156 "action_timeout": 10,
Xinyu Zhangd8703f02021-05-18 20:30:07 +0800157 "monitor_timeout": 15,
Matthew Hartfb6fd362020-03-04 21:03:59 +0000158 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800159 "platforms": {"arm/mps2/an521": ""},
Matthew Hartfb6fd362020-03-04 21:03:59 +0000160 "data_bin_offset": "0x10080000",
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800161 "binaries": {
162 "application": "bl2.axf",
163 "data": "tfm_s_ns_signed.bin"
164 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800165 "monitors": {
166 'no_reg_tests': [monitors_no_reg_tests],
167 'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
168 'arch_tests': [monitors_arch_tests],
169 }
Matthew Hartfb6fd362020-03-04 21:03:59 +0000170}
171
172
Xinyu Zhang22a12752022-10-10 17:21:21 +0800173# FVP with BL2 bootloader for AN519
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800174# application: --application cpu0=bl2.axf
175# data: --data cpu0=tfm_s_ns_signed.bin@0x10080000
Matthew Hart2c2688f2020-05-26 13:09:20 +0100176fvp_mps2_an519_bl2 = {
177 "templ": "fvp_mps2.jinja2",
178 "job_name": "fvp_mps2_an519_bl2",
179 "device_type": "fvp",
180 "job_timeout": 15,
181 "action_timeout": 10,
Xinyu Zhangd8703f02021-05-18 20:30:07 +0800182 "monitor_timeout": 15,
Matthew Hart2c2688f2020-05-26 13:09:20 +0100183 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800184 "platforms": {"arm/mps2/an519": ""},
Matthew Hart2c2688f2020-05-26 13:09:20 +0100185 "data_bin_offset": "0x10080000",
186 "cpu0_baseline": 1,
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800187 "binaries": {
188 "application": "bl2.axf",
189 "data": "tfm_s_ns_signed.bin"
190 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800191 "monitors": {
192 'no_reg_tests': [monitors_no_reg_tests],
193 'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
194 }
Matthew Hart2c2688f2020-05-26 13:09:20 +0100195}
196
197
Xinyu Zhang22a12752022-10-10 17:21:21 +0800198# QEMU for AN521 with BL2 bootloader
Fathi Boudracaa90bd2020-12-04 22:00:14 +0100199qemu_mps2_bl2 = {
200 "templ": "qemu_mps2_bl2.jinja2",
201 "job_name": "qemu_mps2_bl2",
202 "device_type": "qemu",
Xinyu Zhangaad0e642022-08-09 14:28:58 +0800203 "job_timeout": 15,
204 "action_timeout": 10,
205 "monitor_timeout": 15,
206 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800207 "platforms": {"arm/mps2/an521": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800208 "binaries": {
209 "firmware": "tfm_s_ns_signed.bin",
210 "bootloader": "bl2.bin"
211 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800212 "monitors": {
213 'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
Xinyu Zhange89f45c2021-09-14 21:11:59 +0800214 }
Fathi Boudracaa90bd2020-12-04 22:00:14 +0100215}
216
217
218# Musca-B1 with BL2 bootloader
219# unified hex file comprising of both bl2.bin and tfm_s_ns_signed.bin
220# 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 +0100221musca_b1_bl2 = {
222 "templ": "musca_b1.jinja2",
223 "job_name": "musca_b1_bl2",
224 "device_type": "musca-b",
Xinyu Zhang630dfe62021-06-17 14:38:11 +0800225 "job_timeout": 40,
226 "action_timeout": 20,
227 "monitor_timeout": 30,
Ryan Harkinf6981082020-12-18 14:54:33 +0000228 "poweroff_timeout": 40,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800229 "platforms": {"arm/musca_b1": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800230 "binaries": {
231 "firmware": "tfm.hex",
232 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800233 "monitors": {
234 'no_reg_tests': [monitors_no_reg_tests],
235 'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
236 }
Fathi Boudra31225f72020-11-25 13:51:07 +0100237}
238
Arthur She07c91b52021-07-15 15:03:10 -0700239# STM32L562E-DK
240stm32l562e_dk = {
241 "templ": "stm32l562e_dk.jinja2",
242 "job_name": "stm32l562e_dk",
243 "device_type": "stm32l562e-dk",
244 "job_timeout": 24,
245 "action_timeout": 15,
246 "monitor_timeout": 15,
247 "poweroff_timeout": 5,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800248 "platforms": {"stm/stm32l562e_dk": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800249 "binaries": {
250 "tarball": "stm32l562e-dk-tfm.tar.bz2",
251 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800252 "monitors": {
253 'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
254 }
Arthur She07c91b52021-07-15 15:03:10 -0700255}
Xinyu Zhang97114342021-01-21 14:08:03 +0800256
Arthur She3c0dadd2021-11-18 21:17:48 -0800257# LPCxpresso55S69
258lpcxpresso55s69 = {
259 "templ": "lpcxpresso55s69.jinja2",
260 "job_name": "lpcxpresso55s69",
261 "device_type": "lpcxpresso55s69",
262 "job_timeout": 24,
263 "action_timeout": 15,
264 "monitor_timeout": 15,
265 "poweroff_timeout": 5,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800266 "platforms": {"nxp/lpcxpresso55s69": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800267 "binaries": {
268 "tarball": "lpcxpresso55s69-tfm.tar.bz2",
269 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800270 "monitors": {
271 'no_reg_tests': [monitors_no_reg_tests],
272 'reg_tests': [monitors_s_reg_tests, monitors_ns_reg_tests],
Arthur She3c0dadd2021-11-18 21:17:48 -0800273 }
274}
275
Arthur She87602dc2022-02-06 14:42:18 -0800276# Cypress PSoC64
277psoc64 = {
278 "templ": "psoc64.jinja2",
279 "job_name": "psoc64",
280 "device_type": "cy8ckit-064s0s2-4343w",
Xinyu Zhange8bb1b12022-10-18 17:42:30 +0800281 "job_timeout": 30,
282 "action_timeout": 20,
283 "monitor_timeout": 20,
Arthur She87602dc2022-02-06 14:42:18 -0800284 "poweroff_timeout": 5,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800285 "platforms": {"cypress/psoc64": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800286 "binaries": {
287 "spe": "tfm_s_signed.hex",
288 "nspe": "tfm_ns_signed.hex",
289 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800290 "monitors": {
291 'reg_tests': [monitors_s_reg_tests, monitors_ns_reg_tests],
292 }
Arthur She87602dc2022-02-06 14:42:18 -0800293}
294
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100295# All configurations should be mapped here
Fathi Boudra31225f72020-11-25 13:51:07 +0100296lava_gen_config_map = {
297 "mps2_an521_bl2": tfm_mps2_sse_200,
Bence Balogh4fe9b882022-03-30 15:23:47 +0200298 "fvp_mps3_an552_bl2": fvp_mps3_an552_bl2,
Satish Kumar1cfdd912022-08-01 09:24:07 +0100299 "fvp_corstone1000": fvp_corstone1000,
Fathi Boudra31225f72020-11-25 13:51:07 +0100300 "fvp_mps2_an521_bl2": fvp_mps2_an521_bl2,
Fathi Boudra31225f72020-11-25 13:51:07 +0100301 "fvp_mps2_an519_bl2": fvp_mps2_an519_bl2,
Fathi Boudracaa90bd2020-12-04 22:00:14 +0100302 "qemu_mps2_bl2": qemu_mps2_bl2,
Fathi Boudra31225f72020-11-25 13:51:07 +0100303 "musca_b1": musca_b1_bl2,
Arthur She07c91b52021-07-15 15:03:10 -0700304 "stm32l562e_dk": stm32l562e_dk,
Arthur She3c0dadd2021-11-18 21:17:48 -0800305 "lpcxpresso55s69": lpcxpresso55s69,
Arthur She87602dc2022-02-06 14:42:18 -0800306 "psoc64": psoc64,
Fathi Boudra31225f72020-11-25 13:51:07 +0100307}
Matthew Hart2c2688f2020-05-26 13:09:20 +0100308
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100309lavagen_config_sort_order = [
310 "templ",
311 "job_name",
312 "device_type",
313 "job_timeout",
314 "action_timeout",
315 "monitor_timeout",
316 "recovery_store_url",
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100317 "platforms",
Xinyu Zhang22a12752022-10-10 17:21:21 +0800318 "monitors"
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100319]
320
321lava_gen_monitor_sort_order = [
322 'name',
323 'start',
324 'end',
325 'pattern',
326 'fixup',
327]