Optionally record run-id and run-attempt github context variables
as additional test suite environment properties on upload into
ElasticSearch to track re-runs of CI workflows.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
'buffer' argument is read only, so it can be 'const'. This makes it
compatible with POSIX specification of write(3) syscall.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Align with native_simulator's upstream main
f02906708cf1668fe54ef2c2f1e159ed947573aa
Which includes:
* f029067 CPU ctrl: Fix two malformed error/warning messages
* 114f78b Host trampolines: Fix typos in comment
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add integration_platforms to the list of the default platforms per test
for improved coverage when not running in integration mode.
Some tests when run without any option do not exercise any tests and
skip the integration platforms completely.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Enhance the -s option of twister, used to point to a single scenario in
a testsuite.
- Now accept --scenario on the command line, --test still supported.
- If no testsuite is provided, extract testsuite from scenario
identifier and avoid parsing the whole tree if we only want to address
one scenario in a testsuite.
- If just the identifier of the scenario is provided to
--test/--scenario option, try to find this as well, do not need the
full path for that.
Something like this is now possible:
twister --scenario kernel.threads.init --list-tests
twister -T <path> --scenario kernel.threads.init --list-tests
twister -T <path>/kernel.threads.init --list-tests
All should print the same output.
Fixes#67307
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
According to the Zephyr documentation, the multi-level interrupts
are encoded as follows:
`L1_ID | ((L2_ID + 1) << L2_BITS) | ((L3_ID + 1) << (L3_BITS + L2_BITS))`
This means that when L3 interrupts are enabled, the gen_isr_table.py
script will receive the value of L2_ID + 1. Currently, the script
takes this value and directly compares it with the offsets set via
`CONFIG_3RD_LVL_INTR_xx_OFFSET`. This is wrong because the values from
said configurations are the same as L2_ID and because of that the
script will generate an error. To fix this, use the value of L2_ID
instead of L2_ID + 1.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Binaries are located in multiple build directory subfolders when built for
multiple domains (sysbuild is one example). Parse domains.yaml and preserve
files across all domains for testing when --prep-artifacts-for-testing
option is used.
Signed-off-by: Mike Szczys <szczys@hotmail.com>
Resolves incorrectly located `image_ok` tag in generated hex files when
CONFIG_MCUBOOT_GENERATE_CONFIRMED_IMAGE is used.
Fixes#64098
Signed-off-by: Abram Early <abram.early@gmail.com>
Updated the instance with the device id to have it in the summary
report also when using pytest harness.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
This commit moves all the functionality related to the current
interrupt parser into gen_isr_tables_parser_carrays.py file.
The new parser file gen_isr_tables_parser_local.py file is
implemented with the new parser that.
Additional information added to the generated interrupt header
that contains data required by the new parser.
Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
This commit breaks the code into functional classes.
This way the functionality is visibly splitted into
functional parts and it is easier to replace the
specific parser part to implement new code generators.
There is also common functionality to handle multi level interrupts
moved to configuration class.
Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
This commit cleans up the gen_isr_tables code for better clarity
and easier modification.
Changes include:
- Separate functions to load intList section.
- Replace spurious handlers in internal data with None.
Now it is the output generator work to choose right function.
- All the work to generate vt and swt separated into its own functions.
- Remove the need for internal shared array - all the information
is here in swt array.
- The update_masks function - more functionality moved here.
- Simplify bit_mask function.
Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
On the hardware, after booting up the device, on the
console might appear additional logs after receiving first
prompt. Wait and clear the buffer to avoid unexpected
messages when verifying output.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
dt_chosen_partition_addr_int|hex allow obtaining the absolute address of
a partition, which is the result of the grandparent node address plus
the partition node address.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Add basic support to flash application and/or radio core for nRF54H
series. Note that features like merged hexes present in nRF53 series is
not supported.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
On some new SoCs, the erase option is not required, so introduce a new
option that doesn't set any erase mode.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Using ztest predicate feature, testcases are skipped, however, the skip
is only reported as part of the summary and not through normal
execution. Until now such tests were reported as blocked or had a null
status in the twister json output.
This changes will look into summary results and use them to confirm
parsed results and add any missing results that either were not reported
or not captured through the serial console.
The issue can be observed with the drivers.can.api test for example on
the frdm_k64f board.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
uicr_ranges dictionary entries did not contain the `_FAMILY` suffix, now
used by self.family variable, resulting in an always false check.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
As saving tests writes to file, rather than appending to it,
we should indicate that in the --save-tests help.
--load-tests help changed so its grammar is the same as --save-tests's.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
When pytest harness test is run on harware, messages sent from target
right after application start-up are lost, because connection to COM
port is not established yet. It can cause unexpected
behavior of a test. Fix it by flashing and running application after
connecting to COM port when testing on hardware.
Signed-off-by: Michal Smola <michal.smola@nxp.com>
Import of pty module causes exception when pytest harness is used
for device testing on Windows. Fix it by importing pty module
on non-windows hosts only. Add logger message for case pty
is used by mistake on Windows.
Signed-off-by: Michal Smola <michal.smola@nxp.com>
Comparisons that have constants on both side of the operator
were getting flagged incorrectly. Adjust the check so that
pure constant comparisons are not flagged, reducing false
positives.
WARNING:CONSTANT_COMPARISON: \
Comparisons should place the constant on the right side of \
the test
+BUILD_ASSERT(CONFIG_MAX_PTHREAD_COUNT == \
CONFIG_MAX_PTHREAD_MUTEX_COUNT - 1);
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Building the HEX file is optional (CONFIG_BUILD_OUTPUT_HEX), so
`bmp_flash` will fallback to elf_file if missing. Additionally, to
maintain section names the HEX is only used if it is signed.
Signed-off-by: John Whittington <git@jbrengineering.co.uk>
The cfg.elf_file is not signed, so `west flash` with a sysbuild will
not run the application if MCUboot image signature checking is on. Using
the cfg.hex_file for `bmp_flash` resolves since as the signed hex is
used when using sysbuild. Symbols are not required for flashing so the
switching from elf to hex is not an issue.
Signed-off-by: John Whittington <git@jbrengineering.co.uk>
clear_log is used to prevent a common pytest log error,
which makes logs unusable in testing.
Such a fix is useful for all tests,
so it should be autouse by default.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
This constant is supposed to be defined as a long instead of an int,
presumably to support systems where int isn't large enough.
Signed-off-by: Keith Packard <keithp@keithp.com>
If people are using the zcbor script for code generation, it needs to be
at the latest version
Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
clear_log is used as a fixture by pytest. We need to be able to call
it from the code level. Example of use in the file
test_harwaremap.py line 157.
Signed-off-by: Paszkiet Kamil <kamilx.paszkiet@intel.com>
Update helper method used by pytest fixtures. Extended upload
method with 'slot' parameter. Added searching of uploaded images
that can be tested or confirmed.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Currently it is tedious to know the level of an interrupt for
a node in C. One would have to go through a very complex and
error prone macros to check if there's a parent interrupt
controller & if the controller has an interrupt number and thus
not a pseudo interrupt controller like the one found in
`rv32m1`. The level of a node is required to encode the
Zephyr's multi-level interrupt number
Since it is easier to do it in the `gen_defines` script, let's
do the heavy lifting there so that we can introduce new DT
macros to get the interrupt level very easily later.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
When using direct isrs, a vector table is needed. However, if none is
present , i.e. `CONFIG_GEN_IRQ_VECTOR_TABLE=n`, this script failed. The
given error message was not helpful (`'NoneType' has no len()`).
This change makes it clearer, where to look for the problem.
Signed-off-by: Greter Raffael <rgreter@baumer.com>
When twister is run on Windows with --short-build-path option, mklink
fails to create link, because path to build dir contains forward
slashes, which are not handled correctly by mklink.
Fix it by using os.path.normpath in mklink call.
Added os.path.join mock in twister unit test to handle path join
consistently.
Signed-off-by: Michal Smola <michal.smola@nxp.com>
Currently, the noclearout pytest mark generates warnings because
it is not registered.
This commit adds its registration in the relevant conftest.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
Automatically populate the snippet roots from Zephyr modules, instead of
only looking in `ZEPHYR_BASE`.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Rather than duplicating the same schema, define it only once and reuse
for both common section and tests section.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Extend the gen_defines.py write_interrupts(node) function to
generate macros to get the interrupt controller for an
interrupt specifier by idx and by name.
The information is already generated by edtlib.py and stored in
node.interrupts[].controller. This addition uses the node pointed
to by the controller member to generate the following example output
define DT_N_S_device1_IRQ_IDX_0_CONTROLLER \
DT_N_S_gpio_800
define DT_N_S_device1_IRQ_NAME_test4_CONTROLLER \
N_S_device1_IRQ_IDX_0_CONTROLLER
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>