Commit Graph

1436 Commits

Author SHA1 Message Date
Mateusz Junkier 949e5120d3 pm: increase coverage - add missing api tests
add missing api tests reported by codecov

Signed-off-by: Mateusz Junkier <mateusz.junkier@intel.com>
2023-12-27 15:57:39 +00:00
Mateusz Junkier 501e67acd2 pm: increase coverage - add missing test assert
cover missing lines reported by codecov

Signed-off-by: Mateusz Junkier <mateusz.junkier@intel.com>
2023-12-27 15:57:39 +00:00
Marek Vedral 0d304b9223 samples: debug: Add support for qemu_cortex_a9 in GDB stub sample
This commit adds a devicetree overlay file and an extra condition in the
CMakeLists.txt file to allow remote debugging for the qemu_cortex_a9
board.

Signed-off-by: Marek Vedral <marek.vedral@gmail.com>
2023-12-18 09:31:42 +01:00
Tomasz Moń 3e7368829b usb: device_next: uac2: interface descriptor macros
Add macros to initialize full set of descriptors required for USB Audio
Class 2 instance. Descriptors start with Interface Association
Descriptor that binds together the AudioControl interface and all
AudioStreaming interfaces.

AudioStreaming interfaces have alternate setting 0 without any endpoints
and alternate setting 1 with isochronous endpoint with max packet size
calculated on maximum sample frequency, number of channels, subslot size
and clock synchronization (asynchronous endpoints require +1 sample).

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-12-15 14:24:44 +01:00
Tomasz Moń a825147d0c tests: usb: uac2: test descriptor macros
Compare devicetree generated class specific descriptors for headset
example against reference hex values.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-12-15 14:24:44 +01:00
Anas Nashif 21561e4e03 tests: coredump: no need for special xtensa entry
We use the same code flow now on all architectures, so no need for a
special entry for xtensa.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-14 09:32:27 +01:00
Anas Nashif 11365fc4f8 tests: move shared_multi_heap to tests/lib
Move shared_multi_heap test under lib alongside all other heap tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-12-13 17:27:54 -05:00
Flavio Ceolin c724a6c5ef tests: pm: device_runtime_api: Check async behavior
Additional test to check if getting a device while there
is a pending async put does not trigger unnecessary device
state changes.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-12-12 10:57:34 +01:00
Flavio Ceolin 3f7325e34b tests: pm: device_runtime: Checks async put with delay
Checks that async put respects the given delay.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-12-12 10:57:34 +01:00
Flavio Ceolin b5ca7a06b4 pm: device_runtime: Add delay to async put
Add a delay parameter to asynchronous device runtim put. This allows
to delay the put operation what is useful to avoid multiple states
transitions.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-12-12 10:57:34 +01:00
Juha Heiskanen 34d4e50374 tests: mode: Modem CMUX DTE / DCE test
Added unite test for for validate modem CMUX DTE & DCE role
communication together.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2023-12-08 20:17:58 +00:00
Juha Heiskanen 6943cd497c tests: modem: Modem backend mock update
Added possibility for link 2 modem mock instance for
validating P2P communication without any data stubbing.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2023-12-08 20:17:58 +00:00
Fabio Baltieri fa8a7c3898 test: add a test for the kbd_matrix_state command
Add a test for the kbd_matrix_state shell command, both 8 and 16 bit row
variants.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-12-08 20:16:39 +00:00
Yong Cong Sin a25e211ad2 tests: shell: shell_uart: add test for multi-instance
Add test that exercise the instance macros of the UART shell
backend.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-12-06 11:27:20 -08:00
Dmitrii Golovanov 52442a7c49 tests: gdbstub: Fix incomplete code coverage dump
When the test runs with code coverage, make sure the coverage dump
completes its output under pytest execution before the test debug
session ends in both cases: for Zephyr gdbstub feature and for
Qemu internal GDB stub.

Add few more test operations with breakpoints.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-12-06 17:52:18 +00:00
Jordan Yates ca72fff802 tests: pm: device_power_domains: remove `CONFIG_PM`
This test is unrelated to system PM.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-12-06 09:16:12 +00:00
Jordan Yates 955bd413e1 tests: pm: device_power_domains: test multiple claim
Test claiming a device multiple times before releasing it, and validate
that the power domain returns to off.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-12-06 09:16:12 +00:00
Christopher Friedt 51a011bbd3 tests: logging: add log_blocking testsuite to demonstrate bugfix
Add a testsuite to demonstrate proper functionality of blocking
in the log processing thread.

This serves to demonstrate the previous bugfix, to provide
missing test coverage for the option, and also to document what
pitfalls to avoid when blocking in the log processing thread.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-12-04 09:15:29 -05:00
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