Commit graph

1468 commits

Author SHA1 Message Date
Guennadi Liakhovetski dbea13a1c7 llext: fix read-only extension image
When using the LLEXT buffer loader we now avoid copying extensions
from storage to allocated memory by pointing directly into the stored
image. We then also perform linking and relocation in that memory,
which modifies its contents. However, this is impossible if that
storage is read-only. Add a Kconfig flag to distinguish between
writable and read-only storage types. Also use that flag to decide,
whether the extension image in test_llext_simple.c should be defined
as const or not.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-12-01 10:08:12 -05:00
Guennadi Liakhovetski b9bdae8c07 llext: add support for exporting symbols from extensions
Extensions should be able to selectively export their global symbols.
Add a LL_EXTENSION_SYMBOL() macro for that. Change the present
.sym_tab to be a temporary symbol table of all global symbols in an
extensions, used only during linking for internal purposes. Add a new
.exp_tab symbol table to store symbols, exported by an extension
permanently.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-12-01 10:08:12 -05:00
Guennadi Liakhovetski a2acd7b2fb llext: add reference counting
Extend the llext_load() / llext_unload() API to let it be called
repeatedly for the same extension to increment or decrement its
reference counter respectively. We use a mutex to protect the counter
and make both llext_load() and llext_unload() return the use-count to
let the caller identify when the first loading and the last unloading
took place.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-12-01 10:08:12 -05:00
Guennadi Liakhovetski e5c8d181d4 llext: add Xtensa test support
Add support for running a modular "Hello world" example on Xtensa.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-12-01 10:08:12 -05:00
Guennadi Liakhovetski b0b4b0baa0 llext: make local relocations optional
Some applications can decide to link their loadable objects for
exactly the same addresses, where they will be loaded. In those cases
local relocations aren't needed any more and can in fact break the
object if applied while the object is in a temporary storage. Add a
parameter to skip such local relocations.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-12-01 10:08:12 -05:00
Alberto Escolar Piedras f981bf2fa0 tests/subsys/*: Switch integration platform to native_sim
Swith integration_platforms from native_posix(_64)
to native_sim(_64).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras 0f5a0327e6 tests/subsys/canbus/isotp/conformance: Replace native_posix in comment
Replace native_posix with native_sim in a comment.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras 345c25659c tests/subsys/bindesc/definition: Enable for native_sim
Enable bindesc.define also for native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Fabio Baltieri c8f4455ef8 tests: input: api: dedup some test properties
Move some common properties in the common field.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-30 10:19:42 +00:00
Rodrigo Peixoto 2fa6a440ae tests: zbus: replacing K_NO_WAIT with K_FOREVER in integration tests
The zbus_chan_read with K_NO_WAIT was generating a fail in the
qemu_riscv32_smp board. This fix replaces the K_NO_WAIT with a K_FOREVER
on the test, which would not affect the test execution for other
platforms/boards.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2023-11-29 19:51:13 +01:00
Keith Packard 9f703b88f9 tests/log_output: Avoid printf stack overflow with old picolibc
Before picolibc version 1.8.5, the only version of printf available with
long long output support was the version including full support for
floating point numbers and positional parameters. That version uses more
stack space than the limited version causing an overflow.

Increase the ztest stack space by 128 bytes.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-11-28 15:32:12 -05:00
Carlo Caione 9025789064 tests: Add test for the memory allocator
Add a new test for the attribute-based memory allocator.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-11-27 19:56:48 +01:00
Alberto Escolar Piedras b51f0ee4cd tests/subsys/testsuite/fff_fake_contexts: Enable for native_sim
Enable this test which runs in native_posix_64 in native_sim,
Switch from native_posix_64 to native_sim_64 as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-27 16:06:42 +00:00
Alberto Escolar Piedras 2231c3ab97 tests/subsys/usb/*: Enable for native_sim
Enable all these tests which run in native_posix in native_sim,
Switch from native_posix to native_sim as default test platform
And switch native_posix overlays to native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-27 16:06:42 +00:00
Alberto Escolar Piedras 1d64f1b397 tests/subsys/openthread: Enable for native_sim
Enable these test which run in native_posix in native_sim
Switch from native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-27 16:06:42 +00:00
Alberto Escolar Piedras e628a5b9d0 tests/subsys/logging/*: Enable for native_sim
For all tests which were enabled for native_posix
enable them also for native_sim.
For those with native_posix as integration_platform,
set native_sim instead.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-27 16:06:42 +00:00
Alberto Escolar Piedras aa683e2a8b tests/subsys/logging/log_backend_fs: Simplify and enable for native_sim
* Simplify the test definition by using an EXTRA DTC overlay
  so we don't need one test per board
* Move native_posix overlays to native_sim
* Switch the default integration platform to native_sim
  from native_posix

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-27 16:06:42 +00:00
Alberto Escolar Piedras bf937b0d92 tests/subsys/mgmt/mcumgr/*: Switch to native_sim
Enable all these tests which run in native_posix in native_sim,
For those with native_posix as default test platform,
which it to native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-27 16:06:42 +00:00
Alberto Escolar Piedras bb090128f6 tests/subsys/mgmt/ec_host_cmd/*: Enable for native_sim
Enable these test which run in native_posix in native_sim,
And set native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-27 16:06:42 +00:00
Alberto Escolar Piedras c47702cb7e tests/subsys/shell/shell_flash: Enable for native_sim
Enable this test which runs in native_posix in native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-27 16:06:42 +00:00
Alberto Escolar Piedras 617616888f tests/subsys/bindesc: Enable for native_sim
Enable these tests which run in native_posix also in native_sim,
And add native_sim as default test platform.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-27 16:06:42 +00:00
Alberto Escolar Piedras 8d6421df04 tests/subsys/emul: Enable for native_sim
Enable this test which runs in native_posix in native_sim,
Switch from native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-27 16:06:42 +00:00
Bjarki Arge Andreasen bec7789862 tests: modem: backend: uart: Add fixture to test suite
Add fixture to test suite to allow for and signal that the test
must be run on real hardware.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2023-11-27 12:18:19 +00:00
Juliane Schulze eeb6bf7dd9 input: make short-inputs optional
By making short inputs optional, the user can bypass short-events all
together if necessary (e.g. custom button-press listener).

Signed-off-by: Juliane Schulze <juliane.schulze@deveritec.com>
2023-11-23 09:51:57 +00:00
Krzysztof Chruściński c143daf98d tests: logging: log_backend_uart: Disable backends other than UART
Test expects that there are no other backends enabled and some
may be enabled by default.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-11-23 10:02:45 +01:00
Fabio Baltieri 5efa5b2892 tests: drop input_ prefix from input tests
These are already in a "input" subdirectory, the prefix is redundant,
drop it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-22 23:22:38 +00:00
Alberto Escolar Piedras 6d762359a5 tests/subsys/storage/*: Switch to native_sim
Enable all these tests which run in native_posix in native_sim,
Switch from native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:54:03 +01:00
Alberto Escolar Piedras f59c9c0dde tests/subsys/input/*: Switch to native_sim
Switch from native_posix to native_sim as default test platform
And switch overlays to native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:54:03 +01:00
Alberto Escolar Piedras 13b7557fe1 tests/subsys/modem/*: Switch to native_sim
Enable all these tests which run in native_posix in native_sim
And add native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:54:03 +01:00
Alberto Escolar Piedras 1a2fc865d2 tests/subsys/fs/*: Switch to native_sim
Enable all these tests which run in native_posix in native_sim,
Switch from native_posix to native_sim as default test platform
And switch native_posix overlays to native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:54:03 +01:00
Alberto Escolar Piedras b39d7c2c3d tests/subsys/pm/*: Switch to native_sim
Enable all these tests which run in native_posix in native_sim,
Switch from native_posix to native_sim as default test platform
And switch native_posix overlays to native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:53:54 +01:00
Alberto Escolar Piedras 81179bcd63 tests/subsys/mem_mgmt/mem_attr: Switch to native_sim
Enable native_sim for this test.
Switch from native_posix to native_sim as default test platform

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:53:20 +01:00
Alberto Escolar Piedras 3d702e6ffa tests/subsys/dfu/*: Switch to native_sim
Switch from native_posix to native_sim as default test platform
And switch overlays to native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:53:20 +01:00
Alberto Escolar Piedras b7fa935a0d tests/subsys/settings/functional/*: Switch to native_sim
Enable native_sim for these tests (platform_allow filter)
Switch from native_posix to native_sim as default test platform
And switch overlays from native_posix to native_sim

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:53:20 +01:00
Alberto Escolar Piedras f27760ab47 tests/subsys/settings/file: Switch to native_sim
Switch from native_posix to native_sim as default test platform
And switch overlays to native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:53:20 +01:00
Alberto Escolar Piedras 3692675dcf tests/subsys/settings/fcb: Switch to native_sim
Switch from native_posix to native_sim as default test platform
Switch overlays from native_posix to native_sim.
And move overlays into a boards/ directory

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-22 09:53:20 +01:00
Keith Packard 1dc6279d12 tests/subsys/logging/log_backend_uart: Reduce printf size
When using picolibc before 1.8.5, the only way to get 'long long' support
was to use the full version, including floating point support. This is too
large for this testcase.

Reduce the size of the printf code by switching to the version without
64-bit integer support. This allows the test to pass when using older
picolibc versions, such as that included with SDK version 0.16.3.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-11-21 21:43:33 +01:00
Dawid Niedzwiecki e6c7a4c968 tests: pm: add soc pm tests and sample for stm32f4x chip
Add soc power management test and blinky sample for the nucleo_f429zi
board.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-11-21 08:46:17 +00:00
Dmitrii Golovanov 23324fc5ba boards: qemu_xtensa: coredump: Enable coredump
Enable coredump on qemu_xtensa and qemu_xtensa_mmu.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-11-20 10:51:35 -06:00
Dmitrii Golovanov 5ed8bb74d4 tests: coredump: Adjust logging backend patterns to xtensa
Adjust tests/subsys/debug/coredump logging backend's output
matching pattern to Xtensa fatal errors handler's call sequence
difference.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-11-20 10:51:35 -06:00
Bjarki Arge Andreasen d3f100355f tests: modem: backends: uart: Add UART backend test suite
The UART backend test suite performs 9 iterations of:

1. Open UART backend pipe
2. Transmit 8192 bytes of pseudo random data
3. Receive and validate bytes
4. close UART backend pipe

The test is run on real hardware, with the TX/RX pins
connected to each other to provide loopback functionality.

The test suite has been run on a STM32 and an nRF5340 board.
The test suite tests both the UART interrupt driven and
async APIs.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2023-11-20 13:03:08 +01:00
Lucas Tamborrino 16629cbabd tests: coredump: Remove matching pattern
On xtensa architectures the string "ZEPHYR FATAL ERROR"
comes after the coredump itself. The ordered regex will
incorrectly fail for this arch.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-11-16 09:30:19 +01:00
Yong Cong Sin f5a27bcfe3 tests: logging: uart: increase test coverage
The test should work on any boards with UART console, so
increase the test coverage by adding `CONFIG_UART_CONSOLE`
filter and using `qemu_x86` as `integration_platforms` instead
of `platform_allow`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-11-14 12:26:48 -05:00
Dat Nguyen Duy 18a0660be0 samples/tests: skip samples/tests disable MPU for s32ze series
On SoC series s32ze, Zephyr application cannot run with MPU
disabled, skipping relevant samples/tests

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-11-13 09:48:43 +01:00
Dmitrii Golovanov 4d394f9d23 tests: coredump: Fix backend.logging test misconfig
The debug.coredump.backends.logging testcase did use 'console'
Twister harness whereas the test suite itself and the rest of
the testcases are implemented as Ztest. This misalignment
allowed to check basic output expected from the logging backend,
but caused inconsistency of the test suite results because
the 'console' Twister Harness can't use test cases' ID provided
by the 'Ztest' Twister Handler.
It is decided to focus the debug.coredump.backends.* suite
on the coredump backend API testing with Ztest.
The logging backend's resulting output should be tested
by its dedicated test suite debug.coredump.logging_backend
(tests/subsys/debug/coredump).

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-11-13 09:48:22 +01:00
Dmitrii Golovanov 1032fe3b5c tests: coredump: Extend backends test coverage
Extend coredump_backend tests:
 * fix COREDUMP_CMD_VERIFY_STORED_DUMP test was not executed.
 * add tests for these coredump commands:
   - COREDUMP_QUERY_GET_STORED_DUMP_SIZE,
   - COREDUMP_CMD_INVALIDATE_STORED_DUMP,
   - COREDUMP_CMD_ERASE_STORED_DUMP,
   - COREDUMP_CMD_CLEAR_ERROR.
 * extend the out-of-the-treee example 'empty' backend to
   execute the new tests.
 * fix the test's cmake project name.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-11-13 09:48:22 +01:00
Jamie McCrae 1855fd16f7 tests: mgmt: mcumgr: Add os_mgmt_datetime test
Adds a test which tests datetime set/get and hook callbacks

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-13 09:48:13 +01:00
Yong Cong Sin 6d9fcd83a9 test: logging: add testcase for multi-instance log backend uart
Add testcase for the multi-instance log backend uart using
emulated uart.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-11-13 09:47:06 +01:00
Yong Cong Sin b89095cf12 tests: logging: log_syst: set backend ctx to its cb ctx when enable
Set the backend's context to its control block's context
instead of NULL when doing `log_backend_enable`, as the log
backend UART uses that later.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-11-13 09:47:06 +01:00
Dmitrii Golovanov c88a7b659b tests: coredump: Extend matching patterns
Extend test matching patterns and fix cmake project name.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-11-10 10:40:33 +01:00
Dmitrii Golovanov 3a95c78545 tests: coredump: Enable code coverage
Enable code coverage for debug.coredump.logging_backend test.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-11-10 10:40:33 +01:00
Emil Obalski 25a0489d62 tests: ipc: Add pbuf unit tests
Add unit tests for packed buffer.

Signed-off-by: Emil Obalski <Emil.Obalski@nordicsemi.no>
2023-11-09 10:18:37 +00:00
Daniel DeGrasse 6a31ed50b8 tests: add test for SDIO subsystem
Add test to verify SDIO subsystem. Note that due to the nature of SDIO
cards, this test only reads from common registers and does not verify
extended reads or writes.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-11-06 19:01:08 -05:00
Huifeng Zhang 0be647ccaa boards: fvp_baser_aemv8r_aarch32: Add fvp_baser_aemv8r_aarch32_smp board
This commit add a new board named 'fvp_baser_aemv8r_aarch32_smp'

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-11-06 15:32:01 -06:00
Henrik Brix Andersen 5d5249d85b drivers: can: unify spelling of CAN Flexible Data-rate abbreviation
Unify spelling of CAN Flexible Data-rate abbreviation to "CAN FD" instead
of "CAN-FD". The former aligns with the CAN in Automation (CiA)
recommendation.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-11-01 11:17:17 +00:00
Arkadiusz Cholewinski 6304e9a302 PM: add device_on_power_domian testcase.
Add test case to increase code coverage of device.c file.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2023-10-31 08:58:21 +01:00
Krzysztof Chruściński a33fff38ae tests: logging: log_benchmark: Fix integration platform
Userspace test was using native_posix which does not support
userspace. Change to qemu_x86.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-10-30 10:15:49 -04:00
Benedikt Schmidt aa25e212d1 tests: fix thread function signatures
Fix thread function signatures to avoid stack corruption on thread exit.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-10-30 12:24:34 +01:00
Yong Cong Sin a068288091 shell: add new APIs to get the backend instances
Added some new APIs to get the backend instances more easily,
so that dev does not need to rely on `shell_backend_*_get_ptr`,
which looks more like a hack to access a local variable.

These APIs are basically copied from the log backend
implementation.

Added testcase for the APIs.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-10-25 09:57:29 +02:00
Keith Packard 565c9376f1 tests: Switch from NEWLIB_LIBC to REQUIRES_FULL_LIBC
Instead of forcing use of NEWLIB_LIBC, select any available complete C
library implementation. Add CONFIG_REQUIRES_FLOAT_PRINTF where needed.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-10-25 08:32:06 +02:00
Alberto Escolar Piedras 4e55c482ba tests/subsys/rtio: Exclude some subtests from posix arch
Two substests cannot be run in the posix architecture
as they require userspace.
Today they are filtered by kconfig, which works but spends
time running cmake.
As native_posix is a default test platform it is better
to filter it alltogether by arch, which saves quite a lot
of time.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-24 09:05:29 +02:00
Alberto Escolar Piedras 4c98a091fb tests subsys coredump: Exclude in posix architecture
These tests cannot be run in this architecture as it does not
support coredump.
Today it is filtered by kconfig, which works but spends
time running cmake.
As native_posix is a default test platform it is better
to filter it alltogether by arch, which saves quite a lot
of time.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-24 09:05:29 +02:00
Flavio Ceolin 0b01671fe9 tests: pm: Test pm_state_cpu_get_all
Add test for pm_state_cpu_get_all API

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-23 20:57:57 -05:00
Anas Nashif 996c8457d7 ztest: remove old ztest api
Remove old Ztest API entirely. New API is the now the default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:04:29 +02:00
Anas Nashif 345735d0a8 tests: remove CONFIG_ZTEST_NEW_API in all tests
Remove all usage of CONFIG_ZTEST_NEW_API from tests and sample as this
is now enabled by default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:04:29 +02:00
Dmitrii Golovanov 664d96785b tests: gdbstub: qemu: Cross-validate test behavior
Add a testcase to run the same test application and GDB script
which we use for Zephyr GDB stub testing, but now with
the GDB stub enabled at QEMU itself using it as a reference
RDP backend implementation. This allows to check the Zephyr's
gdbstub implementation has similar behavior as the reference.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-10-20 15:03:55 +02:00
Dmitrii Golovanov 236c1ac5de tests: gdbstub: Add GDB remote target parameter
Add `gdb_target_remote` test parameter for GDB `target remote`
command instead of its hardcoded value to allow different types
of gdbstub serial interfaces as well as different TCP ports in
gdbstub test suites possibly run in parallel on the same host.

Move all GDB log configuration parameters from GDB script to
the fixture code.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-10-20 15:03:55 +02:00
Dmitrii Golovanov cbbb1cabd6 tests: gdbstub: Improve test case
Gdbstub test improvements: using pytest fixtures, parametrization, and
expected pattern matching on outputs from GDB and the test application.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-10-20 15:03:55 +02:00
Dmitrii Golovanov c9e651b12c tests: samples: gdbstub: make test out of the sample
Clone samples/subsys/debug/gdbstub to tests and convert it back
to a build-only sample aligned with documentation.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-10-20 15:03:55 +02:00
Florian Grandel e9d5a98e9d drivers: ieee802154: improve CSL standard conformance
This change slightly simplifies the configuration of a CSL receiver and
generalized CSL_RX_TIME to EXPECTED_RX_TIME as a re-usable primitive
across several timing-sensitive IEEE 802.15.4 standard sub-protocols
(namely BE-PANs/DSME/CSL/RIT/TSCH).

This API change is based on the rules outlined in RFC #61227.

Fixes: #62918

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-10-20 14:58:32 +02:00
Tom Burdick c678f25bc1 llext: Fix a bug in section linking
When relocating section symbol addresses the value where the
relocation is to be written is an offset into the section to load.

Simply rewriting it with the section address is not enough, we need
to write the address of the section with the offset into it.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-10-13 16:47:02 +01:00
Bjarki Arge Andreasen 517bec233e modem: modem_cmux: Increase modem cmux buf size
This commit increases the buffer used for commands
in the control channel within an instance of the
modem_cmux module. The buffer was not large enough to
store an MSC command if the optional break signals
where included. This commit fixes the issue and
updates the test suite to use the max size MSC message.

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-10-11 18:57:11 +03:00
Anas Nashif b1ee8b248a tests: logging: group logging testing and cleanup identifiers
Better group for logging tests removing verbosity and redundancy in
identifiers and making the sub-component a bit more uniform and clear.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-11 14:19:40 +03:00
Anas Nashif 4dabea6f67 tests: settings: fix test meta data and components
Fix meta data and standarize components in test identifiers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-11 14:19:40 +03:00
Anas Nashif 276a0e02c6 tests: mcumgr: fix test meta data and components
Fix meta data and standarize components in test identifiers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-11 14:19:40 +03:00
Anas Nashif c9a2e0f0e8 tests: fcb: fix test meta data and components
Fix meta data and standarize components in test identifiers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-11 14:19:40 +03:00
Anas Nashif 47983916a2 tests: nvs: fix test meta data and components
Fix meta data and standarize components in test identifiers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-11 14:19:40 +03:00
Anas Nashif 36dde2c2ef tests: fs: fix test meta data and components
Fix meta data and standarize components in test identifiers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-11 14:19:40 +03:00
Flavio Ceolin e7bd10ae71 random: Rename random header
rand32.h does not make much sense, since the random subsystem
provides more APIs than just getting a random 32 bits value.

Rename it to random.h and get consistently with other
subsystems.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-10 14:23:50 +03:00
Bjarki Arge Andreasen 1816b6380b modem: modem_cmux: Set C/R bit in UIH frames
This commit sets the C/R (command/response) bit when UIH
CMUX frames are sent from the modem_cmux module. This bit
is ignored by some modems like the Quectel BG95, as there
is no defined response to this specific CMUX frame type.
However, other modems, like the TELIT ME910, require the
bit to be set (command). If the bit is not set, the modem
will simply ignore the frame completely.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-10-06 09:18:32 +02:00
Martin Åberg 0edfd664af tests: mcumgr: smp_version: Enable for SPARC
This has been tested on the following boards. The result is PASS on all.
 - qemu_leon3
 - generic_leon3
 - gr716a_mini

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2023-10-03 15:14:30 +01:00
Christopher Friedt c6c97002b5 tests: subsys: zbus: do not use verbose logging
This change fixes a regression on `qemu_riscv64_smp` and
`qemu_riscv32_smp` that arose because debug logging was
enabled. My guess is that subtle races exist and that
debug logging exacerbates the condidtions for those
races.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-10-02 23:30:10 +03:00
Johann Fischer ed7d56f04e tests: usb: add test for new USB device support
This is initial patch to add tests for new USB device support.
The test uses USB host support and virtual USB bus by default,
but should work on real hardware as well. For now, only the
Get Configuration and Set Interface requests are tested by default.
More tests will follow.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-10-01 09:26:07 +03:00
Bjarki Arge Andreasen 48a069204c modem: modem_pipe: Avoid inconsequential open/close calls
This PR adds a mechanism to avoid calling open() or close()
on pipes which are already opened or closed respectively.

This optimization can help simplify backends implementing
the modem_pipe API by avoiding duplicated boilerplate code.

The TTY backend test suite has been updated to match the
new behavior.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-09-30 18:47:48 +02:00
Tom Burdick b7f3182f79 llext: Simple hello world test case
Adds a very simple hello world test case for llext. The loadable
extension is built and then included as a binary array into the test
making it very easy to load, debug, and inspect. The extension is
built using the same toolchain as the base image by default.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-09-29 20:50:38 -04:00
Florian Grandel 36402b6d2a net: pkt: time: introduce ns timestamp helper
A little refactoring that simplifies dealing with nanosecond timestamp
values in packets and further decouples calling code from PTP:

Benefits:
- simplifies calling code by removing redundant conversions.
- prepares for removing PTP dependencies from net_pkt.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-09-29 16:27:15 +02:00
Yonatan Schachter 859be8cb73 tests: bindesc: Added definition tests
Added tests for the bindesc subsystem, testing definition of
binary descriptors on several qemu architectures, and using
several C standards (c99, c11, etc.).

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2023-09-28 07:39:09 -04:00
Anas Nashif d885048637 tests: pm: power_domains: rename testcase, demo is ambigous
Rename testcase and use native_posix for coverage.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-27 15:11:18 -04:00
Anas Nashif c532595519 tests: pm: driver_init: rename testcase, demo is ambigous
Use a more descriptive testcase name.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-27 15:11:18 -04:00
Anas Nashif eb956d0853 tests: pm: driver_init: use native_posix for testing
Use native_posix, this is a better platform for getting test coverage.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-27 15:11:18 -04:00
Rodrigo Peixoto 43c8df7893 test: zbus: Add tests for MSG_SUBSCRIBERS
Add specification-based and integration tests for `MSG_SUBSCRIBERS`.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2023-09-27 20:03:43 +03:00
Florian Grandel a12a6ab5b9 drivers: ieee802154: introduce channel pages
Replaces the previous approach to define bands via hardware capabilities
by the standard conforming concept of channel pages.

In the short term this allows us to correctly calculate the PHY specific
symbol rate and several parameters that directly depend from the symbol
rate and were previously not being correctly calculated for some of the
drivers whose channel pages could not be represented previously:
* We now support sub-nanosecond precision symbol rates for UWB. Rounding
  errors are being minimized by switching from a divide-then-multiply
  approach to a multiply-then-divide approach.
* UWB HRP: symbol rate depends on channel page specific preamble symbol
  rate which again requires the pulse repetition value to be known
* Several MAC timings are being corrected based on the now correctly
  calculated symbol rates, namely aTurnaroundTime, aUnitBackoffPeriod,
  aBaseSuperframeDuration.

In the long term, this change unlocks such highly promising functional
areas as UWB ranging and SUN-PHY channel hopping in the SubG area (plus
of course any other PHY specific feature).

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-09-27 12:44:15 -04:00
Yuval Peress acc5501118 zdsp: Add Q value print formatting helpers for
Introduce PRI style formatting for DSP values. These require the use
of another separate macro to set up the argument (PRIq_arg).

Signed-off-by: Yuval Peress <peress@google.com>
2023-09-25 09:47:26 +02:00
Ryan McClelland 104ea2ccca modules: cmsis-dsp: add cmsis-dsp module
Use CMSIS-DSP from its new realm. This also changes change how you
initialize FFT tables as well to use arm_cfft_init_64_f32 if you
know the FFT size in advance rather than the generic initialization
arm_cfft_init_f32.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-09-25 09:46:33 +02:00
YuLong Yao 21fcf61c87 tests: drivers: debug: add esp32s3_luatos_core
add overlay for esp32s3_luatos_core board

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2023-09-22 15:58:11 +02:00
Florian Grandel e2005b6e48 modules: openthread: radio: OT now uses standard TX timestamp
Synchronizes with the new upstream RX/TX timestamp definition in
OpenThread based on the standard's SFD.

This change is synchronized with the upstream OpenThread implementation
via west.yml.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-09-19 15:21:17 +01:00
Juha Heiskanen 3e0ed42427 tests: mcumgr: Updated MCUmg & smp client tests
Fixed broken MCUmgr client unit test.
Added test_ -prefix to tests.
Added testcase.yaml to test trigger test run.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2023-09-19 15:21:08 +01:00
Johann Fischer f67dd39bb2 drivers: ramdisk: use devicetree to instantiate RAM disk
Rework RAM disk driver to be configured using devicetree and
support multiple instances.

This patch also removes a copy of the RAM disk driver,
tests/subsys/fs/fat_fs_dual_drive/src/disk_access_test_drv.c,
that was there for testing multiple disk drivers support.

Bonus: one SYS_INIT() less and a memory region can be exported to the
host.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-09-18 17:36:50 +02:00
Bjarki Arge Andreasen f007f21b3c modem: chat: Add test for runtime chat scripts
This commit adds a test to ensure chat scripts can
be created and modified at runtime.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-09-18 14:11:40 +01:00
Bjarki Arge Andreasen add09f389b tests: modem: Add tests for sync script run functions
This commit adds tests to validate the behavior of the
new script run functions.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-09-18 14:11:40 +01:00