Commit graph

16700 commits

Author SHA1 Message Date
Chris Friedt
a10f96e153 posix + tests: use CLOCK_REALTIME where specified by POSIX
Use CLOCK_REALTIME for the default clock source throughout
the POSIX implementation and tests so that we are
consistent with the specification.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-24 22:58:43 +02:00
Chris Friedt
3d146aed05 tests: posix: pthread: correct cases for pthread_timedjoin_np()
pthread_timedjoin_np() is allowed to take a negative tv_sec
parameter, since that is still a valid timespec.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-24 22:58:43 +02:00
TOKITA Hiroshi
ee68472082 tests: driver: build_all: led: add AXP192/2101 to tests
Add AXP192/2101 LED controller function driver to build_all test.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2025-04-24 16:53:20 +02:00
Jordan Yates
0b5021aec8 tests: fs: lib_link: add RAM disk overlay
Add a basic RAM disk overlay for libraries that expect at least one disk
driver to be enabled.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-04-24 11:56:57 +02:00
Emil Gydesen
72d9a37159 tests: Bluetooth: Tester: Cleanup includes
Update the includes so that only what is actually used is included,
and so that everything is used is includes (IWYU).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-04-24 10:39:21 +02:00
Lyle Zhu
e454b0d678 Bluetooth: tester: Support board mimxrt1170_evk@B/mimxrt1176/cm7
Add test case bluetooth.general.tester_br_edr.

Add overlay `zephyr,sram` and `zephyr,uart-pipe` for the board.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
Lyle Zhu
539a28312a Bluetooth: tester: Add project configuration for BR
Set following configuration by default,
CONFIG_BT_CLASSIC=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_SMP=y
CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
CONFIG_BT_PAGE_TIMEOUT=0xFFFF

When building the project, the argument `--extra-conf prj_br.conf`
needs to be appended for BR.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
Lyle Zhu
065762cd2d Bluetooth: tester: Add BTP event encryption change
Report encryption change event when callback `le_security_changed` is
triggered.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
Lyle Zhu
424364ded0 Bluetooth: tester: Support l2cap connect rsp insuff secure authen
If the L2CAP connection response of command `listen` is
`BTP_L2CAP_CONNECTION_RESPONSE_INSUFF_SEC_AUTHEN`, set the security
level of L2CAP server to level 4.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
Lyle Zhu
ba55e9d7c0 Bluetooth: tester: Ignore error -EBUSY of bt_conn_set_security
The error code `-EBUSY` of `bt_conn_set_security` means the
pairing/encryption procedure is ongoing. Ignore the error code.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
Lyle Zhu
81b8f8d265 Bluetooth: tester: Add command pair_v2 for BTP GAP
Compare with BTP GAP pair, the pair_v2 add more arguments, including
security mode, security level, and flags.

The argument `security mode` is used to set the security mode.

The argument `security level` is used to set the security level of the
specific security mode.

The argument `flags` is used to add additional setting, such as flag
`BTP_GAP_PAIR_V2_FLAG_FORCE_PAIR` is used to force the pairing
procedure.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
Lyle Zhu
1f73bd7312 Bluetooth: tester: Support BR L2CAP connect and disconnect BTP command
Change the channel id rage of BR L2CAP channel to
`ARRAY_SIZE(channels)` ~ `ARRAY_SIZE(channels) + CHANNELS`. The
unified channel ID can help identify whether the channel is BR or BLE
L2CAP channel.

When the address type of L2CAP connect command is
`BTP_BR_ADDRESS_TYPE`, create BR L2CAP channel connect request.

And if the channel ID falls into the range `ARRAY_SIZE(channels)`
~ `ARRAY_SIZE(channels) + CHANNELS` of L2CAP disconnect command,
create BR L2CAP disconnect request.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
Lyle Zhu
4fdc79d1e3 Bluetooth: tester: Support BR connect and disconnect features
Create BR connect if the address type is `BTP_BR_ADDRESS_TYPE` when
handling BTP GAP `connect` command.

Disconnect BR connect if the address type is `BTP_BR_ADDRESS_TYPE`
when handling BTP GAP `disconnect` command.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
Lyle Zhu
71f81660d4 Bluetooth: tester: Enable GAP discover feature for BR
Call `bt_br_discovery_cb_register` to register discovery callbacks.

Define a buffer br_adv_buf to report br discovery result.

Report device found event if discovery received callback triggered.

Start BR device discovery procedure if command `start_discovery` is
received.

Stop BR device discovery procedure if command `stop_discovery` is
received.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
Lyle Zhu
2cae2622ae Bluetooth: tester: Support pincode request for BR
Set the pin code request callback `auth_pincode_entry`.

If `highsec` is false, call `bt_conn_auth_pincode_entry` with pin code
"0000".
If `highsec` is true, call `bt_conn_auth_pincode_entry` with pin code
"0000000000000000".

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
Lyle Zhu
05d6174c98 Bluetooth: tester: Support BR L2CAP listen mode
If cp->transport is BTP_L2CAP_TRANSPORT_BREDR, register BR L2CAP
server.

If cp->transport is not one of BTP_L2CAP_TRANSPORT_BREDR and
BTP_L2CAP_TRANSPORT_LE, return error code BTP_STATUS_FAILED.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
Lyle Zhu
d083825cee Bluetooth: tester: GAP: Support BR connection
According to the connection type of connection, get the appropriate
peer address.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
Lyle Zhu
4611c402e2 Bluetooth: tester: Support BR for security related commands
Look up the BR connection if the address type is BTP_BR_ADDRESS_TYPE.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
Lyle Zhu
096fbb0c52 Bluetooth: tester: Add BR address type BTP_BR_ADDRESS_TYPE
The address type `BTP_BR_ADDRESS_TYPE=0xe0` of LE address is used to
mark as BR address.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
Lyle Zhu
c667eb5aca Bluetooth: tester: Support connectable mode for classic
Disable connectable mode for classic if `cp->connectable` is false.

Enable connectable mode for classic if `cp->connectable` is true.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
Lyle Zhu
353580a764 Bluetooth: tester: Support general and limited discoverable for classic
Disable discoverable mode if `cp->discoverable` is
`BTP_GAP_NON_DISCOVERABLE`.

Set general discoverable mode if `cp->discoverable` is
`BTP_GAP_GENERAL_DISCOVERABLE`.

Set limited discoverable mode if `cp->discoverable` is
`BTP_GAP_LIMITED_DISCOVERABLE`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
Lyle Zhu
ba44d90a6a Bluetooth: tester: Set setting BREDR and SSP if classic is enabled
Set the supported settings `BTP_GAP_SETTINGS_BREDR` and
`BTP_GAP_SETTINGS_SSP` if the Bluetooth classic is enabled.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-24 10:38:45 +02:00
S Swetha
cbc5fdbb4b tests: kernel: spinlock: Increase lock contention
This commit resolves lock contention
issues by increasing the probablity of
contention during the test execution.

Increased wait delay when lock is taken
and Reduced wait delay when the lock is
released.

Achieved 99% lock contention probablity,
verified through runtime metrices.

Signed-off-by: S Swetha <s.swetha@intel.com>
2025-04-24 01:27:00 +02:00
Derek Snell
699ebb3623 doc: tests: drivers: i2c_target_api: correct comments for frdm_mcxn947
Corrects GPIO signal names shorted together for this test.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2025-04-23 17:54:43 +02:00
Greg Leach
2aff40b1b1 tests: Add BL54L15/L15u DVK support
Adds support for the BL54L15 and BL54L15u DVK boards.

Signed-off-by: Greg Leach <greg.leach@ezurio.com>
2025-04-23 15:02:20 +02:00
Khoa Nguyen
5d0f4e3677 tests: drivers: flash: common: Fixing the overlap case
For the flash with the block size equal to or smaller than 64 bytes,
using a specific "32" bytes for adding for destination_offset and "32"
bytes for subtracting the size that need to copy is not correct.

As a solution, I will add one-fourth of a block size for the
destination_offset and modify the size that need to copy to
[block size + one-fourth of a block size].

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-04-23 10:04:02 +02:00
Luis Ubieda
150cd56643 tests: build_all: sensor: Add ICM45686 as an I2C device
To validate build-time functionality.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-04-23 02:15:34 +02:00
Christoph Winklhofer
3b29b9fa3b tests: logging: restore userspace testing
Restore userspace testing that was removed with commit 'aa2b72d32a
(tests: logging: remove userspace testing, 2024-04-10)' and reported in
the issue #49213.

For the tests running with threads in user space (with ZTEST_USER),
the memory partitions are configured in the test-suite setup.

Signed-off-by: Christoph Winklhofer <cj.winklhofer@gmail.com>
2025-04-23 02:15:25 +02:00
Marvin Ouma
83aafaf1ae tests: posix: xsi_realtime: move more tests into xsi_realtime
move tests with _POSIX_PRIORITY_SCHEDULING Option to
xsi_realtime testsuite

Signed-off-by: Marvin Ouma <pancakesdeath@protonmail.com>
2025-04-23 02:15:17 +02:00
Gudipudi Ramana Kumar
aafcd4f851 bluetooth: audio: Update bad code in BASS to be v1.0.1 compliant
Bad Broadcast Code in BASS/Scan Delegator if BIG_Encryption
field value = 0x03 (Bad_Code), Bad_Code shall be set to the
value 0xFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF according to BASS v1.0.1

Signed-off-by: Gudipudi Ramana Kumar <gudipudiramanakumar@gmail.com>
2025-04-22 16:53:49 +02:00
Anas Nashif
c2c3f7570f tests: lib: fix doxygen groups
Group test using doxygen and general fixes to structure.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-22 14:03:29 +02:00
Anas Nashif
e5f841c183 tests: kernel/arch: various doxygen fixes
Group test using doxygen and other doxygen fixups.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-22 14:03:29 +02:00
Anas Nashif
29b1131f66 doc: Create dox file for tests
Create top level doxygen groups to be used by tests and move to
dedidcated dox file for tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-22 14:03:29 +02:00
Anas Nashif
feaf9893cc tests: fatal: group fatal tests
Group test using doxygen.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-22 14:03:29 +02:00
Anas Nashif
a816bfdfec test: kenrel: group sleep tests
Group test using doxygen.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-22 14:03:29 +02:00
Anas Nashif
39b1312392 tests: kernel: mbox: fix doxygen grouping
Fix grouping and general doxygen fixups.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-22 14:03:29 +02:00
Anas Nashif
70b2b952db tests: events: fix doxygen groups
Fix grouping and general doxygen fixups.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-22 14:03:29 +02:00
Anas Nashif
bb8b76094f tests: semaphore: fix doxygen groups
Fix grouping and general doxygen fixups.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-22 14:03:29 +02:00
Anas Nashif
4ca7c14eab tests: kernel: fix doxygen comments/groups for condition variables
Fix grouping and general doxygen fixups.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-22 14:03:29 +02:00
Anas Nashif
7b3ed2fbb4 tests: kernel/common: cleanup doxygen
Fix grouping and general doxygen fixups.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-22 14:03:29 +02:00
Anas Nashif
7d36a18b7b tests: kernel: fix kheap doxygen groups
Fix grouping and general doxygen fixups.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-22 14:03:29 +02:00
Anas Nashif
d837b644dd tests: kernel: threads: improve doxygen comments, layout
Fix grouping and general doxygen fixups.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-22 14:03:29 +02:00
Chris Friedt
9535a69af8 tests: posix: semaphores: ensure test is not skipped
Commit f7633a55aa moved the tests for the
POSIX_SEMAPHORES Option Group from the tests/posix/common testsuite to
its own dedicated testsuite.

However, there was a copy-paste error. Previously, tests would have been
run only once when dynamic threads were enabled, and then skipped when
dynamic threads were disabled, since that follows the posix programming
model better. However, dynamic threads were never actually enabled after
moving to the new testsuite. So all tests were effectively skipped.

Add the necessary options to prj.conf in order to ensure that there are
sufficient dynamic threads available to run the testsuite.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-22 14:03:10 +02:00
Chris Friedt
a08240ba0d tests: posix: semaphores: coalesce string constants
Just a formatting change, in a separate commit.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-22 14:03:10 +02:00
Chris Friedt
c2609155b3 tests: posix: semaphores: reduce execution time by 5s
There is no reason to use a 5s wait time in tests. This can add up quite
significantly across multiple platforms that execute in real-time under
qemu (or even just on real hardware).

Speedup observed with qemu_cortex_a53/qemu_cortex_a53/smp

Before:
```
START - test_named_semaphore
 PASS - test_named_semaphore in 5.688 seconds
```

After:
```
START - test_named_semaphore
 PASS - test_named_semaphore in 0.783 seconds
```

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-22 14:03:10 +02:00
Dylan Hsieh
f3bc550117 driver: adc: add adc driver for rts5912
Add adc driver for Realtek rts5912.

Signed-off-by: Dylan Hsieh <dylan.hsieh@realtek.com>
2025-04-22 14:02:37 +02:00
Tahsin Mutlugun
e219da1ff6 tests: i2c_ram: rtio: Ensure completion queue events get released
Release completion queue events left over from the previous test and
make sure a completion queue event gets released after it is consumed.
Otherwise newer cqes may be unable to be submitted due to completion
queue being full.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2025-04-22 12:10:12 +02:00
Anders Nielsen
b98bd7c145 drivers: stepper: adi_tmc: Add tmc51xx support
Add tmc51xx support based on tmc50xx implementation.

Signed-off-by: Anders Nielsen <anders.nielsen@prevas.dk>
2025-04-22 12:09:18 +02:00
Lyle Zhu
c5429d3204 tests: Bluetooth: Classic: Add dedicated test case for no_blobs
Add dedicated test case `bluetooth.classic.sdp.server.no_blobs` and
`bluetooth.classic.sdp.client.no_blobs` with the extra argument
`CONFIG_BUILD_ONLY_NO_BLOBS=y` and `build_only: true` to make sure the
tests sdp_s and sdp_c can be passed by Zephyr CI.

Fixes #88060.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-22 09:58:47 +02:00
Jordan Yates
8c7e9a5f6c tests: sensor: generic: test new conversions
Add tests for `sensor_value_to_deci` and `sensor_value_to_centi`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-04-22 04:33:14 +02:00