Commit graph

16700 commits

Author SHA1 Message Date
Johann Fischer
470cbe36d7 tests: bluetooth: disable CDC ACM logging
Disable CDC ACM logging in configuraton overlay used in test case
bluetooth.shell.cdc_acm.
The build warning was introduced by the commit e8c4867806
("usb: cdc_acm: disable logging if used for shell with logging")
to preven recursive logging when using the CDC ACM UART as shell or
logging backend

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-10-08 05:58:30 -04:00
Peter Mitsis
318b49570a tests: scheduler queue benchmarks
Implements a set of tests designed to show how the performance of the
three scheduler queue implementations (DUMB, SCALABLE and MULTIQ)
varies with respect to the number of threads in the ready queue.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-10-07 20:16:20 -04:00
Peter Mitsis
2221ca82d4 tests: wait queue benchmarks
Implements a set of tests designed to show how the performance of the two
wait queue implementations (DUMB and SCALABLE) change as the number of
threads in the wait queue varies.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-10-07 20:16:20 -04:00
Peter Fecher
0ac7f641b3 tests: drivers: spi_loopback: Add phyboard_polis
Adds the devicetree overlay and configuration for
phyboard polis to the spi_loopback test.

Signed-off-by: Peter Fecher <p.fecher@phytec.de>
2024-10-07 18:43:35 +02:00
Gerard Marull-Paretas
d3ca4fd84f tests: lib: cpp: cxx: ignore nRF54H20 DK 0.8.0
nRF54H HAL is not compatible with C++98, add new board revisions to the
list so that they are skipped.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-10-07 18:42:14 +02:00
Francois Gervais
736344b310 tests: coap_client: optimize/reduce sleep time
The goal of this commit is to reduce the overall test time by optimizing
the time spent sleeping.

However while doing so, a few glitches became apparent and those have
been fixed as well.

1. The way the ZSOCK_POLLIN event is managed has been modified

In most tests, the event would stick for the whole test and this would
sometimes results in the client receiving more data than intended which
in turn would results in various unexpected warnings and errors.

The management of the ZSOCK_POLLIN event has now been mostly moved to
the send/receive overrides which better represent how things would
happen outside of the test scenario.

For example, when sending data, if this send would normally result in
receiving some response, the send function sets the ZSOCK_POLLIN event.
Then when receiving, we clear the event as the data has been received.

There are a few exceptions to this for cases where we need to simulate
some specific abnormal behavior.

2. The `messages_needing_response` queue now includes a valid bit

The test manages a queue of messages id to be able to respond to the
correct id in the receive hooks.

It was built in a way that the id 0 would be treated as invalid
although it is a valid id.
In practice, it would not be an issue in most cases however, it would
result in an unexpected behavior if the `test_multiple_requests` test
would be run first.

To fix this issue in the simplest way, the queue has been changed to
uint32_t which gives us 16 extra bits for the management of the queue,
1 of which is used to tell if the entry is valid or not.

Signed-off-by: Francois Gervais <francoisgervais@gmail.com>
2024-10-07 17:13:47 +01:00
TOKITA Hiroshi
86da989a52 tests: drivers: build_all: display: Add config for solomon,ssd1327fb
Add configuration for "solomon,ssd1327fb" to enable build test.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-07 17:11:58 +01:00
TOKITA Hiroshi
8529e93501 tests: drivers: build_all: display: Add mipi-dsi devices to build test
Add build tests for the following devices.

- himax,hx8394
- frida,nt35510
- orisetech,otm8009a
- raydium,rm67162
- raydium,rm68200

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-07 17:11:58 +01:00
Frode van der Meeren
29b78abd16 bluetooth: tester: audio: Add verification for bis stopping
Adds a semaphor to make sure the stream has properly been stopped by the
controller before returning from btp_bap_broadcast_source_stop.

Signed-off-by: Frode van der Meeren <frode.vandermeeren@nordicsemi.no>
2024-10-07 13:39:33 +02:00
Tomi Fontanilles
85a56b5ee3 tests: secure_storage: add tests for the secure storage subsystem
Add one suite to test the PSA ITS API directly, and another to test it
through the PSA Crypto API.

The PSA ITS API test suite is run with different configurations to also
test customization possibilities that the secure storage subsystem offers.

Both test suites also have a test scenario with TF-M instead of the
secure storage subsystem.
This serves as compatibility testing to ensure that the PSA Secure
Storage API behaves the same from the user's point of view regardless
of the underlying implementation provider.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-10-07 13:38:43 +02:00
Chris Friedt
b6aed5c505 kernel: dynamic: use 4k stack size for x86
x86 architectures require a dynamic stack size that is a multiple
of 4096 bytes due to mmu restrictions.

For example, this test would previously fail when using the
default dynamic stack size of 1024 bytes for 32-bit
platforms.

```
west build -p auto -b qemu_x86/atom/nopae -t run \
  tests/posix/common/ -- -DCONFIG_USERSPACE=y
```

It would pass with an additional argument
```
west build -p auto -b qemu_x86/atom/nopae -t run \
  tests/posix/common/ -- -DCONFIG_USERSPACE=y \
  -DCONFIG_DYNAMIC_THREAD_STACK_SIZE=4096
```

Add a special default for x86 when using dynamic thread stacks.

The x86 default removes the need for `boards/qemu_x86*.conf`,
with the exception of `qemu_x86_tiny`.

qemu_x86_tiny did not have sufficient memory (or configuration)
to run the non-userspace tests, so bump up the available ram
from 256k to 512k for this test and clone the .conf from the
demand paging tests.

Eventually, the common posix test should be split into more
concise functional categories.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-10-05 14:13:18 -04:00
Jukka Rissanen
2e6c038363 tests: net: wifi: Run wifi tests together with net tests
Make sure wifi tests are run when verifying networking.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-10-05 14:06:15 -04:00
Mykhailo Lohvynenko
03029e7bd7 json: support parsing and serializing 'uint64_t'
Introduce support for 'uint64_t' type, so that unsigned numbers
can be serialized into JSON payloads.

Signed-off-by: Mykhailo Lohvynenko <Mykhailo_Lohvynenko@epam.com>
2024-10-05 14:04:48 -04:00
Andrej Butok
3ea954e97d tests: mcuboot: Add other nxp boards as test targets
Added other nxp boards as test targets:
frdm_ke17z, frdm_ke17z, frdm_ke17z512,
rddrone_fmuk66, twr_ke18f,
twr_kv58f220m, frdm_mcxn947/mcxn947/cpu0,
mimxrt1062_fmurt6, vmu_rt1170.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-10-04 22:51:22 +01:00
Joel Spadin
c82799bd4c tests: scripts: dts: Add tests for string escapes
Added tests for escape sequences in string and string-array properties.

Signed-off-by: Joel Spadin <joelspadin@gmail.com>
2024-10-04 13:26:51 -05:00
Olivier Lesage
9e3943d13e bluetooth: host: Add CONFIG_BT_CHANNEL_SOUNDING_TEST
Makes it easier to make sure the CS test code is removed if desired.
It should hopefully allow for a clean split in general.

Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
2024-10-04 16:34:45 +01:00
Emil Gydesen
dc97bbd35f Bluetooth: Audio: Rename bt_audio_codec_qos -> bt_bap_qos_cfg
The QoS structure is not related to a codec, but rather a
stream, and should thus not use the "Codec" name.

The BAP and ASCS specs refer to the QoS as
"QoS configuration" several places, so it is an obvious
choice for a name.

Since the structure is defined and used by BAP, the prefix
was changed from bt_audio to bt_bap.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-04 16:34:22 +01:00
Robert Lubos
0376a417fd tests: net: ipv6: Enable mbed TLS heap
mbed TLS MD operations, used by IPv6 Privacy Extensions, require access
to heap. This may vary depending on platform/mbed TLS variant used,
hence enable CONFIG_MBEDTLS_ENABLE_HEAP in tests to ensure mbed TLS has
always access to some heap memory.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-10-04 10:50:06 +01:00
Krzysztof Chruściński
cbe0abfd00 tests: drivers: uart: uart_pm: Disable PM_DEVICE_SYSTEM_MANAGED
When PM_DEVICE_SYSTEM_MANAGED is enabled (and that's the default) all
devices are suspended when device go to idle state (through pm
subsystem and not through just cpu_idle). In this test we are manually
controlling PM of the DUT so we don't want that.

Additionally, suspend action is taking a semaphore and it is illegal
in idle thread (where system managment operates) which causes assert
in kernel scheduler.

Removed for nrf54h20 as it applies only there.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-04 10:48:57 +01:00
Emil Gydesen
a4d628efcb tests: Bluetooth: tester: Implement TBS registration
TBS registration was changed from static to dynamic
and the BT Tester application need to be updated to use
the dynamic registration.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-10-04 10:47:03 +01:00
Erik Brockhoff
670bd3bed2 Bluetooth: controller: fixing issue re. assert on overlapping conn upd proc
If a connection update (from central) overlaps a peripheral initiated
conneection param request, then central rejects peripheral request
and continues central procedure. This lead to an assert in peripheral
On instant there would not be an rx_node for notification, as this
would have been discarded by the reception of the REJECT.

This fix ensures that once an rx_node has been 'accepted' for retention
it will not be discarded/overwritten by future rx_nodes

The test will trigger the assert without the fix in.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2024-10-04 10:46:06 +01:00
Krzysztof Chruściński
ffe6910e21 tests: kernel: interrupt: nested_irq: support nrf54h20_cpuppr
Add dedicated interrupt lines for nrf54h20_cpuppr. Similar exception
was already added to nrf54l15_flpr: 8742e2476.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-10-04 10:45:57 +01:00
Luca Burelli
7773fe8dd6 llext: hotfix: fix device API tests for platforms without console
LLEXT tests currently fail on platforms where a console was chosen but
its underlying device is not enabled. This might happen for example on
multicore SoCs, where the console is only enabled on the most powerful
CPU.

Fix this by only allowing testing the device API if the console device
is both chosen and enabled in the final DT.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-10-03 22:01:08 +01:00
Daniel Leung
b43e7387db tests: mem_map: no exec test for intel_adsp/ace30/ptl
This needs special treatment because the TEST_MEM_MAP section
is placed at the end. Since there is code in TEST_MEM_MAP,
rimage thinks the whole text section spans from .text to
end of TEST_MEM_MAP, which overlaps .data and others, so
it complains. Skip the execution test to avoid this issue.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-10-03 22:00:54 +01:00
Daniel Leung
3d65839dbc tests: rename intel_adsp_ace30.conf to intel_adsp_ace30_ptl.conf
The board has been renamed from intel_adsp/ace30_ptl to
intel_adsp/ace30/ptl. So the corresponding board only configs
for tests also need to renamed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-10-03 22:00:54 +01:00
Eric Ackermann
5275d44409 llext: Add RISC-V arch-specific relocations
This commit introduces architecture-specific ELF relocations for RISC-V,
in accordance with the RISC-V PSABI specification:
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc
Also, the necessary compiler configurations for compiling LLEXT
extensions on RISC-V are added, and the llext tests are executed on
RISC-V targets.
Calling llext extensions from user threads in RISC-V is still
unsupported as of this commit.

Signed-off-by: Eric Ackermann <eric.ackermann@cispa.de>
2024-10-03 21:59:42 +01:00
Seppo Takalo
73a3438b82 net: lwm2m: Remove hostname_verify flag from context
Use security mode (PSK or X509) to detect if we should
set the socket option to verify hostname.

PSK security mode cannot verify hostnames as this information
is coming in the certificate, so don't set the options.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-10-03 17:09:32 +01:00
Seppo Takalo
77e09916f7 tests: lwm2m: Remove qemu-cortex-m3
This board just don't have enough RAM for all tests
so it is just a maintenance headache without any
benefits.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-10-03 17:08:55 +01:00
Seppo Takalo
871aab7c45 tests: lwm2m: Fix minor timing issues on tests
* Wait for update when new object is created

  Sometimes our blockwise transfer starts before server have
  received an LwM2M Update. This causes Leshan to reject the SEND
  because is was not aware of object /19/0

* Wait "registered" message already in conftest.py.
  Sometimes Qemu boots faster, and the testcase don't see the
  log.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-10-03 17:08:55 +01:00
Chris Friedt
d11a0c2be9 tests: posix: common: test userspace as well
Ensure that userspace is tested in the common posix testsuite.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-10-03 17:07:05 +01:00
Yong Cong Sin
52a202309b zephyr: bulk update to DT_NODE_HAS_STATUS_OKAY
Change instances of:

DT_NODE_HAS_STATUS(<node_id>, okay)

to

DT_NODE_HAS_STATUS_OKAY(<node_id>)

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-03 17:06:52 +01:00
Yong Cong Sin
5aebd1276d devicetree: add DT_NODE_HAS_STATUS_OKAY
We already have `DT_HAS_COMPAT_STATUS_OKAY` and
`DT_NUM_INST_STATUS_OKAY`, it seems intuitive to assume that
`DT_NODE_HAS_STATUS_OKAY` exists, so much so that it was used
before it's implemented.

This patch implements `DT_NODE_HAS_STATUS_OKAY`, which is
equivalent to: `DT_NODE_HAS_STATUS(<node_id>, okay)`

Added test for it in `tests/lib/devicetree/api`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-03 17:06:52 +01:00
Yong Cong Sin
c710f8892b drivers: intc: plic: implement irq affinity configuration
- Implement irq-set-affinity in RISCV PLIC.
- Added new affinity shell command to get/set the irq(s)
  affinity in runtime, when `0` is sent as the `local_irq`, it
  means set/get all IRQs affinity.
- Some minor optimizations

Updated the build_all test to build this new configuration.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-02 13:48:05 -05:00
Håvard Reierstad
0fe6d34f8a Bluetooth: Mesh: Remove duplicate brg declaration
Removes duplicate declaration of the bridging direction, keeping the
one in the public header file.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-10-02 14:54:13 +01:00
Håvard Reierstad
8049c24994 Bluetooth: Mesh: Add prefix to Subnet Bridge API
Adds the `bt_mesh_brg_cfg` prefix to the public Subnet Bridge API, and
aligns the function and callback naming with the rest of the Bluetooth
Mesh API.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-10-02 14:54:13 +01:00
Alberto Escolar Piedras
d29f2d547b tests/bsim/bluetooth/audio_samples: Error on warnings
Do not override the cmake_args parameter, but instead use the
cmake_extra_args one.
Otherwise we lose the default -DCONFIG_COMPILER_WARNINGS_AS_ERRORS=y

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-10-02 14:53:55 +01:00
Alberto Escolar Piedras
1460ef4419 tests/bsim/compile: Improve cmake_extra_args
Allow cmake_extra_args to contain multiple arguments

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-10-02 14:53:55 +01:00
Fabio Baltieri
f98fde07b3 devicetree: make DT_..._REG_ADDR return unsigned
`DT_..._REG_ADDR` macros do not always return an unsigned value. This
commit adds and unsigned 32bit prefix to ensure the value is always
unsigned.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-10-02 14:41:32 +01:00
Yong Cong Sin
8bfdff3cb1 irq: multilevel: add API to increment a multilevel IRQ
Unlike a normal IRQ, a multilevel IRQ can't be incremented by
simply `irq++`, as that would always increment the L1 of a IRQ,
regardless of its level. A function that understands the level
for which the IRQ operates in is required.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-02 10:08:19 +02:00
Yong Cong Sin
091d70de6b tests: kernel: interrupt: multilevel: test APIs with devicetree
Test multilevel-irq APIs with interrupt number generated from
the devicetree to make sure that they work in sync.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-02 10:08:19 +02:00
Yong Cong Sin
68f56f1c5d tests: gen_isr_table: multilevel: cleanup filter & Kconfigs
The following Kconfigs are always enabled on `qemu_riscv32`:
- CONFIG_MULTI_LEVEL_INTERRUPTS
- CONFIG_2ND_LEVEL_INTERRUPTS
- CONFIG_RISCV_PRIVILEGED

No need to enable/filter for them in the testcase.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-02 10:08:19 +02:00
Yong Cong Sin
d05c9e6037 tests: gen_isr_table: move multilevel test into a separate file
The multilevel IRQ APIs tests are currently cordoned off by
`CONFIG_MULTI_LEVEL_INTERRUPTS` compiler switch, do this more
cleanly by moving it to another file and use cmake for that
instead.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-02 10:08:19 +02:00
Yong Cong Sin
cb6417cff4 irq: multilevel: fix irq_parent_level_3()
The IRQ for level 1 and above is incremented by 1 when encoded
with Zephyr's multilevel IRQ scheme, so it should be
decremented by 1.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-02 10:08:19 +02:00
TOKITA Hiroshi
e5a41c8964 tests: drivers: build_all: sensor: Add CONFIG_MC3419_TRIGGER_NONE
Add missing CONFIG_MC3419_TRIGGER_NONE=y

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-02 10:05:58 +02:00
Andries Kruithof
a63665438a Bluetooth: Audio: improve broadcast reception stop unittest
Add more parameter checking for the unittests for the
CAP procedure 'broadcast reception stop'

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-10-02 09:59:23 +02:00
Andries Kruithof
8295deb966 Bluetooth: Audio: CAP implement broadcast reception stop
Implement the CAP broadcast reception stop procedures and
add unit tests

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-10-02 09:59:23 +02:00
Daniel Leung
84c12ab5b5 boards: rename qemu_xtensa to qemu_xtensa/dc233c
This is in preparation for adding another SoC where qemu_xtensa
is no longer valid choice. So use qemu_xtensa/dc233c as it is
the same as the old qemu_xtensa.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-10-02 09:58:36 +02:00
Raffael Rostagno
26314cf760 tests: clock_control: esp32: Fix device testing
Select modules which are not sensitive for testing.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-10-02 09:52:23 +02:00
TOKITA Hiroshi
e3438585b5 tests: drivers: build_all: sensor: Adding Festo VEAA pressure regulator
Add "festo,veaa-x-3" to testing targets.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-02 09:51:19 +02:00
TOKITA Hiroshi
cc6dfb6220 tests: drivers: build_all: input: Add config for futaba,sbus
Add configuration to add `futaba,sbus` to build test.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-02 09:50:22 +02:00