Commit graph

5458 commits

Author SHA1 Message Date
Jordan Yates
a5ffd7f7a3 scripts: twisterlib: extend testcase schema for reboots
Extend the testcase schema to provide a way to communicate that a given
test is expected to reboot during execution. The generic harness takes
that information and suppresses `already STARTED` warnings if the
restart is expected.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-04-14 13:05:46 +02:00
Fabrice DJIATSA
cf517f92fc scripts: twister: fix regenerate serial device with unknown platform
Since BOOT-SERIAL isn't a recognized STMicroelectronics product name,
when Twister saves the new map.yaml, it will also check if the previous
map.yaml had the 'SERIAL-BOOT' product name and attach the corresponding
serial device.It won't generate a new one with an unknown platform name.


Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2025-04-14 11:49:13 +02:00
Chris Friedt
b032304bbe scripts: ci: check_compliance: use git-top to check modules
BoardYml, DeviceTreeBindings, Kconfig, and KconfigBasic checks
can be run with a decentralized west manifest.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-11 06:32:31 +02:00
Chris Friedt
07a023d779 scripts: ci: check_compliance: GIT_TOP and ZEPHYR_BASE as paths
Use pathlib.Path objects for GIT_TOP and ZEPHYR_BASE instead of
strings.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-11 06:32:31 +02:00
Chris Friedt
af342e5205 scripts: ci: check_compliance: allow mcuboot log level dbg
Currently, only MCUBOOT_LOG_LEVEL_INF and MCUBOOT_LOG_LEVEL_WRN
are allowed in UNDEF_KCONFIG_ALLOWLIST. Let's allow
MCUBOOT_LOG_LEVEL_DBG as well, since some use cases may require
this level of scrutiny.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-11 06:32:31 +02:00
Chris Friedt
305e648d63 scripts: ci: check_compliance: ignore patch and diff files
Was getting several false positives about whitespace at line
endings with check_compliance.py because it was analyzing
.patch and .diff files as source.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-11 06:32:31 +02:00
James Roy
285b8ac933 style: edtlib: Use a more efficient expression
Replaced nested loops with a list comprehension
to improve performance. Execution time improved
from 0.0046203136444s to 0.0040774345397s

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-04-09 22:05:22 +02:00
Lukasz Mrugala
d698209647 twister: Remove C object buildlist from -i test
The disparity in C objects built causes
the test to fail.
This removes those lines from the log
to inline log comparison.

Let's disable it in the relevant test.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2025-04-08 22:59:12 +02:00
Ederson de Souza
e420b21834 share/sysbuild: Support single app slot RAM load mode
Adds a new Kconfig to support MCUboot single application slot RAM load
mode.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2025-04-08 16:12:33 +02:00
Dmitrii Golovanov
067126abcd twister: harness: fix Ztest case summary pattern
Fix missing match on Ztest test case summary log entries, so even
if the test case 'END' log entry is missed or corrupted, its status
will be updated from the Ztest summary log entries, if present.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2025-04-08 11:45:08 +02:00
Torsten Rasmussen
483c76759d scripts: support quoted sysbuild Kconfig settings in twister
Kconfig settings of string type is passed to CMake with quotes to ensure
they are properly handled, for example when specified in testcase.yml as
>   extra_args:
>    - CONFIG_FOO="bar"

Support sysbuild Kconfig settings `SB_CONFIG` by performing the same
quoting for settings starting with `SB_CONFIG_`.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2025-04-04 14:56:39 +02:00
Jamie McCrae
2f55dc8add scripts: ci: check_compliance: Disallow board hooks in defconfigs
Adds board hooks to the disallowed defconfig symbol list as
these should be selected, not put in a defconfig

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-04-04 12:06:38 +02:00
Sven Ginka
de6f1873c8 west: runners: add flash runner for sensry sy1xx socs
With this commit we add a runner that is capable of flashing
the sensry sy1xx socs via uart to support the onboard OTP
bootloader. Added the sy1xx runner to the list for
automated test.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2025-04-04 12:06:07 +02:00
Pieter De Gendt
b2c37e00fc scripts: ci: compliance: Check .pyi files with ruff
Add pyi stub files to be checked by the ruff CI compliance rule.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-04-03 00:07:03 +02:00
James Roy
ee17657ad3 edtlib: binding: Add a title keyword
Add a 'title' keyword to the binding to provide a short
description of the binding, while 'description' serves as
the long description.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-04-02 12:54:24 +02:00
Anas Nashif
1823c394c3 actions: update requirements-actions.in
pin gcovr to 6.0

See #87899

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-01 16:26:22 +02:00
Håkon Amundsen
1fac1b917f boards: nordic: add 'iron' board variant
This is needed for next generation Secure Domain firmware.

Signed-off-by: Håkon Amundsen <haakon.amundsen@nordicsemi.no>
2025-04-01 11:54:30 +02:00
Hakan Jansson
f107dad6e9 west: runners: openocd: Fix version format regression
Change OpenOCD version regex to be compatible again with format strings
not having a space or newline immediately after the version nr.

Modified regex has been verified with the strings listed below.

Ubuntu:
"Open On-Chip Debugger 0.11.0"

ADI:
"Open On-Chip Debugger (Analog Devices 0.12.0-1.1.1)  OpenOCD 0.12.0 (2024-
08-27-17:25)"

Zephyr SDK:
"Open On-Chip Debugger 0.11.0+dev-00728-gb6f95a16c (2024-02-17-23:51)"

Infineon:
"Open On-Chip Debugger 0.12.0+dev-5.2.1.3248 (2024-08-08-17:29)"

Espressif:
"Open On-Chip Debugger v0.12.0-esp32-20240318 (2024-03-18-18:25)"

Fixes: 1c05f2121c

Signed-off-by: Hakan Jansson <hakan.jansson@infineon.com>
2025-04-01 04:14:58 +02:00
Peter Johanson
4399d9e3a2 west: runners: rfp: Add Reneses Flash Programmer runner
Add a basic RFP runner that supports the `flash` command targettting
the Renesas Standard Boot Firmware.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2025-03-31 19:49:22 -04:00
Carles Cufi
f42cef9c81 runners: nrf: Default to ERASE_NONE for the nRF54L series
The Nordic nRF54L series ICs use RRAM instead of flash. This implies
that erasing the internal storage before writing the new firmware is not
required anymore (unlike NOR flash, which does).
Note that RRAM on nRF54L devices is not physically paged, and paging is
only artificially provided, with a page size of 4096 bytes, for an easier
transition of nRF52 software to nRF54L devices.
In order to speed up the flashing operation and avoiding doing wasteful
write operations on the RRAM, default to ERASE_NONE for ICs in these
series.
A new ``--erase-pages`` command-line switch has been added to allow
users to keep erasing the pages that will be written to the firmware.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2025-03-31 22:01:35 +02:00
Anas Nashif
a0d204c1f3 actions: add gitpython to requirements-actions.in
Needed for various workflows.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-31 11:29:31 +02:00
Arkadiusz Cholewinski
35b13e1629 Twister: Add power measurements support for Twister.
Add support for powerShield of stm32l562e_dk board.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2025-03-31 08:06:25 +02:00
Anas Nashif
19c6240b68 tests: twister: disable test_inline_logs temporarily
This test fails on older python versions (3.10) and only on CI.
Disabling it while we investigate. The test itself verifies inline logs
options, so the functionality test is not impacted.

Tracked in #87769

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-29 07:44:46 -04:00
Anas Nashif
11ece85d1b ci: workflows: pin python dependencies
Pin python dependencies to hashes and cleanup/unify python setup steps in
various workflows.

We now have one dependency file containing all requirements for github
actions that is managed centrally with hashes. No direct pip installs
are needed in workflow files and everything shall go via the
requirements file.

Pinning to specific version and hashes helps with preventing supply
chain attacks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-29 07:44:46 -04:00
Galen Krulce
5ae9f44825 code_relocation: Cache list of obj files
As part of relocation, this script matches each source file to its
corresponding object file. This matching is done inside of get_obj_filename
which is called once per source file.

get_obj_filename traverses the entire build directory on every invocation.
This is unnecessary since built object files don't change. On a
sufficiently large project (like mine), this script takes over a minute and
the majority of that time is spent needlessly traversing the build
directory again and again.

Caching the list of object files enables this script to run in less than a
second.

I tested by building my project (which enables the relocation script) and
comparing memory breakdown before / after.

Signed-off-by: Galen Krulce <gkrulce@meta.com>
2025-03-28 16:17:11 +01:00
James Roy
9b795840f9 style: edtlib: Remove the redundant keys() method
Remove the redundant keys method when using the
in statement on a dict to fix the Ruff SIM118
warning.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-03-28 12:22:00 +01:00
James Roy
8a2cde9688 style: edtlib: Use from to chain the exception
Use the from keyword to chain exceptions in
order to fix the Ruff B904 warning.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-03-28 12:22:00 +01:00
James Roy
826ddaed97 style: edtlib: Use the more readable not-equal operator
Replace 'not xx == xx' with 'xx != xx' to
fix the Ruff SIM201 warning.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-03-28 12:22:00 +01:00
James Roy
b543c26548 style: edtlib: Reorganize the single-line if statement block
Move the statement in the single-line if block
to a new line to fix the Ruff E701 warning.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-03-28 12:22:00 +01:00
James Roy
8bf5fd9668 style: edtlib: Remove the redundant call arguments
Remove the redundant positional argument in
open function to fix the Ruff UP015 warning.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-03-28 12:22:00 +01:00
James Roy
7207e91972 style: edtlib: Merge redundant if statements
Merge redundant if statements to fix the Ruff
SIM102 warning.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-03-28 12:22:00 +01:00
James Roy
20d8a47ad1 style: edtlib: Use a more readable not in statement
Replace 'not xx in xx' with the more readable
'xx not in xx' syntax to fix the Ruff E713 warning.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-03-28 12:22:00 +01:00
James Roy
8b142ded55 style: edtlib: Sort the import statements
Sort the import statements to fix the
Ruff I001 warning.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-03-28 12:22:00 +01:00
James Roy
f2eb205d6d style: edtlib: Add an explicit strict argument to the zip
Add an explicit strict parameter to the zip
function to fix the Ruff B905 warning.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-03-28 12:22:00 +01:00
James Roy
9e46536a1f style: edtlib: Remove deprecated packages
Remove imported deprecated packages and replace
with new packages to fix Ruff UP035 warning.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-03-28 12:22:00 +01:00
James Roy
1425de54e7 style: edtlib: Remove unnecessary quotes
Remove unnecessary quotes from deferred type
annotations to fix the Ruff UP037 warning.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-03-28 12:22:00 +01:00
Reto Schneider
67834a84c9 twister: Add missing spaces
This adds some missing whitespaces, thus improves the output of `twister
--help`.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2025-03-27 17:18:04 +01:00
Björn Bergman
6c197f8961 scripts: Make gen_app_partitions.py cmake linker generator savvy
Tweak gen_app_partitions.py to be able to generate cmake linker
generator output as well as ld-script fragments.

Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
2025-03-27 17:17:03 +01:00
Anas Nashif
56c5e93cb7 ci: add empty CODEOWNERS file
Add an empty codeowner file redirecting to MAINTAINERSS.yml file for
clarity and to make some tooling happy.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-27 09:50:45 +01:00
Hake Huang
c5aacbc22a twister: runner: --prep-artifacts-for-testing protection
need add protection when check with sysbuild filter out
application, the domains is NULL

fixes: #87163

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2025-03-27 03:50:04 +01:00
Helmut Lord
1b6feab090 scripts: west: commands: completion: zsh: add "west shields" completion
Adds west shields completion to zsh, matching funtionality found in bash
autocomplete.

Signed-off-by: Helmut Lord <kellyhlord@gmail.com>
2025-03-26 21:56:33 +01:00
Grzegorz Chwierut
5d049b6451 twister: Fix quarantine filtering simulations
Quarantine filter was not correctly identifying the simulator name.
Now it uses the simulator name from the Platform object,
ensuring that quarantined tests are properly excluded or verified

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2025-03-24 19:23:31 +01:00
Lukasz Mrugala
6ef4db88dd twister: Remove unrecognised sections test
The section lists that govern whether the ELF
section is recognised or not are out of date.

A programming bug has rendered the unrecognised
section check unrunnable for years.

Thus, the practically dead code of the
unrecognised section check is removed
in this commit.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2025-03-24 07:53:01 +01:00
Anas Nashif
173468ca53 twister: filters: fix processing of platform scope
Optimize code and fix process being killed when llaunched with --all.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-23 10:15:30 -04:00
Anas Nashif
56f7dc4c2e scripts: make sure we do not install vulunerable python packages
Make sure we install packages with no issues, some of the issues being
reporting on packages we might install using pip:

Warn: Project is vulnerable to: PYSEC-2019-41 / GHSA-qfc5-mcwq-26q8
Warn: Project is vulnerable to: PYSEC-2014-14 / GHSA-652x-xj99-gmcc
Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56
Warn: Project is vulnerable to: PYSEC-2014-13 / GHSA-cfj3-7x9c-4p3h
Warn: Project is vulnerable to: PYSEC-2018-28 / GHSA-x84v-xcm2-53pg
Warn: Project is vulnerable to: PYSEC-2017-74
Warn: Project is vulnerable to: GHSA-55x5-fj6c-h6m8
Warn: Project is vulnerable to: PYSEC-2014-9 / GHSA-57qw-cc2g-pv5p
Warn: Project is vulnerable to: PYSEC-2021-19 / GHSA-jq4v-f5q6-mjqq
Warn: Project is vulnerable to: GHSA-pgww-xf46-h92r
Warn: Project is vulnerable to: PYSEC-2022-230 / GHSA-wrxv-2j5q-m38w
Warn: Project is vulnerable to: PYSEC-2018-12 / GHSA-xp26-p53h-6h2p
Warn: Project is vulnerable to: PYSEC-2024-4 / GHSA-2mqj-m65w-jghx
Warn: Project is vulnerable to: PYSEC-2023-165 / GHSA-cwvm-v4w8-q58c
Warn: Project is vulnerable to: PYSEC-2022-42992 / GHSA-hcpj-qp55-gfph
Warn: Project is vulnerable to: PYSEC-2023-137 / GHSA-pr76-5cm5-w9cj
Warn: Project is vulnerable to: PYSEC-2023-161 / GHSA-wfm5-v35h-vwf4
Warn: Project is vulnerable to: GHSA-3f63-hfp8-52jq
Warn: Project is vulnerable to: GHSA-44wm-f244-xhp3
Warn: Project is vulnerable to: GHSA-56pw-mpj4-fxww
Warn: Project is vulnerable to: GHSA-j7hp-h8jx-5ppr
Warn: Project is vulnerable to: PYSEC-2023-175
Warn: Project is vulnerable to: PYSEC-2018-34 / GHSA-2fc2-6r4j-p65h
Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6
Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf
Warn: Project is vulnerable to: PYSEC-2018-33 / GHSA-cw6w-4rcx-xphc
Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f
Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm
Warn: Project is vulnerable to: PYSEC-2017-1 / GHSA-frgw-fgh6-9g52
Warn: Project is vulnerable to: GHSA-c6fm-rgw4-8q73

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-22 14:03:56 -04:00
Lukasz Fundakowski
d45396a6bb twister: Cleanup twister loggers
Removed logger.setLevel(...) from all twister modules, becasue
there should be only one place where twister loggers are configured,
and the log level should be set in that place.
This should be done in twister_main.py in setup_logging function.

Signed-off-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
2025-03-19 09:08:00 -04:00
Anas Nashif
b0792bbfa2 twister: config: test on integration plaforms if defined
Add option to force integration mode on a defined list of tests, for
example tests for sample that are identified with 'sample.'.

A sample per definition shall be tested on documented and supported
platforms listed in the sample documentation. Samples shall not be used
as tests to verify functionality of a feature on all available plaforms
in Zephyr.

To still allow testing on platforms not listed in the doc, and when such
platforms are covered by the provided filter, we should still be able to
build/run the tests on those platforms (not directly listed in
integration_platforms).

We detect a sample by its test identifier, i.e., it starts with 'sample.'.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-03-19 08:51:50 -04:00
Camille BAUD
9ad7f840bf west: runners: Do not ignore --no-reset in command line or arguments
Prevents this code section from enforcing reset even
if --no-reset was passed at some point

Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-03-19 01:24:17 +01:00
Carles Cufi
bb1794bf3a west: runners: jlink: Use registry to locate JLink executable
Instead of hardcoding a set of paths and trying to find the JLink
executable in them, use the corresponding Windows registry to locate it:

`HKEY_CURRENT_USER\\Software\\SEGGER\\J-Link`

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2025-03-18 19:54:14 +01:00
Carles Cufi
4c12a8c782 west: runners: jlink: Avoid running logic when another runner is used
The logic to detect the default JLink location was placed at the top of
the script, executing whenever the script was imported. The west
extension command framework loads all runners when initializing, and so
this logic was being executed even when using another runner.

Move the logic to a function that is only executed when the JLink runner
is selected, to avoid executing it at all times.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2025-03-18 19:54:14 +01:00