Commit graph

5778 commits

Author SHA1 Message Date
Benjamin Cabé
db47c899e3 scripts: ci: check_compliance: no need for lxml anymore
Remove an old workaround requiring lxml to be present as junitparser was
not working with xml.etree.ElementTree until version 3.0.0.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-23 09:31:28 +02:00
Benjamin Cabé
82c955ab7c scripts: net: Remove dependency to lxml in enumerate_http_status.py
Using the third party lxml library for the very simple parsing task this
script performs in unnecessary, so switch to Python's built-in
HTMLParser.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-23 09:31:28 +02:00
Anas Nashif
ac4aabc10d twister: support filtering tests using regex
Use --test-pattern to filter scenarios using regular expressions, for
example:

./scripts/twister --test-pattern '^kernel.semaphore.*' -v

will run all those test using this identifier pattern, and nothing else.
Multiple patterns are possible.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-21 07:23:58 -04:00
Pieter De Gendt
373c0724c9 scripts: ci: check_compliance: Capture failing tests
If a compliance test itself throws an exception, the entire script is
aborted.
Update this by capturing the exception and failing only the test itself.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-07-21 07:22:26 -04:00
Georgij Černyšiov
e71f79d644 scripts: west: runners: stm32cubeprogrammer: fix E0606 related to dl_file
Initialize 'dl_file' to 'None' before the logic that determines
which binary file to load.

Resolves the E0606 Pylint warning.

Signed-off-by: Georgij Černyšiov <geo.cgv@gmail.com>
2025-07-21 07:22:09 -04:00
Tim Pambor
3d077c68ca scripts: requirements: Remove mock
Remove mock from requirements-actions.in as it is not needed anymore.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-07-21 06:57:41 -04:00
Tim Pambor
12ba98b2dd scripts: requirements: Add back tomli
Add back tomli to the requirements-actions.txt as it is still used by
some dependencies.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-07-21 06:57:41 -04:00
Anas Nashif
2f35e68dd8 Revert "scripts: ci: check_compliance: Add support for module Kconfigs"
This reverts commit 6013fc7201.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-19 20:58:31 -04:00
Anas Nashif
9219c81b66 twister: make no-detailed-test-id default
Make this option default and reduce amount of details displayed by
twister.
This options has been enabled in CI for a while now with the intention
of making it default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-19 15:50:47 -04:00
Jamie McCrae
6013fc7201 scripts: ci: check_compliance: Add support for module Kconfigs
Adds support for checking module samples and tests for additional
Kconfigs, as well as logging Kconfigs, so that this check can be
reused more easily with out of tree manifest repos

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-07-19 15:48:24 -04:00
Benjamin Cabé
53ea49539a scripts: requirements: drop tomli dependency
This dependency is not used anywhere so drop it.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-19 15:42:43 -04:00
Benjamin Cabé
edead766dc scripts: requirements: remove dependency to mock package
mock has been available in Python standard lib since Python 3.3, remove
the unnecessary dependency to `mock` pip package.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-19 15:42:19 -04:00
Benjamin Cabé
f39ec79806 scripts: tests: apply ruff linting to test_domains.py
Somehow this file had no exclude rules in .ruff-excludes.toml. Make it
compliant going forward.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-19 15:42:19 -04:00
Benjamin Cabé
0ed775bfc9 scripts: west_commands: canopen: replace progress by tqdm
progress has been unmaintained for years and tqdm is a more
modern and faster alternative, which is already used by other commands.
Replace progress by tqdm in the canopen_program.py script.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-19 15:41:32 -04:00
Appana Durga Kedareswara rao
5e0d266381 runners: xsdb: Add support for optional bl31, pdi, system.dtb arguments
This update enhances the runner script to optionally accept bl31, pdi,
and system.dtb as arguments. These inputs are not mandatory and will
only be used if explicitly provided. This allows for more flexible boot
configurations, especially useful when testing different firmware and
system setups without modifying the script.

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
2025-07-19 15:38:57 -04:00
Declan Snyder
1f1a2e25b2 scripts: check_compliance: Fix traceback in junitparser
junitparser had a bug causing a traceback when running the checkpatch
check compliance module, fix is in 4.0.1 of junitparser from this PR:
https://github.com/weiwei/junitparser/pull/168

Update requirements to make sure we get this version.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-07-19 15:34:47 -04:00
Declan Snyder
3b5bfd9f4a scripts: check_compliance: Fix resource leak
The git diff subprocess was leaking, ie.,
it was still running with it's file streams open,
and python was printing warnings about this. Fix by calling
communicate() on the object which will do the cleanup.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-07-19 15:34:47 -04:00
Luca Burelli
49bf6aad88 dtlib: (cosmetic) use filename and line number on all messages
Take advantage of the new 'filename' and 'lineno' attributes of Node and
Property objects to provide more informative error and status messages
by printing the actual source file reference of the corresponding
object, always using the unquoted file:line format in error messages.

No functional change is introduced by this commit.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-07-19 15:34:13 -04:00
Afonso Oliveira
467d2e8297 scripts: twister: clarify output directory renaming message
Change "Renaming output directory to" message to "Renaming previous
output directory to" to make it clearer that twister is renaming the
existing directory, not the current output directory.

This helps avoid confusion for new twister users who might think the
current output is going to the renamed directory.

Signed-off-by: Afonso Oliveira <afonsoo@synopsys.com>
2025-07-19 13:51:57 -04:00
Anas Nashif
63dd2db594 twister: match platform regex pattern
Use --platform-pattern <regex> to match platforms, something like

twister -T samples/hello_world/ --platform-pattern ".*/stm32f4.*"

will build/run all those platform targets with stm32f4 in them.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-19 13:45:30 -04:00
Declan Snyder
72f451ee9b scripts: kconfiglib: Fix file leaks
Fixing a couple cases of a programming error where a file is not closed
in case of an exception, which was causing resource leak warnings in
some cases when encountering a kconfig error.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-07-19 13:25:56 -04:00
Pieter De Gendt
15fbf214b5 scripts: ci: check_compliance: Keepsorted optional folding
Introduce a marker for zephyr-keep-sorted to not fold continued indented
lines.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-07-19 13:23:41 -04:00
Pieter De Gendt
27e36c31b4 scripts: ci: check_compliance: Keepsorted optional stripped characters
Allow passing characters to strip for zephyr-keep-sorted. This can be
useful for optional double quotes in yaml maps.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-07-19 13:23:41 -04:00
Martin Hoff
4d4e6701b8 script: west_commands: silabs: add device type for hostname dev
This commit adds automatic type detection for the dev-id argument and
introduces a device-type option to explicitly tell Silabs Commander how
to handle the dev-id argument. It enables hostname usage for flashing
devices.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-07-19 09:43:43 +02:00
Martin Hoff
3e7b80da3d script: west_commands: jlink: add device type for hostname dev
This commit adds automatic type detection for the dev-id argument and
introduces a device-type option to explicitly tell JLink how to handle
the dev-id argument. It enables hostname usage for flashing and
debugging.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-07-19 09:43:43 +02:00
Tim Pambor
51989cbe0a twister: Fix exception if twister fails to create symlink
This fixes a typo in the formatting code that caused an exception
if the symlink creation failed.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-07-16 16:39:47 -05:00
Anas Nashif
7d3a33afd4 Revert "scripts: Removing init function pointer from check_init_priorities.py"
This reverts commit 653f1bf123.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-16 16:39:36 -05:00
Dmitrii Golovanov
94d9574b0f scripts: footprint: fix hifive1 rev.B board name
Rev B of hifive1 is 'hifive1_revb' since 07e4ba4240

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2025-07-15 17:08:43 -10:00
Patryk Koscik
854e185248 west: spdx: make SBOM generation compatible with Python < 3.12
Avoid f-strings with backslashes for Python < 3.12 compatibility,
which fixes SBOM generation crashes on older Python versions.

Signed-off-by: Patryk Koscik <pkoscik@antmicro.com>
2025-07-14 07:11:46 -10:00
Anas Nashif
dda57865c0 twister: adapt tests for new TestConfiguration class
Adapt test to new test configuration class.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-14 07:11:22 -10:00
Anas Nashif
4d82c48789 twister: make test configuration handling a class
Split test configuration code into own class and do parsing in two steps
to get the right context of platforms and scenarios.

Fixes zephyrproject-rtos/zephyr#89774

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-14 07:11:22 -10:00
Benjamin Cabé
125b23ba02 twister: harness: power: fix amp to milliamp conversion
Fix amp to milliamp conversion where a 10^4 factor was applied instead
of 10^3.
Adjust existing test cases accordingly (including a small change to one
of the expected RMS values in pm.power_states that either changed
since the test was introduced or was set too aggressively back then).

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-11 08:16:58 -10:00
Flavio Ceolin
1de500e89f kconfig: hardenconfig: Add support for insecure option
Treat insecure options in Kconfig options.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-07-10 16:00:26 -05:00
Flavio Ceolin
674fd094aa build: kconfig: Add support for warning insecure features
Add a new promptless Kconfig symbol (INSECURE). This symbols must
be selected by any setting which is used to enable an insecure
feature.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-07-10 16:00:26 -05:00
Emilio Benavente
1142c40c5a scripts: west_commands: runners: Update GDB args
Update gdb arguments to enable linkserver
debugging when app does not reset after load.
This is useful for when the app is loading to
ram. In this case if gdb reset after loaded the
ram would be flushed when debugging and there would be
nothing no image in ram to debug.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2025-07-04 14:20:30 -10:00
Benjamin Cabé
f672cb72d4 Revert "doc: ci: Zephyr now requires Python 3.12 or higher"
This reverts commit 043bb58488.

Note that  scripts/requirements-actions.txt might not be 100% the same
as what was pinned prior to the revert due to it being difficult to
restore previous versions while also accounting for the new dependencies
that were added in the meantime.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-04 15:50:06 -05:00
Benjamin Cabé
daf5584c63 Revert "scripts: Bump Python target version for ruff"
This reverts commit e8caaf4137.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-04 15:50:06 -05:00
Fabio Baltieri
42e8837085 scripts: do_not_merge: wait for manifest before checking
Seems like github relabel rerun is susceptible to race conditions and
may not rerun the label check script if the manifest workflow runs at
the same time.

Delay the check to explicitly wait until the currently checked sha had a
successful manifest run.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-07-03 11:59:56 -05:00
Fabio Baltieri
db18e4c507 scripts: do_not_merge: integrate the empty body check in the python file
No point spreading the logic around, the python file already has the
data, check it there.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-07-03 11:59:56 -05:00
Fabio Baltieri
5b743871b8 scripts: do_not_merge: add some debug prints
Log the PR link and labels, may come in handy for troubleshooting down
the road.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-07-03 11:59:56 -05:00
Mirko Covizzi
5b3a48c063 scripts: requirements-base: pin patool to >=2.0.0
This resolves an issue on MacOS where
`west sdk install` would fail when extracting
a `.tar.xz` package due to the command line
options selected by patool.

Signed-off-by: Mirko Covizzi <mrkcvzz@gmail.com>
2025-07-03 11:54:10 -05:00
Katarzyna Giądła
9b428c8e5f twister: Fix tests statuses if quarantine is verified
If test configuration is not quarantined and `--quarantine-verify`
mode is enabled, these should be filtered and not attached
to reports.

Proposed change applies this approach.

Signed-off-by: Katarzyna Giądła <katarzyna.giadla@nordicsemi.no>
2025-07-01 10:17:53 -05:00
Katarzyna Giądła
bec789d364 twister: Enable gathering footprint if test plan exists
If test plan is used, memory usage metrics are overridden.
Result of this operation is missing memory footprint.

This change removes redundand metrics update and fixes
described inconvenience.

Signed-off-by: Katarzyna Giądła <katarzyna.giadla@nordicsemi.no>
2025-07-01 10:16:32 -05:00
Vignesh Pandian
810536251d scripts: checkpatch: False alarm warning for macros.
Remove false alarm warning of
`braces {} are required around if/while/for/else`
for macro definitions with if/while/for/else.

Signed-off-by: Vignesh Pandian <vignesh@aerlync.com>
2025-06-30 15:20:28 -05:00
Daniel DeGrasse
0b0af06da5 scripts: pylib: fix twister report handling for junitparser >= 4.0.2
With junitparser 4.0.2, the JunitXml.fromfile() now returns a JUnitXml
instance. In order to access the junit.TestSuite instance, we must use
TestSuite.fromelem() to convert it back.

Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
2025-06-27 18:28:50 -05:00
Henrik Brix Andersen
08175f816a scripts: kconfig: functions: add dt_compat_enabled_num function
Add dt_compat_enabled_num Kconfig helper function for counting the number
of compatible nodes with status okay.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2025-06-27 10:07:01 -05:00
Jérôme Pouiller
ca9650134f soc: silabs: siwx91x: Clean output names
The siwx91x need a specific firmware image format. These image end with
.rps extension. The current name of the image is zephyr.bin.rps. However,
the .bin suffix is not relevant. It makes even more sense if we consider
the output of west sign: zephyr.signed.bin.rps. We can simplify these name
by remove the .bin suffix.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-27 10:06:16 -05:00
Jérôme Pouiller
00b3c53704 soc: silabs: siwx91x: Support "west sign"
Silabs siwx91x support signed and encrypted firmwares. This PR includes
support for these features in "west sign"

Co-developed-by: Aasim Shaik <aasim.shaik@silabs.com>
Signed-off-by: Aasim Shaik <aasim.shaik@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-27 10:06:16 -05:00
Tomasz Bursztyka
653f1bf123 scripts: Removing init function pointer from check_init_priorities.py
As the pointer has been removed from struct init_entry, there is no point
to look for it nor to display any information about it (obviously).

Fixing the test script as well.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
2025-06-27 14:13:58 +02:00
Grzegorz Chwierut
c6b3b9342c twister: pytest: Add support for mcumgr go tool with BLE
Added basic support to run upgrade with mcumgr tool
using BLE transport.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2025-06-27 12:21:56 +02:00