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>
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>
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>
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>
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>
The ADI fork of OpenOCD prints a modified version line; adjusting the
regex to account for that different format when checking the OpenOCD
version.
Signed-off-by: Pete Johanson <pete.johanson@analog.com>
The following board revision properties can now be used as part
of the format string in the 'west boards -f ...' command.
- board.revisions with format {revisions}
- board.revision_default with format {revision_default}
Signed-off-by: Alex Fabre <alex.fabre@rtone.fr>
Use the --format flag in git rather than parsing the output of
the git log. The inspiration for this change was that the previous
implementation breaks if there's a ~/.gitconfig that changes the
git log format.
Signed-off-by: John Barbero Unenge <git@lsrkttn.com>
If BB tests failed, crashed, etc., log handles
could linger and crash test cleanup.
Adding log closing to a `finally` section
should prevent those issues.
Loggers should not be set up as globals,
as it makes testing much harder.
Running multiple Twisters may cause for the
logfiles to be still "in use".
When exiting main, close all logfiles
and remove their handlers from all loggers.
Do that for conftest as well.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
Add a `--dry-run` (or `-d`) option to the posix kconfig
migration script for deprecated POSIX Kconfigs.
Additionally, add a set of skipped options (e.g. `TIMER`).
The `CONFIG_TIMER` option does not exist in the tree anymore
and was way too generically named previously, so the false
positive rate is astronomical, so it makes sense to skip it.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Rename the driver from uart_native_posix to uart_native_pty.
Including renaming the DTS compatible, and kconfig options, deprecating
the old ones.
And refactor the driver, generalizing it, so we can have any number of
instances.
Note that, unfortunately generalizing to N instances cannot be done
without a degree of backwards compatibility breakage: This driver was
born with all its configuration and selection of the instances based on
kconfig.
When the driver was made to use DT, it was done in a way that required
both DT and kconfig needing to manually coherently enable the 2nd UART.
This has now been fixed, which it means only DT is used to decide how
many instances are avaliable, and UART_NATIVE_POSIX_PORT_1_ENABLE is
just ignored.
Including:
* Deprecate UART_NATIVE_WAIT_PTS_READY_ENABLE: the options is always on
now as it has no practical drawbacks.
* Deprecate UART_NATIVE_POSIX_PORT_1_ENABLE: DTS intanciation defines it
being available now.
* Rename a few functions and in general shorten pseudo-tty/pseudo-
terminal to PTY instead of PTTY.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
MD5 and SHA1 are not supposed to be used nowadays on security context.
Some ancillary scripts in tree do use them, but for verification only -
or where externally mandated, such the SPDX tool.
This patch marks those usages as `usedforsecurity=False`, which helps
clarify intent.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Calling `west build --build-opt="-v" --build-opt="-j=<n>"`
passes the build options to `cmake --build ... -- <build-opt>` which
again is passed to the native build tool, such as ninja or make.
However, when ExternalProjects are used in CMake, such as in TF-M or
sysbuild builds then those extra build options are only passed to the
first image build and not those build as external projects.
CMake supports environment variables for those flags, so translate
verbosity and number of jobs to those environment variables and thereby
support those flags for all images when specified by the user.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Align with native_simulator's upstream main
3ccb09ec00e291f699219c0e3f5b14b6b1c7ceb6
Which includes:
3ccb09e nsi_errno: Add new API to get the current host side errno
32eab87 Makefile: Ser a macro to distinguish build in runner context
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Rename the driver files, binding and kconfig options, while deprecating
the old binding and kconfig options.
Uses in tree are replaced.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
In order to enable the use case where the underlying flash tool supports
bulk-flashing using multiple device IDs, augment the core runner class
with this new runner capability and implement it in the nrfutil runner,
since the nrfutil tool supports it natively.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This is an extension for indexing the source code in the workspace
with GNU Global. See the command line help for more information about
Global.
Signed-off-by: Martí Bolívar <marti.bolivar@oss.qualcomm.com>
Align with native_simulator's upstream main
20d3b2b76a3bf61d35becbe17928cdf22e885b9f
Which includes:
* 20d3b2b Makefile: Support building C++ files with runner
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Added recently introduced optimizations - generation in string literal form
and faster generation for hexadecimal initializer list form - to gzip path
as well.
Signed-off-by: Irfan Ahmad <irfan.ahmad@siemens.com>
Incremental refactoring.
Fix PEP8 issues to make ruff green for config_parser.py module.
Add __init__.py to twister directory to make it a proper python package,
and make modules importable.
Signed-off-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
Rework of the flashing algorithm broke the STM32N6 dfu flashing.
Add the case of using usb port and download-modifier (new n6 specific
option) as a new case of using the bin file for flashing.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Adds some Kconfigs to the allow list which are used for
demonstration purposes in sysbuild documentation
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Setup logging per process to fix issue on both mac and windows where
handlers are not available to the processes.
Fixes#86237
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This driver was deprecated and must be removed by Zephyr version
4.1 according to lifecycle/release guidelines.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
This change enhances the devicetree library by adding support for tracking
the source filename and line number for nodes and properties.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Fix --download-address to expect a signed.bin file when --download-address
is provided.
To allow testing this case despite the checks put in the runner, add a
patch functions which return that zephyr.bin is actually present
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Aim is to avoid 2 issues:
- Requesting --download-address to flash hex files
- Flashing hex files (non signed) on N6 which works but doesn't allow
persistent firmware
Hence this changes binds --download-address with usage of .bin files.
If --download-address was not provided, default to hex flashing.
File existence done with isfile() will ensure the required file
is available before flashing and report an error if this is not the
case.
Note: In specific N6 case, we're verifying zephyr.signed.bin is
available instead of zephyr.bin. This is ensure since self.cfg.bin_file
matches runners_yaml_props_target configuration (set to
zephyr.signed.bin on STM32N6).
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
native_sim only works and builds on Linux, when running twister on the
Mac, this platform fails to build and reports errors.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Modify the requirements-compliance.txt to exclude python-magic from
windows system installation. On windows, the line:
""python-magic-bin; sys_platform == "win32""" already exists. Adding:
python-magic on windows creates issues where the check_compliance.py
script will either freeze or throw errors related to libmagic.
Signed-off-by: Jacob Wienecke <jacob.wienecke@nxp.com>
Introduce a new command-line option `--keep-artifacts` in twister that
allows users to specify which artifacts should be preserved
during test cleanup in addition to the default set.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Co-authored-by: Anas Nashif <anas.nashif@intel.com>
These files can be useful to troubleshoot a test that's failing,
and they're really small, too.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
NOTE: Even though previous commits indicate, that this can only happen on
MacOS, that's actually not true. It happens on Linux as well.
The constructor of `psutil.Process` can throw an exception as well, so we
need to wrap the whole loop in another try, unfortunately.
Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
While it doesn't cause any issues, it's more consistent and makes future
commits which add handling for more exception types more readable.
Based on: 0df8240b49
Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
Problem
-------
Board & SoC extensions are used to define out-of-tree board variants or
SoC qualifiers. When a board is extended, it has multiple directories
associated with it (each with its own `board.yml`), where twister should
be able to find additional platform files to support these qualifiers.
Currently, this doesn't work, because twister only traverses the primary
BOARD_DIR and ignores the rest.
The fix would've been trivial in the case of "legacy" platform files,
i.e. those of the form `<normalized_board_target>.yaml`, but it's less
straightforward for the newly introduced `twister.yaml` format.
A `twister.yaml` file contains platform configuration that can be shared
by multiple board targets and tweaked for specific targets by using the
top-level `variants` key. Normally, there is at most one `twister.yaml`
per board, but the file isn't necessarily unique to one board. Instead,
it's unique to one directory, which may define multiple boards (as is
the case with e.g. `boards/qemu/x86/`).
With extensions in the picture, the goal is to initialize platforms when
given multiple `twister.yaml` per board. The OOT files are expected to
only provide information about OOT board targets, without being able to
override in-tree targets (same principle as in the Zephyr build system).
Solution
--------
The `twister.yaml` handling is broken up into multiple passes - first
loading all the files, then splitting the `variants` keys apart from the
shared configuration, before constructing the Platform instances.
The purpose of the split is to treat the variant information as global,
instead of making unnecessary or faulty assumptions about locality.
Remember that the build system can derive board target names not only
from `board.yml`, but from `soc.yml` too. Considering that any board may
end up using an OOT-extended SoC (and hence multiple `soc.yml` files),
not every board target can be said to belong to some board dir.
Unlike the variant data, the remaining top-level config is still rooted
to the primary BOARD_DIR and inherited by the extension dirs from there.
This is quite intuitive in most imagined cases, but there is a caveat:
if a `twister.yaml` resides in an extension dir, then it is allowed to
have a top-level config of its own, but it will be silently ignored.
This is to support corner cases where, much like how a single board dir
can define multiple boards, a single board dir can also extend multiple
boards, or even do both. In those cases, the primary BOARD_DIR rule
should make it unambiguous which config belongs to which board, even if
it may seem counter-intuitive at first.
For concrete examples of what this means, please see the newly added
platform unit tests.
As part of these functional changes, a good chunk of logic is moved out
of `TestPlan.add_configurations()` into a new function in `platform.py`.
This is because recombining the top-level and variant configs requires
direct manipulation of the loaded YAML contents, which would be improper
to do outside of the module responsible for encapsulating this data.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Allow user to add shell commands in testcase/sample yaml file
alongside the harness_config like in the console harness.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Fixes using the wrong path for checking if disallowed Kconfigs
are present, to use the zephyr base instead of the git top level
folder which caused issues for downstream manifests
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>