Commit Graph

1469 Commits

Author SHA1 Message Date
Fabio Baltieri 906724fb99 input: increase default stack size to 1024
The default 512 bytes stack size is a bit tight for some architecture
and leads to samples running out of stack. Let's default to 1024 and let
the user tweak it down if necessary.

Suggested-by: Benjamin Cabé <benjamin@zephyrproject.org>
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-02-28 07:45:28 -06:00
Riadh Ghaddab 0fb8506ae4 tests: subsys/fs/nvs: fix nvs-cache-gc test
nvs-cache-gc test is running into infinite loop because of the wrong
stop condition when filling a sector.
Fix this by keeping an empty ATE in the sector for delete operation as
defined in the NVS filesystem write operations.

Signed-off-by: Riadh Ghaddab <rghaddab@baylibre.com>
2024-02-25 20:47:06 -05:00
Christopher Friedt 2155a9e5f7 logging: rename log2_generic to log_generic
The log2 prefix was deprecated and changed to log some time ago,
but log2_generic() seems to have been inadvertantly left with
the old prefix.

Rename log2_generic() to log_generic() to follow suit.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-02-14 19:07:30 +01:00
Dominik Ermel 5f31c15b1d tests/settings/file: increase main stack size
Increase ZTEST and MAIN stack to 4k.

Fixes #57324

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-02-05 14:50:52 +01:00
Tom Burdick 84e883b611 llext: Support memory protection
Sets up memory partitions and allows for the partitions to be added to a
memory domain after loading an extension. This allows for applying
memory protection attributes to all of the needed memory regions an
extension requires to execute code correctly.

Currently only works when usermode is enabled as otherwise memory
protection APIs are unavailable.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-02-02 13:06:28 -05:00
Jordan Yates 84ce10658c tests: cmsis-dsp: request required features
Request the CMSIS DSP features required for each test.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-02-01 14:49:03 -06:00
Krzysztof Chruściński ee13631362 pm: device_runtime: Extend existing API with ISR_SAFE mode
Extend macros from creating a PM device with an optional argument
which indicate whether type of device is ISR_SAFE or not.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-02-01 15:03:42 +01:00
Krzysztof Chruściński 5ce4348311 tests: pm: device_runtime_api: Extend with synchronous device
Extended test to support case when PM device is defined as
synchronous.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-02-01 15:03:42 +01:00
Tom Burdick 34f39800cf llext: Extend test coverage
The platform key using arch + simulation better provides coverage of
unique architectures. Adds a testcase for writable module builds and
loading which was uncovered previously and would've led to a failure on
xtensa as xtensa currently requires writable storage.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-01-30 15:08:22 -05:00
Alberto Escolar Piedras 68c3a9ba46 tests modem/backends/tty: Define _XOPEN_SOURCE
This test uses functions which are extensions to
the C library. Let's explicity select one of the extensions
which includes it instead of relaying on somebody having
set it for this file somewhere else.
(Note this test is exclusive to native targets)

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-26 07:48:55 -05:00
Øyvind Rønningstad 223b4c372f tests: mgmt: Adapt to API changes in zcbor 0.8.0
zcbor_new_state and zcbor_tstr_put_term

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2024-01-25 15:09:16 +00:00
Bjarki Arge Andreasen 27b0d4e3fe modem: chat: remove receive and transmit timeouts
Remove receive and transmit timeouts which are no
longer useful as the RECEIVE_READY and
TRANSMIT_IDLE events will be used to efficiently
manage timeouts between transmit/receive calls.

Then update the the in-tree drivers using the
modem_chat module to omit the process timeout
parameter.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-25 11:22:42 +01:00
Luca Burelli 938d3547d0 llext: move current test to a hello_world subdir
In preparation for multiple tests, move the current hello_world test
to its own subdirectory. Also, merge the llext compilation in the
parent CMakeLists.txt.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-01-24 10:44:48 +01:00
Luca Burelli 92a5e3ace7 llext: rework testcases to share common config
This patch reworks the YAML files for the llext samples and tests to
share a common restriction list. Also, using an arch-specific config
to disable the MPU for the ARM architecture only, there is no need
to duplicate the test cases per architecture.

Use this to enable the "writable" test case for the ARM architecture
and separate the "modules_enabled" case to test building as a module.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-01-24 10:44:48 +01:00
Luca Burelli 5697d25901 llext: fix test Kconfig module conditions
Make it so LLEXT_TEST_HELLO is enabled by default, and it is actually
compiled only when the config is enabled.

The check for MODULES==y and LLEXT_TEST_HELLO!=m is redundant, as the
Twister machinery already causes an error when Kconfig flags specified
in the YAML file are coerced to different values.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-01-24 10:44:48 +01:00
Dawid Niedzwiecki ea630294d3 logging: add flag to skip source info
Add a flag to skip printing the source info.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2024-01-22 14:05:11 -05:00
Henrik Brix Andersen 3436c93387 drivers: can: remove run-time RTR filtering, add build-time RTR filter
A growing number of CAN controllers do not have support for individual RX
hardware filters based on the Remote Transmission Request (RTR) bit. This
leads to various work-arounds on the driver level mixing hardware and
software filtering.

As the use of RTR frames is discouraged by CAN in Automation (CiA) - and
not even supported by newer standards, e.g. CAN FD - this often leads to
unnecessary overhead, added complexity, and worst-case to non-portable
behavior between various CAN controller drivers.

Instead, move to a simpler approach where the ability to accept/reject RTR
frames is globally configured via Kconfig. By default, all incoming RTR
frames are rejected at the driver level, a setting which can be supported
in hardware by most in-tree CAN controllers drivers.

Legacy applications or protocol implementations, where RTR reception is
required, can now select CONFIG_CAN_ACCEPT_RTR to accept incoming RTR
frames matching added CAN filters. These applications or protocols will
need to distinguish between RTR and data frames in their respective CAN RX
frame handling routines.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-21 11:00:31 +01:00
Luca Burelli 0747cd3358 llext: define add_llext_target() for llext compilation
This patch defines a generic function that encapsulates all the
architecture-specific machinery needed to compile llexts from source
files. Current tests are updated to use this function.

Output and source files must be specified using the OUTPUT and SOURCES
arguments. Only one source file is currently supported.

Arch-specific flags will be added automatically. The C_FLAGS argument
can be used to pass additional compiler flags to the compilation of
the source file.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-01-21 10:59:49 +01:00
Henrik Brix Andersen 75117a0deb drivers: can: remove CAN_FILTER_FDF flag
Remove the CAN_FILTER_FDF flag for filtering on classic CAN/CAN FD frames
as it is not supported natively by any known CAN controller.

Applications can still filter on classic CAN/CAN FD frames in their receive
callback functions as needed.

Fixes: #64554

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-19 09:55:43 +01:00
Markus Swarowsky dc7613865d modules: mbedtls: Add a mbedtls_ms_time implementation
MbedTLS 3.5.0 requires a implementation of mbedtls_ms_time giving a
time in ms for TLS 1.3
Therefor adding an alternative implementation using zephyrs
k_uptime_get

Signed-off-by: Markus Swarowsky <markus.swarowsky@nordicsemi.no>
2024-01-17 16:52:52 +01:00
Bjarki Arge Andreasen 358f1ff934 tests: modem: cmux: Implement TRANSMIT_IDLE into test suite
Use transmit idle event to synchronize with data transmitted
through DLCI pipes to test TRANSMIT_IDLE implementation.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-17 09:20:50 -06:00
Bjarki Arge Andreasen 325bc953a8 tests: modem: pipe: mock: Implement TRANSMIT_IDLE event
Implements TRANSMIT_IDLE event notification for mock
modem_pipe.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-15 15:11:50 +01:00
Krzysztof Chruściński dc99da6a4f tests: logging: log_api: Extend to cover frontend runtime filtering
Extend test to cover runtime filtering for frontend.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-01-15 09:57:54 +01:00
Lucas Tamborrino 11fc182315 soc: esp32: refactor esp32_net
SOC_ESP32_NET is now SOC_ESP32_APPCPU, following espressif's
naming convention in the same manner as ESP32S3 app cpu.

SOC_ESP32_APPCU is now a subset of SOC_SERIES_ESP32.

This commit also changes the necessary files, samples and tests
for bisect purposes.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-01-13 00:22:24 +00:00
Bjarki Arge Andreasen 9176e5c568 modem: pipe: Add test suite
Add test suite for the modem_pipe module.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-11 16:09:44 +00:00
Bjarki Arge Andreasen 4d99c69e4a modem: backend: tty: Implement transmit idle event
Implement transmit idle notification for TTY backend. Since TTY
has an "infinite" transmit buffer, we invoke transmit idle
immediately after writing the data to the TTY file.

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

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-11 16:09:44 +00:00
Guennadi Liakhovetski aee2d1a677 llext: provide an example of tristate Kconfig option
Add a tristate Kconfig option to the llext hello-world twister test.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-01-11 10:26:04 -05:00
Bjarki Arge Andreasen 7d7f7aaf03 tests: subsys: modem: cmux: Update resync unit test
Update the unit test to expect the new simplified resync
behavior, and validate that new resync is working.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-11 13:53:25 +01:00
Anas Nashif afc319e3fa ztest: shell: add shell support
- Support for listing both testcases and testsuites
- Support for running single suites or single test cases
- Support shuffling tests and repeating execution based on command line
  arguments.

For example, build with

west build -p  -b qemu_cortex_m3  tests/kernel/sleep   -t run -- \
-DCONFIG_ZTEST_SHUFFLE=y -DCONFIG_ZTEST_SHELL=y

Following commands are available:

uart:~$ ztest
ztest - Ztest commands
Subcommands:
  run-all          :Run all tests
  shuffle          :Shuffle tests
  list-testsuites  :List all test suites
  list-testcases   :List all test cases
  run-testsuite    :Run test suite
  run-testcase     :Run testcase

shuffle accepts two arguments --suite_iter and --case_iter which allows
repeated exercution of testcases or suites.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-01-09 09:58:57 +01:00
Yong Cong Sin c7ce871a04 tests: exclude `renode` from tests requiring unsimulated peripherals
Physical boards work on these tests but some of the required
peripherals are not simulated by `renode`, executing the tests
with renode-simulated board in CI will fail.

Exclude `renode` simulation from these tests.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-08 16:17:43 +00:00
Arkadiusz Cholewinski b3e1cc9f4f PM: Add testing pm_device_state_str function.
Add testing pm_device_state_str function in device_driver_init testcase.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2024-01-05 14:47:14 -05:00
Rodrigo Peixoto 2cfd28e5ca tests: zbus: add HLP priority boost tests
Add the dedicated tests for HLP priority boost.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2024-01-04 09:41:54 +01:00
Rodrigo Peixoto 73f0bcc7fc tests: zbus: fix unit tests to work with priority boost
The test considers using zbus inside ISR.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2024-01-04 09:41:54 +01:00
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