Commit graph

11602 commits

Author SHA1 Message Date
Szymon Janc 4c269d0d61 tests: bluetooth: tester: Increase BT RX thread stack
Default stack size if not enought and was causing MPU faults.
This was affecting GATT/SR/GAW/BV-14-C qualification test case.

<dbg> bttester_gatt: gatt_db_add: handle 0x0000
<err> os: ***** MPU FAULT *****
<err> os:   Stacking error (context area might be not valid)
<err> os:   Data Access Violation
<err> os:   MMFAR Address: 0x2000aa38
<err> os: r0/a1:  0x00000000  r1/a2:  0x00000000  r2/a3:  0x00000000
<err> os: r3/a4:  0x00000000 r12/ip:  0x00000000 r14/lr:  0x00000000
<err> os:  xpsr:  0x00000000
<err> os: Faulting instruction address (r15/pc): 0x00000000
<err> os: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
<err> os: Current thread: 0x20002d28 (BT RX)
<err> os: Halting system

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2023-10-10 11:18:11 +02:00
Fabio Baltieri cf75c88a61 tests: newlib/thread_safety: exclude acrn_ehl_crb from more tests
This was already excluded from
libraries.libc.newlib_nano.thread_safety.userspace.stress and it's now
failing in libraries.libc.newlib.thread_safety.userspace.stress as well.

The issue is being rootcaused to a toolchain issue but a proper fix has
not been identified yet, exclude that test as well in the meantime.

Link: https://github.com/zephyrproject-rtos/zephyr/issues/61129
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-10-10 09:05:02 +01:00
Aaron Massey 32b27384a6 fuel_gauge: Fix desired current/voltage units
The desired current/voltage properties make use of milliamps/volts while
the present current/voltage properties make use of microamps/volts.

Fix the desired current/voltage properties to be consistent with the
present current/voltage properties where they're most likely to be used
with.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2023-10-09 19:01:49 +03:00
Emil Gydesen ab15043b72 tests: Bluetooth: BAP Broadcast source id and BASE unit tests
Add unit test to test the get_id and get_base functions.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-10-09 16:11:05 +03:00
Håvard Reierstad 5969ad7811 bsim: Bluetooth: mesh: Implement CDP1 test
Adds bsim test to verify that composition data page 1 (CDP1) is
encoded and decoded correctly.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2023-10-09 15:06:06 +03:00
Pavel Vasilyev 94bd09b1f8 tests: bluetooth: tester: Fix prov ctx init in PTS tests
This fixes regression introduced in
https://github.com/zephyrproject-rtos/zephyr/pull/63556

In the PR above `bt_mesh_init()` call was moved to `BTP_MESH_INIT`
command to allow to select alternative composition data when starting
the stack. AutoPTS sends `BTP_MESH_CONFIG_PROVISIONING` command
before `BTP_MESH_INIT` to prepare the provisioning context. But
because `bt_mesh_init()` is now called after
`BTP_MESH_CONFIG_PROVISIONING` command is sent, this configuration is
reset to the default which makes PTS tests to fail.

To solve this, this commit calls introduces a new command,
`BTP_MESH_START`, which will replace the original `BTP_MESH_INIT`
command. `bt_mesh_init()` will stay in `BTP_MESH_INIT` while the stack
will be started in `BTP_MESH_START` command.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-09 14:56:58 +03:00
Martin Åberg 7a9600816a tests: posix: Enable pthread_pressure test on SPARC
This sets the stack size appropriate for SPARC. Tested on the board
configurations qemu_leon3 and gr716a_mini.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2023-10-08 11:24:19 +01:00
Keith Packard 1b057d6295 tests/timer_api: Make sure constant time conversions are constants
When the timer frequency is known at compile time, make sure we can use any
time conversion macro as a global initializer.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-10-06 20:05:07 +03:00
Anders Storrø 2e3ae017e3 tests: Bluetooth: Mesh: LCD test all comp pages
Adds test for verifying split get operation for all
composition data pages.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-10-06 16:21:02 +03:00
Pavel Vasilyev 0eb027ab7c tests: bluetooth: tester: Fix self-update test DFU/SR/FD/BV-59-C
DFU/SR/FD/BV-59-C tests Distributor self-update. Because the actuall
firmware swapping doesn't happen, we need to just simulate the swapping
by setting new Firmware ID sent by LT. We use slot to take firmware id
as by procedure, Fw Update Server doesn't know about it.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-06 16:20:14 +03:00
Henrik Eriksen f977457c07 bluetooth: tester: pacs: Added set Locations and Contexts.
- Set Locations.
- Set Available Contexts.
- Set Supported Contexts.

Signed-off-by: Henrik Eriksen <heri@demant.com>
2023-10-06 16:15:54 +03:00
Seppo Takalo 5dcaf267fb net: lwm2m: Add Docker based test script
Add Docker based test script for LwM2M interoperability test.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-10-06 16:14:39 +03:00
Ingar Kulbrandstad a5d15ec017 Bluetooth: Mesh: Fixed issue with RPR server and client.
Fixed issue when reprovisioning is done on a device with
both RPR client and server on the same device.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2023-10-06 16:06:12 +03:00
Andries Kruithof e04c963d9c Test: Bluetooth: controller: add CI testing for advertising chaining
Update babblesim tests for testing chaining for advertising to ensure that
we spill over to the next PDU

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-10-06 16:04:11 +03:00
Andries Kruithof d00d44c925 Bluetooth: controller: fix failing EBQ advertising tests
Updates the chaining for advertising.
Instead of unconditionally adding a new PDU when new data
is added we now instead fill the last PDU in the chain with
the incoming data, only adding a new PDU when there is
not enough room.

This reduces the nr. of PDUs used for advertising, and also
fixes some qualification failures

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-10-06 16:04:11 +03:00
Carles Cufi a5e7ba3564 Bluetooth: Controller: Remove legacy BT_CTLR_FAST_ENC option
When the legacy LLCP implementation was removed this Kconfig option was
mistakenly left over. Remove it now with all its users.

Fixes #63212.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-10-06 13:32:33 +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
Pavel Vasilyev 8b4994f22f tests: bluetooth: tester: Allow to pass int instead of bool in comp cmd
This will allow to choose more variants of cdp in future if needed.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-06 09:16:39 +02:00
Grant Ramsay 1951d83783 tests: timer_monotonic: Add mps2_an385 test with icount disabled
This is to validate that GH-48608 is fixed
and stays fixed.

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2023-10-05 15:30:20 +01:00
Yong Cong Sin 019ae15f05 tests: kernel: work: fix uninitialized timer's work item
The `test_1cpu_drain_wait` tests iff the thread of a work queue
that is waiting to be drained can submit work item to the
queue. A timer is created with a callback funciton to submit a
work item to the same queue, to help demonstrate that behavior.

However, the work item submitted by `test_drain_wait_cb` to the
`coophi_queue` isn't initialized, and can hit assertion if it
is processed by the work queue.

Fixes #63559

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-10-05 13:43:07 +01:00
Pavel Vasilyev bd82ff245a tests: bluetooth: tester: Remove comp_alt_set command
Remove this command as composition can only be set in bt_mesh_init call
which is called before settings are loaded.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-05 11:08:05 +02:00
Pavel Vasilyev 2445e55cd4 tests: bluetooth: tester: Move bt_mesh_init call to BTP_MESH_INIT cmd
In some RPR tests we need to pass alternative composition data when
testing CDP128. When bt_mesh_init is called from mesh service
registration callback, we can't pass any arguments. Therefore we need
to move bt_mesh_init call out from mesh service registration to
BTP_MESH_INIT command.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-05 11:08:05 +02:00
Daniel DeGrasse 14d88c6dc8 tests: drivers: flash: remove platform_allow filter
Prior to commit 903a79431, drivers.flash.common.default would have
executed on any platform that passed the filter condition. With the
addition of the platform_allow filter, this is no longer the case, and
is masking issues such as those seen in #62963. Remove the
platform_allow filter to return this test to the previous behavior.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-10-05 09:39:38 +01:00
Martin Åberg ccbbb493da tests: kernel: Add qemu_leon3 to no-multithreading tests
Add qemu_leon3 target to the tests that list below. These set
CONFIG_MULTITHREADING=n.

- tests/kernel/mem_heap/mheap_api_concept
- tests/kernel/mem_slab/mslab_api
- tests/kernel/threads/no-multithreading
- tests/kernel/timer/timer_api

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2023-10-05 09:37:10 +01:00
Alperen Şener 85fa412201 bluetooth: tester: add support for variable static oob size
Adding variable static auth size support to be compatible
both mesh 1.0.1 and mesh 1.1.

Signed-off-by: Alperen Şener <alperen.sener@nordicsemi.no>
2023-10-05 09:20:33 +02:00
Mateusz Kapala 3c0c634340 bluetooth: tests: Improve bondable_per_connection bsim test
Added fail on pairing_failed callback for both central and peripheral.
Added pairing status checks in peripheral.

It has been done to test the case when multi-role BT device tried to
pair without bonding (peripheral role) while already previously bonded
with the same device on another Bluetooth identity as it seems that
there was an issue with it previously.

Signed-off-by: Mateusz Kapala <mateusz.kapala@nordicsemi.no>
2023-10-04 14:53:26 +01:00
Daniel DeGrasse dbdbc64d94 tests: drivers: regulator: clean up testcase.yaml for voltage test
Clean up testcase definition for voltage test, by moving the
LPCXpresso55s36 board overlay file into the boards/ folder of the test,
as well as adding a fixture to the testcase so that it will only be
executed on properly configured boards.

Fixes #62884

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-10-04 14:52:40 +01:00
Yong Cong Sin 8db1a5add2 drivers: intc: plic: support trigger type by default and hardcode offset
Removing the edge-trigger Kconfig as it is supported by default
in the RISCV PLIC specifications.

Define the edge-trigger register offset in the driver instead
of retrieving the value from devicetree as it is not something
configurable. The value 0x1080 is defined in Andes & Telink
datasheets.

Updated build_all testcase.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-10-04 09:06:28 -04:00
Fabio Baltieri ecefcd7f87 misc: check_init_priorities: drop CONFIG_DEVICE_DEPS=y
This runs fine without CONFIG_DEVICE_DEPS, let's drop it from here.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-10-04 12:19:06 +01:00
Juha Ylinen 22f09e9fa0 net: coap: release non-confirmable messages
Only confirmable messages need pending tracking. Non-confirmable
messages are released after sending.
Match incoming packets with token, not message ID.
Ignore responses with non-matching tokens.
Remove unused function send_reset().

Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
2023-10-04 11:25:16 +02:00
Robert Lubos 1b21109c2c net: lwm2m: Reset ongoing notification in case token changes
In case observation token changes (the LwM2M server re-sends
observation request to the client), the LwM2M engine should cancel any
ongoing notifications based on the old token. Otherwise, it will be
impossible to match the pending notification reply (ACK) with the
observer context anymore, causing new notifications for this
observation to stall.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-10-04 11:23:53 +02:00
Flavio Ceolin 15aa3acaf6 kconfig: Remove MP_NUM_CPUS usage
Zephyr's code base uses MP_MAX_NUM_CPUS to
know how many cores exists in the target. It is
also expected that both symbols MP_MAX_NUM_CPUS
and MP_NUM_CPUS have the same value, so lets
just use MP_MAX_NUM_CPUS and simplify it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-03 17:45:53 +01: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
Kieran Tyrrell a714b42080 net: ip: fix promiscuous mode altering packets
Always clone net_pkt to pass to promiscuous queue.
Previously, net_pkt was passed to L2 before conditionally cloning.
But L2 would in some cases strip ethernet headers, so cloned
net_pkt received through promiscuous interface would be missing headers.

Signed-off-by: Kieran Tyrrell <kieran@sienda.com>
2023-10-03 15:10:57 +01:00
Maureen Helm 00d03fe942 tests: drivers: build_all: Add adin2111 to ethernet driver build test
Ensures that the eth_adin2111 driver builds for both of its supported
devicetree compatibles by adding adi,adin2111 and adi,adin1110
compatible nodes to the ethernet driver build test.

Sets relevant device device driver initialization priorities to be
equal, allowing devicetree dependency ordinals to determine the
initialization sequence.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2023-10-03 15:10:12 +01:00
Emil Gydesen e67d6c2fa4 tests: bsim: Bluetooth: Remove broadcast_source_stop_inval
Removed the tests for invalid bt_bap_broadcast_source_stop
parameters and state, as those tests now implemented as unit tests.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-10-03 14:28:19 +01:00
Emil Gydesen 6c12ed18ad tests: Bluetooth: Add inval testing of bt_bap_broadcast_source_stop
Add invalid parameter and state testing of bt_bap_broadcast_source_stop

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-10-03 14:28:19 +01:00
Andrei Emeltchenko ca1de2fc39 tests: btp_mesh: Check correct error code
Check actual error code.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-10-03 09:21:40 +02: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
Alberto Escolar Piedras 55940f701c tests bsim: Limit parallel build
The compile script had been modified
to fully parallelize all images builds
in 1de363d9d5

And has been kept building everything in parallel since then.
Over time we have seen an increase in the number of hangs
for this job in CI.
This is understood as being the result of the number of images
having increased, leading to a too high load
on the worker machines which cause them to timeout their
connection to the github CI scheduler.

In b83a828825
these jobs priority was lowered to aleviate this issue,
but again we see an increased number of CI runner
disconnects.

Let's parallelize this compile jobs a bit less.
With this change, we do not build anymore the sets of
host ll and mesh test images in parallel but sequencially.
On a local test this reduces peak load from
~1700 to ~700, and eliminates issues with system
unresponsiveness; while there is no statistically measurable
increase in overall build time.
Note that the single audio image is still built in parallel
to the other 3 sets, as this was seen to improve total
build time by 2 seconds out of 1m51s.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-02 15:54:10 +03:00
Vinayak Kariappa Chettimada a178aa9855 Bluetooth: Controller: Review rework flush timeout support
Review rework changed related to flush timeout support.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-10-02 10:00:27 +02:00
Vinayak Kariappa Chettimada 27c92fe238 tests: bsim: Bluetooth: Test RTN=2, FT=2, Cen skip 4 SE in Controller
Test RTN=2, FT=2 in Controller with 4 subevents dropped by
central.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-10-02 10:00:27 +02:00
Vinayak Kariappa Chettimada 291cd03818 tests: bsim: Bluetooth: Test RTN=2, FT=2, Cen skip 2 SE in Controller
Test RTN=2, FT=2 in Controller with 2 subevents dropped by
central.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-10-02 10:00:27 +02:00
Vinayak Kariappa Chettimada a7d2fdd02b tests: bsim: Bluetooth: Test RTN=2, FT=2, Per skip 4 SE in Controller
Test RTN=2, FT=2 in Controller with 4 subevents dropped by
peripheral.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-10-02 10:00:27 +02:00
Vinayak Kariappa Chettimada 2935d3b731 tests: bsim: Bluetooth: Test RTN=2, FT=2, Per skip 2 SE in Controller
Test RTN=2, FT=2 in Controller with 2 subevents dropped by
peripheral.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-10-02 10:00:27 +02:00
Manuel Argüelles d044dfe7e9 tests: error_hook: skip test_catch_fatal_error for Armv8-R
Skip `test_catch_fatal_error` test case for Armv8-R because
divide by zero trapping is not supported on this architecture.

Fixes #63268

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-10-02 09:40:25 +02: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
Andriy Gelman 1211d778ac tests: drivers: build_all: can: Add mcp251xfd test case
Adds build test case for mcp25xxfd with arduino_uno_click and
mikroe_mcp2518fd_click shield.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-10-01 09:20:37 +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
Anas Nashif e19f21cb27 kernel: move z_is_thread_essential out of public kernel header
This is a private API to the kernel, so move out of kernel.h

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-09-30 18:43:28 +02:00