Commit Graph

860 Commits

Author SHA1 Message Date
Aastha Grover
94902bf542 tests: log_switch_format: Add mock backend and remove harness console
Add mock backend to support validating the output logs when
switching the log format at runtime. This removes the need to use
harness console when ztest framework is in use.

Fixes #47077

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-07-08 20:10:42 +00:00
Zhao Shuai
039dad3817 tests: subsys: move jwt to new ztest API
Move test jwt to use new ztest API.

Signed-off-by: Zhao Shuai <shuai1x.zhao@intel.com>
2022-07-08 10:54:02 +02:00
Yinfang Wang
f6ee9362cd tests: subsys/debug: move coredump_backends to new ztest API
Move test coredump_backends to use new ztest API.

Signed-off-by: Yinfang Wang <yinfang.wang@intel.com>
2022-07-07 22:06:05 -04:00
Kumar Gala
e951c2808e tests: edac: ibecc: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:02:59 +02:00
Zhao Shuai
db186df082 tests: subsys: cpp: move libcxx to new ztest API
Move test libcxx to use new ztest API.

Signed-off-by: Zhao Shuai <shuai1x.zhao@intel.com>
2022-07-07 02:09:52 -04:00
Zhao Shuai
feb18cc66e tests: subsys: cpp: move cxx to new ztest API
Move test cxx to use new ztest API.

Signed-off-by: Zhao Shuai <shuai1x.zhao@intel.com>
2022-07-07 02:09:52 -04:00
Stephanos Ioannidis
8e6322a21a tests: cpp: cxx: Add qemu_cortex_a53 as integration platform
This commit adds the `qemu_cortex_a53`, which is an MMU-based platform,
as an integration platform for the C++ subsystem tests.

This ensures that the `test_global_static_ctor_dynmem` test, which
verifies that the dynamic memory allocation service is functional
during the global static object constructor invocation, is tested on
an MMU-based platform, which may have a different libc heap
initialisation path.

In addition to the above, this increases the overall test coverage
ensuring that the C++ subsystem is functional on an MMU-based platform
in general.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-07-06 10:46:39 +02:00
Stephanos Ioannidis
03f0693125 tests: cpp: cxx: Test with various types of libc
This commit changes the C++ subsystem test, which previously was only
being run with the minimal libc, to be run with all the mainstream C
libraries (minimal libc, newlib, newlib-nano, picolibc).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-07-06 10:46:39 +02:00
Stephanos Ioannidis
dc4895b876 tests: cpp: cxx: Add dynamic memory availability test for static init
This commit adds a test to verify that the dynamic memory allocation
service (the `new` operator) is available and functional when the C++
static global object constructors are invoked called during the system
initialisation.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-07-06 10:46:39 +02:00
Stephanos Ioannidis
6e0063af29 tests: cpp: cxx: Add static global constructor invocation test
This commit adds a test to verify that the C++ static global object
constructors are invoked called during the system initialisation.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-07-06 10:46:39 +02:00
NingX Zhao
aa49e988ce tests: ipc: move to new ztest api
Move tests/subsys/ipc to new ztest API.

Signed-off-by: NingX Zhao <ningx.zhao@intel.com>
2022-07-05 12:17:47 +00:00
Carles Cufi
fb9ca7c392 tests: log: stress: Adapt to logging API changes
This test was merged before having re-run CI, and some logging API
changes had happened since CI was last run.
Adapt to those to fix the build.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-07-04 17:59:34 +02:00
Krzysztof Chruscinski
e4bd0fceef logging: Allow for compilation without log_output
Add option to Kconfig to enable log_output module. It is used
by most of the backends but it is an optional formatter helper
thus it is possible to run logging without it. One example might
be dictionary based logging which does not format log message
to a readable string.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-07-04 16:43:32 +02:00
Keith Packard
fb1d092955 tests: ec_host_cmd: Make sure expected_dut_to_host fits in buffer
If struct tx_structure is too large than the buffer that
expected_dut_to_host references, leading the compiler to generate a warning
about the possibility of buffer overflow.

Leave out the 'struct ec_response_too_big' so that 'struct tx_structure'
fits within the 256 byte buffer.

This was caught when using GCC 11.3.0 building the test for native_posix.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-07-04 16:11:51 +02:00
Krzysztof Chruscinski
1125e39797 tests: logging: Add stress test
Add stress test for logging to validate that logging is coherent:
All message are processed by the logger or dropped and no message
is lost.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-07-04 15:50:53 +02:00
Krzysztof Chruscinski
e4bfec8100 logging: Use spin lock
Updated log_core to use spin lock instead of irq_lock.
Refactored z_log_msg_post_finalize function.

Update thresholds in the log_stack test.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-07-04 15:50:53 +02:00
Øyvind Rønningstad
c1a9866c86 west.yml: Update zcbor to v. 0.5.1
lwm2m: Regenerate lwm2m_senml code from the CDDL description.
Reapply manual changes.
Create a sh script to perform the regeneration.

tests: zcbor_bulk: Adapt to zcbor 0.5.1
zcbor_new_decode_state() now has no return value.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2022-07-04 15:13:42 +02:00
Jordan Yates
5407b54d2b tests: storage: flash_map: test disabled flash device
Add a test for `fixed-partition` nodes that exist on a disabled flash
device.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-07-04 10:28:41 +02:00
Reto Schneider
7a6c5710ff cmake: Update cmake_minimum_required to 3.20.0
As Zephyr currently requires CMake version 3.20.0, update all
occurrences of cmake_minimum_required.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2022-07-04 10:18:45 +02:00
Jordan Yates
b8a2d2724a tests: storage: flash_map: close flash area
Close the flash_area at the end of individual tests to demonstrate
correct usage of the API.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-07-02 16:04:16 +02:00
Jordan Yates
4543f82c12 storage: flash_map: remove device_get_binding
Remove all usage of `device_get_binding` in the subsys by directly
storing the `const struct device*` in the `struct flash_area`.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-07-02 16:04:16 +02:00
Krzysztof Chruscinski
3bcd14f420 logging: Reduce code size for frontend only case
Add early returns from functions which are not used when
there is only one frontend in the system (no backends). This
allows to significantly reduce logging code size in that
configuration.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-07-02 14:13:54 +02:00
Ryan Erickson
fb34a9749f logging: add log_source_id_get
Add API to get the logging module source ID from the
module name;

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-07-01 16:30:30 +02:00
Yinfang Wang
aa9c466d70 tests: subsys: mgmt: move zcbor_bulk to new ztest API
Move test zcbor_bulk to use new ztest API.

Signed-off-by: Yinfang Wang <yinfang.wang@intel.com>
2022-07-01 11:37:41 +02:00
Yinfang Wang
9c088a814f tests: subsys: mgmt: move smp_reassembly to new ztest API
Move test smp_reassembly to use new ztest API.

Signed-off-by: Yinfang Wang <yinfang.wang@intel.com>
2022-07-01 11:37:41 +02:00
Yinfang Wang
08dadc3c30 tests: subsys: mgmt: move ec_host_cmd to new ztest API
Move test ec_host_cmd to use new ztest API.

Signed-off-by: Yinfang Wang <yinfang.wang@intel.com>
2022-07-01 11:37:41 +02:00
Tom Burdick
5dd139fe8f tests/subsys/rtio: Update testing to use newer ZTEST API
The old test API is being phased out, RTIO is a new subsys and
deserves to use the new test API

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-06-30 14:58:10 -04:00
Andrei Emeltchenko
6eb312f7b9 tests: cmsis_rtos_v2: Remove unused variables
Clean up dead code.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-06-30 12:37:14 -05:00
Keith Packard
16a4bf603d test: cmsis_rtos_v2: Initialize versionInfos
get_version_check will leave the version info unchanged if osKernelGetInfo
fails. This lead to a compiler warning when those results were used.

Initialize the values with data that will cause a failure that should be
easily diagnosed.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-06-30 12:32:45 +02:00
Keith Packard
305068a3bc tests/logging: Give picolibc lots of margin for now
We're not quite sure how much extra stack space picolibc will use, so
give it plenty of space for now.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-06-30 10:33:24 +02:00
Daniel Leung
3efce4c939 Revert "tests: logging: log_api: Add cast to char array"
This reverts commit 265394e30e.

The underlying cause is fixed so reverting this...

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-06-30 14:03:45 +09:00
Tom Burdick
121462b129 rtio: Low (Memory) Cost Concurrent scheduler
Schedules I/O chains in the same order as they arrive providing a fixed
amount of concurrency. The low memory cost comes at the cost of some
computational cost that is likely to be acceptable with small amounts
of concurrency.

The code cost is about 4x higher than the simple linear executor
which isn't entirely unexpected as the logic requirements are quite a bit
more than doing the next thing in the queue.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-06-28 13:53:13 -04:00
Tom Burdick
3d2ead38cb rtio: Real-Time Input/Output Stream
A DMA friendly Stream API for zephyr. Based on ideas from io_uring
and iio, a queue based API for I/O operations.

Provides a pair of fixed length ringbuffer backed queues for submitting
I/O requests and recieving I/O completions. The requests may be chained
together to ensure the next operation does not start until the current
one is complete.

Requests target an abstract rtio_iodev which is expected to wrap all
the hardware particulars of how to perform the operation. For example
with a SPI bus device, a description of what a read, and write mean
can be decided by the iodev wrapping a particular device
hanging off of a SPI controller.

The queue pair are submitted to an executor which may be a simple
inplace looping executor done in the callers execution context
(thread/stack) but other executors are expected. A threadpool executor
might for example allow for concurrent request chains to execute in
parallel. A DMA executor, in conjunction with DMA aware iodevs
would allow for hardware offloading of operations going so far as to
schedule with priority using hardware arbitration.

Both the iodev and executor are definable by a particular
SoC, meaning they can work in conjuction to perform IO operations
using a particular DMA controller or methodology if desired.

The application decides entirely how large the queues are, where
the buffers to read/write come from (some executors
may have particular demands!), and which executor to submit
requests to.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-06-28 13:53:13 -04:00
Krzysztof Chruscinski
9833ca61c9 logging: Removing v2 suffix from logging names
Renaming objects which had 2 in the name to indicate that
it is v2 specific. Once logging v1 has been removed such
suffixes are redundant.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-23 15:46:37 -04:00
Lauren Murphy
318e6db239 debug: coredump: add xtensa intel adsp, support toolchains
Adds compatibility with Intel ADSP GDB from Zephyr SDK and
from Cadence toolchain to coredump_gdbserver.py.

Adds CAVS 15-25 (APL) register definitions. Implements
handle_register_single_read_packet to serve ADSP GDB
p packets.

Prevents BSA from changing between stack dump printout
and coredump by taking lock. Observed to be necessary for
accurate results on slower simulated platforms.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2022-06-23 15:44:45 -04:00
Krzysztof Chruscinski
265394e30e tests: logging: log_api: Add cast to char array
Tagged arguments feature fails to correctly tag a char array in
C++ configuration. Temporarily casting to char pointer to make
the test pass.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-23 13:42:23 +02:00
Krzysztof Chruscinski
041f0e5379 all: logging: Remove log_strdup function
Logging v1 has been removed and log_strdup wrapper function is no
longer needed. Removing the function and its use in the tree.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-23 13:42:23 +02:00
Aastha Grover
d81b3d7425 tests/subsys/logging/log_switch_format: fix incomplete logs
log_Switch_format test has incomplete handler logs on frdm_k64f
and also a false positive for logging.log_switch_format.immediate
testcase due to harness console which does not wait for
completion of ztest testcases to indicate pass/fail status to twister.

Fixes #46368

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-06-23 09:15:39 +02:00
Krzysztof Chruscinski
7f1b4f88e3 logging: Rename files and test from log_msg2 to log_msg
Renaming log_msg2 files to log_msg.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-23 09:10:33 +02:00
Keith Packard
d5167e1507 tests/log_stack: Increase stack usage for x86_64
The amount of stack used has changed for some reason (toolchain updates?),
use the amounts reported by the test when it failed.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-06-22 13:15:55 +02:00
Carlo Caione
1608c8adba pm: Introduce CONFIG_PM_DEVICE_RUNTIME_EXCLUSIVE
Sometimes we want to entirely decouple the system PM from the device PM,
leaving the devices to manage its own power states using the runtime PM.

This is currently not possible because the suspend / resume code path is
triggering the device PM hooks even when the runtime PM is enabled.

Introduce a new PM_DEVICE_RUNTIME_EXCLUSIVE symbol to allow the platform
to skip the device PM triggers on suspend / resume.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-06-22 12:24:43 +02:00
Dominik Ermel
40b8041dd5 tests/subsys/mgmt/mcumgr: Add unit tests for zcbor_bulk
The commit adds unit tests for zcbor_bulk utility function,
which has been provided to internally support zcbor in decoding
maps with command parameters.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-06-21 11:46:45 +02:00
Flavio Ceolin
8df552fb06 tests: log_immediate: Increase tests timeout
Slightly increase timeout for these tests since it is often failing in
xtensa simulator.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-06-16 16:01:41 -04:00
Krzysztof Chruscinski
c5f2cdef09 logging: Remove logging v1 from the logging
Remove v1 implementation from log_core and all references in the tree.
Remove modules used by v1: log_list and log_msg.
Remove Kconfig v1 specific options.
Remove Kconfig flags used for distinction between v1 and v2.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-16 10:51:15 -04:00
Gerard Marull-Paretas
74ed64139c tests: remove redundant <zephyr/zephyr.h> includes
Files including <zephyr/kernel.h> do not have to include
<zephyr/zephyr.h>, a shim to <zephyr/kernel.h>.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-15 09:13:11 +02:00
Krzysztof Chruscinski
abc690cbe7 tests: logging: log_syst: Remove reference to logging v1
Remove references to CONFIG_LOG1 and CONFIG_LOG2 macros.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski
e37afb4772 tests: logging: Remove log_msg test suite
Removing the suite for log_msg v1 as part of logging v1 removal.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski
c60d5ff565 tests: logging: Remove log_list test suite
Log_list module is used by the logging v1. Removing
the suite as part of logging v1 removal.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski
69d3337349 tests: logging: log_core_additional: Remove v1 support
Remove testing of v1 from the test suite.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski
076ad119ae tests: logging: Remove log_core test suite
Test suite was only for logging v1 which is now being removed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00