There might be situations where people are running the coreutils version
of stty on macOS, hence the need for being smarter at detecting when
that might be the case
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The runnable output from the build system is the
exe file. In native_posix the elf happend to also be
runnable, but this is not the case in general,
and not for native_sim or the nrf5*bsim boards.
So lets use the exe instead.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add the exe fle to the runnerconfiguration class,
so we can use it from runners which will need it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
PR #63195 has managed to change code under test without
triggering those tests.
This change should remedy that by creating a new workflow,
based on twister_tests.yaml, that runs tests in
scripts/tests/build_helpers if build_helpers are modified.
Such a workflow should be easily extendable if we ever have more
non-Twister things to test in scripts/pylib.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
PR #63195 has changed how Domains work without
triggering necessary tests, thus breaking them.
This commit fixes the domains tests.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
If flash_order were to be missing from the YAML, the Domains init
would crash instead of substituting an empty list.
This commit fixes that.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
Fix the correct path to net-tools directory.
Also default to Bash instead of /bin/sh as we use
Bash syntax.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Currently, the following macros will only work for 0 - 255:
- `IS_EQ`
- `UTIL_X2`
- `UTIL_INC`
- `UTIL_DEC`
- `LISTIFY`
This patch increases their limit to 4095.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
By requiring a full-on YAML fragment, the Domains class can rely on
pykwalify to do the heavy lifting with validating types and structure.
Remove support for loading domains from a dictionary, so that we don't
ever have to replicate the same checks on the input, and we can instead
have a single entry point.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Do extra checks to reject inconsistent `domains.yaml` contents early:
default: app
build_dir: /path/to/build
domains:
- name: image_1
build_dir: /path/to/build/image_1
- name: image_2
build_dir: /path/to/build/image_2
flash_order:
- image_1
- image_2
- unknown
This example lists "image_1" and "image_2" as known domains, but an
entry for the default "app" is missing, which should never be allowed.
A valid `domains.yaml` file shall also not contain extra domains under
`flash_order`, such as "unknown", which doesn't appear under `domains`.
Either of these cases can now be caught while initializing an instance
of the Domains class.
It follows that a valid `domains.yaml` file must always contain a list
of domains with at least one entry - the default image. Since `default`
is a required key in the YAML schema, `domains` should be required too.
Thus, empty lists will be rejected by pykwalify, so the questionable
warning for "no domains defined; this probably won't work" can be axed.
Fixes#63166
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
When using a quarantine file with more than 512 unique
entries, than time of matching quarantine increases
significantly. This is because regexp cache size is
512. Add precompiled regexp entries to the quarantine
as a fix.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
All handlers except QEMU were right-stripping console lines before
checking them. In certain cases where the regex is expecting the
whitespace, this could make the test fail on qemu when it is passing
on something else. Change QEMUHandler to us .rstrip instead of .strip()
Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
The network core needs to be recovered first due to the fact that
recovering it erases both the network and application cores' flash
memory. This means that the little flash image that is programmed during
the recover operation would be lost for the app core if we inverted the
order.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
In PR #62947 a timeout variable was replaced with a method,
but this timeout was used in another place to start
pytest subprogram. This commit provides a fix.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
This provides miscellaneous quality of life improvements:
- We couldn't use dataclasses when this class was originally written.
We can now, so move to dataclass to avoid having to write
__repr__().
- Add missing validation for the advertised commands
- Add missing documentation for the 'file' capability
Signed-off-by: Martí Bolívar <mbolivar@amperecomputing.com>
Test suites names are not being handled uniformly for tests not
in zephyr tree. Their names depend on -T arg used in twister's CLI.
The newly added options allow to select if twister should add paths
to suite names. This is needed if test plans are to be used for tests
outside of zephyr tree.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
"Path" is a path (relative to zephyr) to a directory with test suite's
definition. Such entry helps to locate a given test.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Domain module was not yet covered by explicit unit tests.
This commit adds a new test file to cover that gap.
It achieves 100% coverage at the time of creation.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
In test-only mode with a hardware map, all tests with fixtures were
skipped, even when the hardware map has appropriate fixtures defined.
TestPlan.load_from_file had the check for fixtures missing, but actually
best is that the TestInstance checks the fixtures in the hardware map.
Signed-off-by: Manoel Brunnen <manoel.brunnen@ithinx.io>
Twister allows us to control maximum execution time for each test
with timeout value in test's .yaml configuration and
platform level timeout multiplier which allows us to tweak
timeout value for specific platform.
However, sometimes we want to additionally adjust tests timeouts
when running twister. This is especially useful in case of
simulation platform as simulation time may depend on the host
speed & load, we may select different (i.e. cycle accurate but
slower one) simulation method, etc...
Let's introduce global (twister-level) timeout multiplier option.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
There is clearly an issue with current timeout value
timeout into mocked_instance as this value is used only
once before this mock happen, so this mock is actually useless
and we always use default value. Fix that.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
The experimental status of the PPP L2 is long overdue so
it can be removed as the component is working fine.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
The west bindesc command currently crashes when no subcommand is
given. This is because the subcommand was not marked as required.
This commit fixes the issue.
Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
Some of the runners in the tree have been adding their own,
class-specific versions of a switch to instruct the runner to reset or
not the device after flashing.
In order to better support multi-image builds that require more than one
flash operation, introduce a new --reset,--no-reset command-line
parameter that is part of the RunnerCaps so taht this functionality can
be accessed in a standardized manner.
Implementations for the new parameter are provided for the runner
classes that were already configurable in this regard.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Added the bindesc command to west, for working with binary
descriptors. Currently it supports dump, list and search
subcommands, for bin, hex, elf and uf2 file types.
Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
This adds support for using coredump with Xtensa DC233C core,
which are being used by qemu_xtensa and qemu_xtensa_mmu.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Adds a test for the data sharing retention feature of MCUboot
configuration to an application.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Adds a bootloader configuration interface which allows for a
bootloader (e.g. MCUboot) to set configuration in a shared data
area which is then read by the application.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
The recent support for BUILD_ONLY images was implemented by excluding
them from `domains.yaml`, in order to crudely prevent them from being
picked up by `west flash`. Arguably, this is incorrect or unexpected,
because the sysbuild documentation defines a "domain" as:
Every Zephyr CMake build system managed by sysbuild.
Another consequence is that, given a build-only `<image>`, this makes it
impossible to pass `--domain <image>` to `west flash`, `west debug`, and
ironically `west build`.
To fix that, `domains.yaml` should again represent all domains, and the
build-only ones should be indicated in another way. Enter `flash_order`:
a new top-level key in the domains YAML schema. It contains the default
sequence of images used by `west flash`, where the build-only images are
excluded, and the order is influenced by `sysbuild_add_dependencies()`.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Added application based on SMP Server Sample. Application is built together
with MCUboot using sysbuild and is flashed onto device in one step.
Tests are automated with pytest - new harness of Twister.
The image for upgrade is prepared using west sign command
then is uploaded by mcumgr into device and tested.
Automated scenarios to test upgrade (image upload, test, revert, confirm),
to test downgrade prevention mechanism and to test upgrade with image,
that is signed with an invalid key.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Add support for setting reviewers as well for module PRs, in addition to
the assignees.
Note that this still only works on repositories with an assignee on
record since it does not seem to be possible to query for PRs that have
no reviewers.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Currently, when a Robot test is run, the test case status value is
reported as `None`, which causes the XML to contain information about
the test being skipped due to misconfiguration.
This commit fixes the value reported in Twister XML test result by
assigning the test result to the `status` variable of a testcase
instance after the test has finished running.
Signed-off-by: Franciszek Pindel <fpindel@internships.antmicro.com>
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
The C standard specifies 'hh' as a length modifier indicating an integer
conversion specifier applies to a signed char or unsigned char
argument. Python doesn't do that, so replace relevant %hh with %h.
Also fix the handling of %ll so that it applies to all integer specifiers
as well.
Signed-off-by: Keith Packard <keithp@keithp.com>
Bump number of cores limit in mdb west runner.
As we are here - adjust core number in runner test closer to
the limit.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
This is coming from devicetree and corrosponds to what we have in the
dts/bindings/vendor-prefixes.txt file.
This will allow for static filtering, especially with twister, i.e. no
need to build anything to know the vendor of a board
All of the vendor data was extracted automatically from the devicetree,
so some platforms might not have the right vendor or no vendor at all
right now, we need to fix some of the DTS information or do this
manually to get this 100% correct. But we are close.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add a new option --vendor which allows filtering by vendors tracked in
the board/platform yaml file. The vendor string is compatible with DTS
and is what we have in dts/bindings/vendor-prefixes.txt.
Providing multiple vendors is also supported.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
We don't need to have two different sets of Zephyr-specific default
values overriding one another, it's confusing.
Note this commit makes NO functional change, the effective defaults stay
the same. It does however make it easier to change defaults in the
future.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Rework check_init_priorities to use the main executable file instead of
the individual object files for discovering the devices.
This should make the script more robust in case of stale files in the
build directory, and also makes it work with LTO object files.
Additionally, keep track of the detected init calls, and add a handy
"-i" option to produce a human readable print of the initcalls in the
call sequence, which can be useful for debugging initialization problems
due to odd SYS_INIT and DEVICE interactions.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Only impacts on twister-pytest scenarios. Exec command is waiting for
the prompt message, but in some cases, e.g. after reseting the DUT, prompt
can be followed by another strings. Solution is to clear internal serial
buffer and to not request the prompt string before executing a command.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Sometimes you might need exec_command() to return an value from
running device. If the output contains shell prompts or logger
output, it is harder to capture the value.
Filter away the lines we thing belongs to the shell prompt or
normal logging output.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Skips are turned to errors on integration platforms. However, if
a user (or a CI) selects toolchain other than zephyr, unexpected
errors due to skips can appear. With this commit skips due to
toolchain incompatibilities are not treated as errors.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>