Commit graph

14145 commits

Author SHA1 Message Date
Pieter De Gendt
1e6f39e91b tests: kconfig: functions: Fix arithmetic typo
Moved the test to a single main file, fixed a typo
arithmetric -> arithmetic

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-08-02 13:41:07 +02:00
Vinayak Kariappa Chettimada
bc4442ece7 tests: bsim: Bluetooth: Host: Fix RPA expired old time value
Fix RPA expired old time value used for rotation timeout
validation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-08-02 13:40:59 +02:00
Mark Holden
c35f6d1cac coredump: Add test for threads core dump config
Add z_test which uses new configs to capture multiple
threads in a core dump and with all of the context
necessary to debug the threads.

Signed-off-by: Mark Holden <mholden@meta.com>
2024-08-02 03:32:09 -04:00
Anke Xiao
bdaeab3537 tests: drivers: uart: uart_basic_api: add configuration for frdm_ke17z512
Add uart configuration for UART driver, add frdm_ke17z512_uart.overlay
and update testcase.yml to support UART testing.
There are LPUART and UART IPs in frdm_ke17z512 platforms, so add
additional shell tests as UART, the shell instructions can be entered
on the UART console window.

Signed-off-by: Anke Xiao <anke.xiao@nxp.com>
2024-08-02 03:31:38 -04:00
Chris Friedt
91e0a4b9ac misc: move lorem ipsum text to zephyr/misc/lorem_ipsum.h
Instead of duplicating Lorem Ipsum in several places, let's
consolidate in one location.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-08-02 03:31:06 -04:00
Peter Mitsis
1bb5f3a52b tests: kernel: Add ISR tests for k_thread_priority_set()
Adds tests demonstrating k_thread_priority_set() being called
from the context of an ISR.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-08-02 03:29:55 -04:00
Jonathan Rico
08706f98bc Bluetooth: adapt l2cap/userdata test
Modify the test so it checks that user_data is used and then cleared by
the stack.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-08-01 16:49:37 +01:00
Jordan Yates
21a6d5608b tests: unit: list: test "safeness" of safe iteration
Add tests for removing and adding nodes to a list under
`SYS_SLIST_FOR_EACH_NODE_SAFE` and `SYS_SLIST_FOR_EACH_CONTAINER_SAFE`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-08-01 16:41:16 +02:00
Andrej Butok
7a1c286f5c tests: flash: erase_blocks: Add support of flash program size > 128
Fix failed test for platforms with flash program size > 128 bytes.
Update supported program size to 512 bytes, the highest supported
program size by Zephyr platforms.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-08-01 16:40:53 +02:00
Robert Lubos
9764755bf8 tests: net: http_server: tls: Reduce test memory footprint
Tweak some Kconfig variables to reduce the overall memory footprint of
the test application. For some reason x86 MMu throws errors when
accessing iterable section entries when the image size is too large.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-08-01 16:40:03 +02:00
Jonathan Rico
11b3aa1f1f tests: Bluetooth: Add multi-central robustness test
This test's purpose is to verify we (as a peripheral) don't leak resources
when communicating with multiple centrals that connect and disconnect
intermittently.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-08-01 12:38:36 +02:00
Tahsin Mutlugun
387239e667 tests: i2c: i2c_target_api: Add configuration for MAX32680EVKIT
Enable I2C target API tests for MAX32680EVKIT.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2024-08-01 12:36:14 +02:00
Furkan Akkiz
f3953351c7 tests: drivers: i2c: Add MAX32672EVKIT overlay file
Enable I2C test for MAX32672EVKIT.

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
2024-08-01 12:36:14 +02:00
Mert Ekren
3d4490caed tests: drivers: i2c: Add MAX32670EVKIT overlay file
Enable I2C test for MAX32670EVKIT.

Signed-off-by: Mert Ekren <mert.ekren@analog.com>
2024-08-01 12:36:14 +02:00
Tahsin Mutlugun
e396ff82a1 tests: i2c: i2c_target_api: Add configuration for MAX32655EVKIT
Enable I2C target API tests for MAX32655EVKIT.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2024-08-01 12:36:14 +02:00
Szymon Janc
89b129742d tests: bluetooth: tester: Enable DIS service
Previously autopts was incorrectly using GATT server service to
construct DIS.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-08-01 09:13:55 +01:00
Jacob Winther
b6ed4ba761 boards: Add Adafruit Feather nrf52840 Sense
Add support for board based on the Express variant.
Board uses uf2 as it has no swd adaptor.

Signed-off-by: Jacob Winther <jacob@9.nz>
2024-08-01 09:11:11 +01:00
Jacob Winther
4e830ec19f boards: rename adafruit_feather
Adafruit feather is a generic name that could match many
boards. Renamed to reflect actual board name:
- Adafruit Feather nrf52840 Express

There are two boards based on the nrf52840, so keeping directory
generic to support additional board defs with mostly shared dts.

Signed-off-by: Jacob Winther <jacob@9.nz>
2024-08-01 09:11:11 +01:00
Emil Gydesen
1b83555d4c Samples: Bluetooth: CAP Initiator broadcast support
Add broadcast support to the CAP initiator sample.

This adds new sample-specific Kconfig options to help
select the right Kconfig options based on whether
unicast, broadcast or both is being used.

This also moves common TX functionality
to cap_initiator_tx to reuse the same TX thread
and functionality.

Finally there is a babblesim implemented for
the broadcast. There is not broadcast support for the
CAP acceptor sample yet, so this test only verifies that we
get the TX complete events from the controller.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-08-01 08:53:08 +01:00
TOKITA Hiroshi
e31588fcca tests: kconfig: Add tests for Kconfig arithmetrics
Add tests about kconfig function for arithmetric.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-07-31 12:56:25 +02:00
Piotr Krzyzanowski
de664204a7 tests: drivers: pwm: extend test coverage
Extend nrf pwm driver test coverage by testing invalid port number

Signed-off-by: Piotr Krzyzanowski <piotr.krzyzanowski@nordicsemi.no>
2024-07-31 12:55:58 +02:00
Fabio Baltieri
61129d8fd2 input: longpress, keymap: use an explicit callback name
Use an explicit callback name so that multiple instances of this do not
result in a:

redefinition of '_input_callback__longpress_cb'

error. This used to work when it was using unique generated wrappers,
but now it needs an index in the callback name.

Use it in one of the API tests as well, just in case.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-07-31 12:55:11 +02:00
Fabio Baltieri
716fa268f4 input: add a user_data pointer to the callback
Add a void *user_data pointer to the input callback structure. This is
useful for driver to get back the driver data structure and avoid
defining wrapper functions.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-07-31 12:55:11 +02:00
Emil Gydesen
427e506d5c tests: Bluetooth: Remove .bls files
The .bls files are no longer useful after the BT SIG switched
qualification tool. This will still remain in the git history
and can safely be removed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-07-31 12:40:24 +02:00
Gerhard Jörges
1eed39e4ac tests: net: http_server: Add static fs tests
Add a test that checks whether the extensions are correctly assigned to
content types.

Signed-off-by: Gerhard Jörges <joerges@metratec.com>
2024-07-31 10:08:16 +02:00
Fabian Pflug
055800ba76 net: l2: ieee802154: test association permit bit
Beacon frames can be received with association permit bit set or not,
but the correct information should be in the data given to the
application.

Signed-off-by: Fabian Pflug <fabian.pflug@grandcentrix.net>
2024-07-31 10:08:03 +02:00
Fabian Pflug
240223971f net: l2: ieee802154: decrease time for testcase
When trying to implement a testcase for the previous commit, an error
occoured, that stopped the test from executing.

As the tests require a full IPv6 stack, the usual router solicitation
(RS) messages will be scheduled by the net stack. To avoid conflict
with RS messages the active scan test must be kept shorter than one
second, otherwise a race condition with additional packages being
reported by the fake driver might occur.

Signed-off-by: Fabian Pflug <fabian.pflug@grandcentrix.net>
2024-07-31 10:08:03 +02:00
Robert Lubos
3eafc19835 tests: net: http_server: Remove harness requirement
The HTTP server tests are self-contained, they do not require network
environment to execute, hence should not specify "harness: net".

The consequence of specifying the harness was that HTTP server tests in
the CI were only built, and not executed, which doesn't make much sense.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-30 18:30:36 +01:00
Rubin Gerritsen
063cf397ed bluetooth: controller: Enable data length update in ctrl_collision test
The test expects this feature to be enabled.
We should therefore enable explicitly instead of relying on
default values.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-07-30 18:30:22 +01:00
Anke Xiao
ef10a9b23b tests: drivers: gpio: gpio_basic_api: add ke17z overlay file
Add frdm_ke17z_fgpio.overlay to add fgpio configuration, and
add update testcase.yml to add FGPIO driver test for frdm_ke17z
and frdm_ke17z512 platforms.
Updated ke17z512 gpio test pins to avoid conflicts with I2C pin.

Signed-off-by: Anke Xiao <anke.xiao@nxp.com>
2024-07-30 18:28:43 +01:00
Pieter De Gendt
0b453c6cdc tests: drivers: uart: uart_emul: Add device emulation test
Add an emulated UART device test case. Demonstrate using the
zephyr,uart-emul bus for passing data to an emulated implementation for a
UART device driver.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-30 18:28:17 +01:00
Pieter De Gendt
8bbb88999b tests: drivers: uart: uart_emul: Fix RX remaining check
The UART interrupt emulation test checks the wrong variable for remaining
RX bytes.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-30 18:28:17 +01:00
Pieter De Gendt
92019b1dac emul: Support UART device emulation
Add support to the existing UART emulated bus, to have a client device
emulator.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-30 18:28:17 +01:00
Rubin Gerritsen
bfc0cdc905 Bluetooth: Conditionally print out HCI error codes as strings
When developing Bluetooth applications, you typically run into
some errors. If you are an experienced Bluetooth developer,
you would typically have an HCI error lookup table in your memory.
Others might not.

This commit utilizes defines CONFIG_BT_DEBUG_HCI_ERR_TO_STR
and utilizes bt_hci_err_to_str() to print out HCI error strings
when enabled to improve the user experience.

Several alternatives where considered. This approach was chosen
as it had the best balance between readability, code size, and
implementation complexity.

The alternatives are listed below as a reference.

1. Macro defined format specifier:

```c
  #define HCI_ERR_FMT "%s"
  #define BT_HCI_ERR_TO_STR(err) (err)
  #define HCI_ERR_FMT "%d"
  #define BT_HCI_ERR_TO_STR(err) bt_hci_err_to_str((err))

LOG_INF("The event contained " HCI_ERR_FMT " as status",
	BT_HCI_ERR_TO_STR(err));
```
Advantage: Space efficient: Code size does not increase
Disadvantage: Code becomes hard to read

2. Format specifier to always include both integer and string:

```c
static inline const char bt_hci_err_to_str(err)
{
	return "";
}

LOG_INF("The event contained %s(0x%02x) as status",
	bt_hci_err_to_str(err), err);
```

Advantage: Simple to use, implement, and read,
Disadvantage: Increases code size when CONFIG_BT_DEBUG_HCI_ERR_TO_STR
is disabled. The compiler seems unable to optimize away the unused
format specifier. Note: The size increase is only present when
logging is enabled.

3. Always print as string, allocate a stack variable when printing:

```c
const char *bt_hci_err_to_str(char *dst, size_t dst_size, uint8_t err)
{
  snprintf(dst, dst_size, 0x%02x, err);
  return dst;
}

LOG_INF("The event contained %s as status", BT_HCI_ERR_TO_STR(err));
```

Advantage: Very easy to read.
Disadvantage: Printing error codes becomes slow as it involves calling
snprint.

4. Implement a custom printf specifier, for example E.

   This requires a global CONFIG_ERR_AS_STR as I assume we cannot have
   one specifier for each type of error code.
   Also, I assume we cannot start adding specifiers for each subsystem.

```c
  #define BT_HCI_ERR_TO_STR(err) (err)
  #define BT_HCI_ERR_TO_STR(err) bt_hci_err_to_str((err))

LOG_INF("The event contained %E as status", BT_HCI_ERR_TO_STR(err));
```

Advantage: Both efficient code and readable code.
Disadvantage: This requires a global CONFIG_ERR_AS_STR as I assume
we cannot have one specifier for each type of error code.
Also, I assume we cannot start adding specifiers for each subsystem.
That is, this approach is hard to implement correctly in a scalable
way.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-07-30 18:25:56 +01:00
Emil Gydesen
a94bfe03a4 tests: Bluetooth: Audio: Move role specific mocks files
For the LE Audio unittests there exists a few mock files
that implement mock versions, or callbacks, for some of the
roles and features tested.

These have been moved to where they are actually used,
reducing the scope of these files.

This both allows the individual tests to implement their own
versions of it, but more importantly it prevents issues when
adding tests for these roles. For example, due to the
bap_unicast_client.c mock file, it is impossible to implement
unit tests for the unicast client, as the functions are already
defined.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-07-30 18:25:47 +01:00
Tomi Fontanilles
48d69b4e7e tests: modem: cmux: add missing timeout param
Add the missing timeout parameter to `modem_pipe_open()` and
`modem_pipe_close()` calls.
10 seconds is the default value used in the Zephyr tree.

Fixes a regression introduced in
https://github.com/zephyrproject-rtos/zephyr/pull/74325.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-07-30 11:44:04 +02:00
Dominik Ermel
1b5f986404 tests/stream_flash: Replace one-line config overlays with extra_configs
The commit removes one-line overlay files, when copyrights excluded,
with direct Kconfig options selection inside testcase.yaml.
The overlays have been removed.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-07-29 14:23:11 +02:00
Miguel Gazquez
26be1da3e7 drivers: sensor: add driver for lsm9ds1 sensor
The LSM9DS1 is a system-in-package featuring
a 3D digital linear acceleration sensor, a 3D digital angular rate
sensor and a 3D digital magnetic sensor.

This driver implements only the linear acceleration sensor and the
angular rate sensor, on the I2C bus.

This driver is without trigger support.

The driver is based on the stmemsc HAL.

link: https://www.st.com/resource/en/datasheet/lsm9ds1.pdf

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
2024-07-29 14:21:24 +02:00
Bjarki Arge Andreasen
372c7183ef modem: pipe: Add explicit timeout to sync APIs
The modem pipe APIs include synchronous calls to open/close,
which internally use a fixed timeout of 10 seconds. The timeout
should be configurable through the APIs, anywhere from K_NO_WAIT
to K_FOREVER.

This commit adds timeout parameters to the open/close APIs, and
updates in-tree usage of the open/close APIs to explicitly
provide the previously implicit timeout of 10 seconds.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-07-29 14:14:42 +02:00
Yong Cong Sin
def7f37c83 tests: posix: unistd_h: mark fsync() & ftruncate() as supported
These functions have been supported, update the test
accordingly.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-07-29 14:14:33 +02:00
Yong Cong Sin
91abf0e329 posix: fs: implement fdatasync()
`fdatasync()` is basically equivalent to `fsync()` according
to the standards.

Added test for it.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-07-29 14:14:33 +02:00
Patryk Kuniecki
c227ff3d63 tests: exclude drivers/watchdog/wdt_basic_api from running on it8xxx2_evb
There is problem with running this test in validation,
because of DBGR mode watchdog can't reset board by itself,
and it needs cold reset. This proves that test is not automated,
and should be exluded on this board.

Signed-off-by: Patryk Kuniecki <patryk.kuniecki@intel.com>
2024-07-29 14:13:21 +02:00
Piotr Kosycarz
0225e0e488 tests: boards: nrf: qdec: add tests for qdec for nrf
Expand testing for QDEC at nrf platforms.
It uses general sensor API,
however there are also nrf driver specific assumptions.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-07-28 07:31:15 +03:00
Emil Gydesen
38d09af445 Bluetooth: BAP: Scan delegator add src without PA sync
Modify the bt_bap_scan_delegator_add_src to take an address and
a sid instead of a PA sync object, so that the scan delegator
can add a source without syncing to the PA.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-07-28 07:31:06 +03:00
Bartosz Miller
0d59c1a780 tests: drivers: add more test cases to the i2c_bme688 test suite
Test NACK handling, bus recovery and FAST speed read.
Signed-off-by: Bartosz Miller <bartosz.miller@nordicsemi.no>
2024-07-28 07:30:59 +03:00
Ren Chen
aa3470ba7e tests: usb: desc_sections: raise the description span to 201
Raise the descriptor table span to 201 due to the inclusion of the USB
configuration descriptor.

Tested with:
$ west build -p -b it82xx2_evb tests/subsys/usb/desc_sections
  -T usb.desc_sections

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2024-07-28 07:30:30 +03:00
Szymon Janc
d434eac86f tests: bluetooth: tester: Fix zero length array in middle of struct
Zero length arrays are only allowed at the end of the structure. Here
those were used as placeholders for BTP response creation and can be
easily replaced with common member.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-07-27 20:51:30 +03:00
Jonathan Rico
dc053dc6d2 Bluetooth: shell: Enable sysbuild for nRF5340
Enable sysbuild for nRF5340 app core.

This automatically builds the image for the network core, making a
better user experience.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-07-27 20:51:10 +03:00
Emil Gydesen
72d98692dc tests: Bluetooth: Add encrypted BAP broadcast test
Added test to test encrypted broadcast

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-07-27 20:49:25 +03:00
Fabio Baltieri
32fafc7176 input: analog_axis: add output inversion
The driver right now only allows inverting the input value, which can be
useful for differential channels but is quite confusing for single ended
ones. Implement a simple output inversion flag instead to make up for
that.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-07-27 20:47:18 +03:00