blob: 0cee521361b9d307011abd3e690eeda2eed3dd3e [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
101 'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests] if 'FPON' not in os.getenv("EXTRA_PARAMS") 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],
125 'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
126 }
Bence Balogh4fe9b882022-03-30 15:23:47 +0200127}
Dean Bircha6ede7e2020-03-13 14:00:33 +0000128
Xinyu Zhang22a12752022-10-10 17:21:21 +0800129# FVP with BL1 and BL2 bootloader for Corstone1000
Satish Kumar1cfdd912022-08-01 09:24:07 +0100130fvp_corstone1000 = {
131 "templ": "fvp_corstone1000.jinja2",
132 "job_name": "fvp_corstone1000",
133 "device_type": "fvp",
134 "job_timeout": 15,
135 "action_timeout": 10,
136 "monitor_timeout": 15,
137 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800138 "platforms": {"arm/corstone1000": ""},
Satish Kumar1cfdd912022-08-01 09:24:07 +0100139 "data_bin_offset": "0x68100000",
140 "binaries": {
141 "application": "bl1.bin",
142 "data": "flash.bin"
143 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800144 "monitors": {
145 'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests] if "FVP" in os.getenv('EXTRA_PARAMS') else [],
146 }
Satish Kumar1cfdd912022-08-01 09:24:07 +0100147}
148
Xinyu Zhang22a12752022-10-10 17:21:21 +0800149# FVP with BL2 bootloader for AN521
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800150# application: --application cpu0=bl2.axf
151# data: --data cpu0=tfm_s_ns_signed.bin@0x10080000
Matthew Hart2c2688f2020-05-26 13:09:20 +0100152fvp_mps2_an521_bl2 = {
153 "templ": "fvp_mps2.jinja2",
154 "job_name": "fvp_mps2_an521_bl2",
Dean Bircha6ede7e2020-03-13 14:00:33 +0000155 "device_type": "fvp",
Matthew Hart2c2688f2020-05-26 13:09:20 +0100156 "job_timeout": 15,
157 "action_timeout": 10,
Xinyu Zhangd8703f02021-05-18 20:30:07 +0800158 "monitor_timeout": 15,
Matthew Hartfb6fd362020-03-04 21:03:59 +0000159 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800160 "platforms": {"arm/mps2/an521": ""},
Matthew Hartfb6fd362020-03-04 21:03:59 +0000161 "data_bin_offset": "0x10080000",
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800162 "binaries": {
163 "application": "bl2.axf",
164 "data": "tfm_s_ns_signed.bin"
165 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800166 "monitors": {
167 'no_reg_tests': [monitors_no_reg_tests],
168 'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
169 'arch_tests': [monitors_arch_tests],
170 }
Matthew Hartfb6fd362020-03-04 21:03:59 +0000171}
172
173
Xinyu Zhang22a12752022-10-10 17:21:21 +0800174# FVP with BL2 bootloader for AN519
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800175# application: --application cpu0=bl2.axf
176# data: --data cpu0=tfm_s_ns_signed.bin@0x10080000
Matthew Hart2c2688f2020-05-26 13:09:20 +0100177fvp_mps2_an519_bl2 = {
178 "templ": "fvp_mps2.jinja2",
179 "job_name": "fvp_mps2_an519_bl2",
180 "device_type": "fvp",
181 "job_timeout": 15,
182 "action_timeout": 10,
Xinyu Zhangd8703f02021-05-18 20:30:07 +0800183 "monitor_timeout": 15,
Matthew Hart2c2688f2020-05-26 13:09:20 +0100184 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800185 "platforms": {"arm/mps2/an519": ""},
Matthew Hart2c2688f2020-05-26 13:09:20 +0100186 "data_bin_offset": "0x10080000",
187 "cpu0_baseline": 1,
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800188 "binaries": {
189 "application": "bl2.axf",
190 "data": "tfm_s_ns_signed.bin"
191 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800192 "monitors": {
193 'no_reg_tests': [monitors_no_reg_tests],
194 'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
195 }
Matthew Hart2c2688f2020-05-26 13:09:20 +0100196}
197
198
Xinyu Zhang22a12752022-10-10 17:21:21 +0800199# QEMU for AN521 with BL2 bootloader
Fathi Boudracaa90bd2020-12-04 22:00:14 +0100200qemu_mps2_bl2 = {
201 "templ": "qemu_mps2_bl2.jinja2",
202 "job_name": "qemu_mps2_bl2",
203 "device_type": "qemu",
Xinyu Zhang5dcb0d52022-10-24 14:10:19 +0800204 "job_timeout": 30,
205 "action_timeout": 20,
206 "monitor_timeout": 20,
Xinyu Zhangaad0e642022-08-09 14:28:58 +0800207 "poweroff_timeout": 1,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800208 "platforms": {"arm/mps2/an521": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800209 "binaries": {
210 "firmware": "tfm_s_ns_signed.bin",
211 "bootloader": "bl2.bin"
212 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800213 "monitors": {
Jianliang Shen9798e552022-11-21 12:55:42 +0800214 # FPU test on AN521 qemu not supported yet
215 'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests] if 'FPON' not in os.getenv("EXTRA_PARAMS") else [],
Xinyu Zhange89f45c2021-09-14 21:11:59 +0800216 }
Fathi Boudracaa90bd2020-12-04 22:00:14 +0100217}
218
219
220# Musca-B1 with BL2 bootloader
221# unified hex file comprising of both bl2.bin and tfm_s_ns_signed.bin
222# 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 +0100223musca_b1_bl2 = {
224 "templ": "musca_b1.jinja2",
225 "job_name": "musca_b1_bl2",
226 "device_type": "musca-b",
Xinyu Zhang630dfe62021-06-17 14:38:11 +0800227 "job_timeout": 40,
228 "action_timeout": 20,
229 "monitor_timeout": 30,
Ryan Harkinf6981082020-12-18 14:54:33 +0000230 "poweroff_timeout": 40,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800231 "platforms": {"arm/musca_b1": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800232 "binaries": {
233 "firmware": "tfm.hex",
234 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800235 "monitors": {
236 'no_reg_tests': [monitors_no_reg_tests],
237 'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
238 }
Fathi Boudra31225f72020-11-25 13:51:07 +0100239}
240
Arthur She07c91b52021-07-15 15:03:10 -0700241# STM32L562E-DK
242stm32l562e_dk = {
243 "templ": "stm32l562e_dk.jinja2",
244 "job_name": "stm32l562e_dk",
245 "device_type": "stm32l562e-dk",
246 "job_timeout": 24,
247 "action_timeout": 15,
248 "monitor_timeout": 15,
249 "poweroff_timeout": 5,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800250 "platforms": {"stm/stm32l562e_dk": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800251 "binaries": {
252 "tarball": "stm32l562e-dk-tfm.tar.bz2",
253 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800254 "monitors": {
255 'reg_tests': [monitors_mcuboot_tests, monitors_s_reg_tests, monitors_ns_reg_tests],
256 }
Arthur She07c91b52021-07-15 15:03:10 -0700257}
Xinyu Zhang97114342021-01-21 14:08:03 +0800258
Arthur She3c0dadd2021-11-18 21:17:48 -0800259# LPCxpresso55S69
260lpcxpresso55s69 = {
261 "templ": "lpcxpresso55s69.jinja2",
262 "job_name": "lpcxpresso55s69",
263 "device_type": "lpcxpresso55s69",
264 "job_timeout": 24,
265 "action_timeout": 15,
266 "monitor_timeout": 15,
267 "poweroff_timeout": 5,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800268 "platforms": {"nxp/lpcxpresso55s69": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800269 "binaries": {
270 "tarball": "lpcxpresso55s69-tfm.tar.bz2",
271 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800272 "monitors": {
273 'no_reg_tests': [monitors_no_reg_tests],
274 'reg_tests': [monitors_s_reg_tests, monitors_ns_reg_tests],
Arthur She3c0dadd2021-11-18 21:17:48 -0800275 }
276}
277
Arthur She87602dc2022-02-06 14:42:18 -0800278# Cypress PSoC64
279psoc64 = {
280 "templ": "psoc64.jinja2",
281 "job_name": "psoc64",
282 "device_type": "cy8ckit-064s0s2-4343w",
Xinyu Zhange8bb1b12022-10-18 17:42:30 +0800283 "job_timeout": 30,
284 "action_timeout": 20,
285 "monitor_timeout": 20,
Arthur She87602dc2022-02-06 14:42:18 -0800286 "poweroff_timeout": 5,
Xinyu Zhang22a12752022-10-10 17:21:21 +0800287 "platforms": {"cypress/psoc64": ""},
Xinyu Zhang28d61b42022-03-21 16:46:35 +0800288 "binaries": {
289 "spe": "tfm_s_signed.hex",
290 "nspe": "tfm_ns_signed.hex",
291 },
Xinyu Zhang22a12752022-10-10 17:21:21 +0800292 "monitors": {
293 'reg_tests': [monitors_s_reg_tests, monitors_ns_reg_tests],
294 }
Arthur She87602dc2022-02-06 14:42:18 -0800295}
296
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100297# All configurations should be mapped here
Fathi Boudra31225f72020-11-25 13:51:07 +0100298lava_gen_config_map = {
299 "mps2_an521_bl2": tfm_mps2_sse_200,
Bence Balogh4fe9b882022-03-30 15:23:47 +0200300 "fvp_mps3_an552_bl2": fvp_mps3_an552_bl2,
Satish Kumar1cfdd912022-08-01 09:24:07 +0100301 "fvp_corstone1000": fvp_corstone1000,
Fathi Boudra31225f72020-11-25 13:51:07 +0100302 "fvp_mps2_an521_bl2": fvp_mps2_an521_bl2,
Fathi Boudra31225f72020-11-25 13:51:07 +0100303 "fvp_mps2_an519_bl2": fvp_mps2_an519_bl2,
Fathi Boudracaa90bd2020-12-04 22:00:14 +0100304 "qemu_mps2_bl2": qemu_mps2_bl2,
Fathi Boudra31225f72020-11-25 13:51:07 +0100305 "musca_b1": musca_b1_bl2,
Arthur She07c91b52021-07-15 15:03:10 -0700306 "stm32l562e_dk": stm32l562e_dk,
Arthur She87602dc2022-02-06 14:42:18 -0800307 "psoc64": psoc64,
Fathi Boudra31225f72020-11-25 13:51:07 +0100308}
Matthew Hart2c2688f2020-05-26 13:09:20 +0100309
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100310lavagen_config_sort_order = [
311 "templ",
312 "job_name",
313 "device_type",
314 "job_timeout",
315 "action_timeout",
316 "monitor_timeout",
317 "recovery_store_url",
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100318 "platforms",
Xinyu Zhang22a12752022-10-10 17:21:21 +0800319 "monitors"
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100320]
321
322lava_gen_monitor_sort_order = [
323 'name',
324 'start',
325 'end',
326 'pattern',
327 'fixup',
328]