Commit graph

16700 commits

Author SHA1 Message Date
Frode van der Meeren
913012ab81 tests: bluetooth: tester: Add PBP support
Implements the PBP commands of the BTP specs, in order to support
testing the PBP through autopts. This PR is in conjunction with the
following PR in AutoPTS: https://github.com/auto-pts/auto-pts/pull/1356

Signed-off-by: Frode van der Meeren <frode.vandermeeren@nordicsemi.no>
2025-02-11 11:43:51 +00:00
Guillaume Gautier
a46315fe9a tests: drivers: dma: loop_transfer: add stm32n6 boards overlays
Add DMA loop transfer test overlays for Nucleo N657x0-Q and STM32N6570 DK
boards.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-02-11 03:07:12 +01:00
Jonathon Penix
dad2d65cfa sw_isr_table: Force align _isr_list_sname instances
For some target and optimization level combinations (aarch64 and -O2, for
example), GCC will over align _isr_list_sname instances. The local isr
declaration parser doesn't expect the extra padding that may be introduced
and will produce unexpected errors about bad IRQs (`error: IRQ 1903323438
(offset=0) exceeds the maximum of 42`, for example). Prevent this issue by
forcing the expected alignment of _isr_list_sname.

Fixes #81254

Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
2025-02-11 00:43:55 +01:00
Tahsin Mutlugun
1f625c94fd tests: drivers: gpio: gpio_basic_api: Change pins for MAX32690EVKIT
Current test gpios conflict with I2C SCL and SDA lines. In order to run
both I2C and GPIO test on hardware, change pins used used in
gpio_basic_api test.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2025-02-10 22:26:47 +01:00
Andy Ross
cc411ffe69 tests/kernel/threads: Correct essential thread abort test
Thread abort of essential threads had a buglet where the panic would
be signaled but, if caught by k_sys_fatal_error_handler(), the thread
would not actually be aborted.  This test wasn't validating that the
thread was actually dead (in fac, it RELIED on the thread to signal a
semaphore after its "abort"!).

Make sure it's dead and that the panic is caught.  Also add a case for
aborting _current which is a separate code path that needs coverage.

Signed-off-by: Andy Ross <andyross@google.com>
2025-02-10 22:26:10 +01:00
Emil Gydesen
446ad0948d Bluetooth: PACS: Test and fix PACS Kconfig combinations
Add unit tests for all possible PACS combinations and
fix issues found.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-10 22:25:47 +01:00
Emil Gydesen
e7b6fd0b4b Bluetooth: PACS: Fix several issues with pacs_register
Fixed the following issues:
1) Missing guard before accessing parameters
2) Fixed bad sizeof when resetting
3) Fixed several bad offsets when removing attributes

Added tests to verify that it works now.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-10 22:25:47 +01:00
Emil Gydesen
58605542a6 tests: Bluetooth: PACS: Add unit test of PACS register
Adds initiation unittesting of PACS by testing
the bt_pacs_register API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-02-10 22:25:47 +01:00
Jamie McCrae
b33c87caa0 tests: boot: test_mcuboot: Add swap using offset test
Adds a variation of the test which tests swap using offset mode,
based on the swap using move test

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-02-10 19:05:25 +01:00
Jamie McCrae
141f7fa427 tests: boot: with_mcumgr: Add swap using offset test
Adds a variation of the test which tests swap using offset mode,
based on the swap using move test

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-02-10 19:05:25 +01:00
Torsten Rasmussen
0828d0b0ef cmake: support array of maps in yaml module
This commit introduce support for maps in a yaml list.

The yaml_set() function has been extended with the following signature:
> yaml_set(NAME <name> KEY <key>...
>          [APPEND] LIST MAP <map1> MAP <map2> MAP ...
> )

where a `MAP <map>` has the form:
`MAP "<key1>: <value1>, <key2>: <value2>, ...`

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2025-02-10 15:56:52 +00:00
Bjarki Arge Andreasen
769936165d tests: drivers: i2c: target_api: add nrf54l15 to test suite
Add nrf54l15 cpuapp to test suite.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-02-10 14:32:52 +01:00
Bjarki Arge Andreasen
37c3efc13b tests: drivers: i2c: target_api: add nrf54h20
Add nrf54h20 to test suite.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-02-10 14:32:52 +01:00
Bartosz Miller
9d20c5c382 tests: susbys: Implement performance test for the NRFS
Add NRFS service handling performance test.

Signed-off-by: Bartosz Miller <bartosz.miller@nordicsemi.no>
2025-02-10 11:30:36 +01:00
Manuel Argüelles
55d3deb030 tests: logging: log_backend_fs: add missing include
Include explicitly `logging/log_backend.h` header so that non POSIX
boards can build this test. For POSIX boards, this headers was indirectly
included through `ztest.h`->`ztest_assert.h`->`tc_util.h`->`log_ctrl.h`.

Fixes #85441

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2025-02-10 09:03:13 +01:00
Johann Fischer
c8f3a2eb2d usb: host: allow dynamic allocation of USB devices
Allow dynamic allocation of USB devices on connected event.
Add very basic USB device validation and configuration.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-02-10 09:02:45 +01:00
Jordan Yates
cd772b374f tests: bsim: bluetooth: central: conn timeout under load
Validate that the connection timeout code path works as expected when
the command buffer pool is under stress.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-02-10 03:41:16 +01:00
Thomas Deppe
f3bdd2bc8c Bluetooth: Host: Add support for Advertising Coding Selection
Adds API for Advertising Coding Selection.

Introduces two new advertising options to configure the advertiser's
requirement concerning coding scheme when LE Coded PHY is configured.
While the Bluetooth v6.0 specification makes a distinction betweeen
preferred and required advertising PHY options, a simplification is
made to only expose the required PHY options. Inline with how LE Coded
PHY is implemented; this API will set both the primary and secondary
advertising PHY's to the same coding scheme.

The support is enabled by CONFIG_BT_EXT_ADV_CODING_SELECTION, and requires
a controller that selects CONFIG_BT_CTLR_ADV_EXT_CODING_SELECTION_SUPPORT.

Signed-off-by: Thomas Deppe <thomas.deppe@nordicsemi.no>
2025-02-08 10:09:41 +01:00
Wilfried Chauveau
1ad33e2d71 tests: arch: arm: Correctly report skipped tests as skipped
test_arm_user_interrupt and test_arm_null_pointer_exception currently
only print "Skipped" but reports as PASS in twister. This fixes that
misleading report.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2025-02-08 10:09:01 +01:00
Andrej Butok
68977fa57c tests: flash_map: Increase the maximum number of supported sectors
Fix test_flash_area_get_sectors test for platforms
with maximum number of sectors per image slot > 1024.
Increase the support value to 2048.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-02-08 00:32:09 +01:00
Aurelie Fontaine
2c84ee167b tests: drivers: sensor: update naming
Rename ICM42670 define to ICM42X70 to be aligned with updated driver
to support icm42370-p

Signed-off-by: Aurelie Fontaine <aurelie.fontaine@tdk.com>
2025-02-08 00:31:43 +01:00
Jiafei Pan
a7b469c91f boards: imx8mp_evk: add gpio expander pca6416 support
Added device tree nodes in imx8mp_evk_mimx8ml8_a53.dts, and also
added board overlay in gpio_basic_api test case.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-02-08 00:31:28 +01:00
Khoa Nguyen
786cd7fdd8 tests: drivers: adc: Correct the reference-mv in Kconfig
Correct reference-mv in Kconfig of adc_accuracy_test

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-02-07 14:46:00 +01:00
Kamil Krzyzanowski
41f2c64e97 logging: fs backend: only fs_sync when done with a batch of logs
The previous behavior was to call `fs_sync` on the file after every log
item written. In many cases, log messages come in bursts, and `log_core`
already operates in batches, configurable using
`CONFIG_LOG_PROCESS_THREAD_SLEEP_MS` and
`CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD`. Once the batch is done, the
backends get notified with `LOG_BACKEND_EVT_PROCESS_THREAD_DONE` if any
logs were processed. This is a nice time to `fs_sync` the written changes.

This change both speeds up the time spent writing logs and reduces the
amount of block erases done on the flash, as the previous implementation
erased blocks after each individual log message.

Signed-off-by: Kamil Krzyzanowski <kamnxt@kamnxt.com>
2025-02-07 14:32:06 +01:00
Joakim Andersson
dc97cc0cd5 tests: logging: Convert unit test to include the full FS backend
Convert testing of the logging backend for file-system to include the
full implementation.
Need to disable logging and just include the unit under test to make
this simpler.
The API functions for the backend can then be called on the backend
object.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2025-02-07 14:32:06 +01:00
Khaoula Bidani
95179b24c7 tests : clock_control: clean "STM32_SRC_SYSCLK"
clean up usage of usage "#ifdef STM32_SRC_SYSCLK"
and code under the "#else" from
test_stm32_clock_configuration_adc.c.

Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
2025-02-07 10:25:52 +01:00
Gerson Fernando Budke
0c4f1987c6 tests: watchdog: Add missing wdt_disable in API test
The current watchdog tests assume that watchdog can be configured once
it is running. This is a concept that do not work in practice becasue
most of watchdog once configured will be locked. The tests should take
that in consideration before enable another test. The other important
details is that even when a watchdog is running it should be disable in
some controllers to allow reconfigure.

This change was tested with SAM4L watchdog controller #83475 which
allows reconfigure the watchdog once it is enabled. To do the correct
configuration it is necessary execute the wdt_disable() call.

The change will validate if the watchdog can be disabled for those
cases were the controller is not locked and fallback the test on the
contrary.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2025-02-07 07:38:26 +01:00
Remi Buisson
ad4ed55cba dts: bindings: sensor: Add invensense icp101xx properties
Replace icp10125.
tests: sensor: rename icp10125 to icp101xx

Signed-off-by: Remi Buisson <remi.buisson@tdk.com>
2025-02-07 07:38:06 +01:00
Gerson Fernando Budke
f2fa8f965e drivers: rtc: sam0: Add realtime clock driver
Add Atmel sam0 rtc calendar driver.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2025-02-07 07:37:56 +01:00
Tom Hughes
01e412951b tests: posix: timers: Fix -Wsometimes-uninitialized warning
Building portability.posix.timers with clang warns:

tests/posix/timers/src/nanosleep.c:180:2: error: variable 'actual_ns' is
used uninitialized whenever switch default is taken
[-Werror,-Wsometimes-uninitialized]
        default:
        ^~~~~~~
tests/posix/timers/src/nanosleep.c:197:15: note: uninitialized use
occurs here
        zassert_true(actual_ns >= exp_ns, "actual: %llu expected: %llu",
                     ^~~~~~~~~                          actual_ns, exp_ns);
subsys/testsuite/ztest/include/zephyr/ztest_assert.h:275:41: note:
                                      ^~ expanded from macro 'zassert_true'
subsys/testsuite/ztest/include/zephyr/ztest_assert.h:194:14: note:
expanded from macro 'zassert'
        _zassert_va(cond, default_msg, COND_CODE_1(__VA_OPT__(1),
                    ^~~~               (__VA_ARGS__), (NULL)))
subsys/testsuite/ztest/include/zephyr/ztest_assert.h:191:16: note:
expanded from macro '_zassert_va'
        _zassert_base(cond, default_msg, msg, ##__VA_ARGS__)
                      ^~~~
subsys/testsuite/ztest/include/zephyr/ztest_assert.h:180:14: note:
expanded from macro '_zassert_base'
                        z_zassert(cond, _msg ? ("(" default_msg ")") :
                                  ^~~~   (default_msg), __FILE__,    \
tests/posix/timers/src/nanosleep.c:152:20: note: initialize the variable
'actual_ns' to silence this warning
        uint64_t actual_ns;
                          ^
                           = 0

Not really necessary since there is a zassert_unreachable(), but doesn't
hurt to initialize the variable.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-02-07 02:23:35 +01:00
Tom Hughes
9e85669482 tests: net: socket: Fix -Wsometimes-uninitialized warning
Building with clang warns:

tests/net/socket/tcp/src/main.c:377:13: error: variable 'c_sock' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
        } else if (family == AF_INET6) {
                   ^~~~~~~~~~~~~~~~~~
tests/net/socket/tcp/src/main.c:396:15: note: uninitialized use occurs here
        test_connect(c_sock, s_saddr, addrlen);
                     ^~~~~~
tests/net/socket/tcp/src/main.c:377:9: note: remove the 'if' if its
condition is always true
        } else if (family == AF_INET6) {
               ^~~~~~~~~~~~~~~~~~~~~~~~
tests/net/socket/tcp/src/main.c:360:12: note: initialize the variable
'c_sock' to silence this warning
        int c_sock;
                  ^
                   = 0
tests/net/socket/tcp/src/main.c:377:13: error: variable 's_sock' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
        } else if (family == AF_INET6) {
                   ^~~~~~~~~~~~~~~~~~
tests/net/socket/tcp/src/main.c:387:12: note: uninitialized use occurs here
        test_bind(s_sock, s_saddr, addrlen);
                  ^~~~~~
tests/net/socket/tcp/src/main.c:377:9: note: remove the 'if' if its
condition is always true
        } else if (family == AF_INET6) {
               ^~~~~~~~~~~~~~~~~~~~~~~~
tests/net/socket/tcp/src/main.c:361:12: note: initialize the variable
's_sock' to silence this warning
        int s_sock;
                  ^
                   = 0

Not really needed since we have zassert_unreachable(), but doesn't hurt
to initialize the variables.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-02-07 02:23:24 +01:00
Ludvig Jordet
ce4bab5662 Tests: Bluetooth: Add hci_ipc config to Twister integration
This adds the configuration used when running PTS tests with hci_ipc to
the testcase.yaml, so they are built on integration by CI, avoiding
regression.

Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
2025-02-06 14:46:02 +01:00
Dawid Niedzwiecki
3d372c048a drivers: flash: stm32h7: add support for blocking registers
Add support for blocking flash control registers and option bytes for
STM32H7 chips.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2025-02-06 14:45:06 +01:00
Dawid Niedzwiecki
def973f5b9 drivers: flash: stm32h7: add support for write protection
Add support for setting flash write protection per sector for STM32H7x
chips.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2025-02-06 14:45:06 +01:00
Ibe Van de Veire
2880f453ba test: drivers: dac: Add support for SAM4S soc
Add support for sam4s_xplained board in dac_api test.

Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
2025-02-06 10:43:17 +01:00
Fabrice DJIATSA
edb55baf03 tests: drivers: spi: spi_loopback: update spi_loopback test
- add nucleo_c071rb overlay file to setup spi and dma nodes

- Add the nucleo_c071rb configuration file to reduce the size of
SPI_LARGE_BUFFER_SIZE to avoid RAM overflow and be able
to run the test.

- update testcase.yaml for CI integration

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2025-02-06 10:41:45 +01:00
Fabrice DJIATSA
c6914519fc tests: drivers: uart: uart_async_api: update uart_async_api test
add nucleo_c071rb overlay file for test bench purpose.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2025-02-06 10:41:45 +01:00
Fabrice DJIATSA
8ebd12aa5b tests: drivers: i2c: i2c_target_api: update i2c_target_api test
- add overlays and kconfig files for nucleo_c071rb board.
- update testcase.yaml for CI integration.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2025-02-06 10:41:45 +01:00
Fabrice DJIATSA
e9939aa02d tests: drivers: dma: chan_blen_transfer: update dma test
add nucleo_c071rb.overlay and nucleo_c071rb.conf files
for test bench purpose.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2025-02-06 10:41:45 +01:00
Fabrice DJIATSA
9ac0cd5157 tests: drivers: counter: counter_basic_api: update counter test
add the nucleo_C071rb overlay file and enable different types of timers
that support counters.


Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2025-02-06 10:41:45 +01:00
Fabrice DJIATSA
a1bd7cf7b0 tests: drivers: adc: adc_api: update adc_api test
- add nucleo_c071rb overlay file to setup adc node

- The C0 serie has two HSI clock sources, HSI48 and HSI48USB.
To make it simpler and compatible with the existing clock driver,
HSI48 is renamed to HSI (node already present in the stm32c0.dtsi).
HSI48USB will correspond to HSI48.
With SYNC mode, we have an overrun on the ADC, so we configure it
in ASYNC mode.

- Update STM32 HSI macro according to changes

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2025-02-06 10:41:45 +01:00
Wajdi ELMuhtadi
03b075d35a drivers: sensor: wsen_pads_2511020213301: add sensor driver
Add wsen_pads_2511020213301 driver with
the corrected name and compatibility with
the hal update as well as added new features.

Signed-off-by: Wajdi ELMuhtadi <wajdi.elmuhtadi@we-online.com>
2025-02-06 07:45:13 +01:00
Tom Hughes
1a18f4bbb0 tests: posix: Re-enable -Wunused-value warning
Rather than disabling -Wunused-value for the entire file, explicitly
mark variables that are unused.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-02-06 03:18:25 +01:00
Tom Hughes
916928a122 tests: posix: Annotate unused variables with __unused
Instead of disabling the -Wunused-variable warning for the entire file,
we can explicitly mark the variables that are unused with __unused.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-02-06 03:18:02 +01:00
Noah Olson
37a924be6a net: dns: Fix DNS caching bug
The current DNS caching logic is not aware of the IP address version.
If there is a cached address for a query, the caller of
dns_get_addr_info() will receive that address, even if it is not the
same version as the caller requested. For example:

- dns_get_addr_info() is called to resolve an IPv4 address
- the DNS client caches the IPv4 address that was received
- dns_get_addr_info() is called to resolve an IPv6 address
- the DNS client sees that there is a cached IPv4 address for the
  given query
- the DNS client does not check that the cached address is of the
  requested version (IPv6)
- the cached IPv4 address is returned from dns_get_addr_info()

This changes the DNS client to check IP address version when searching
cached addresses.

Signed-off-by: Noah Olson <noah@wavelynx.com>
2025-02-05 23:49:17 +01:00
Tom Hughes
3bbe56060f tests: posix: headers: net: Re-enable warning
CI passes with the warning removed.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-02-05 23:49:04 +01:00
Bjarki Arge Andreasen
816a7a09ac tests: subsys: llext: filter by ram/rom size
The LLEXT test suites are quite large, and should not be built
for "small" SoCs. Filter the tests based on RAM and ROM/flash
size. The following test sizes built for nrf52840 where used
to determine min sizes:

Name:                       Flash:   RAM:
llext.loader_build          105      80
llext.readonly              105      79
llext.readonly_mpu          140      95
llext.readonly_mmu          106      145
llext.writable              123      125
llext.writable_relocatable  117      129
llext.writable_slid_linking 108	     125

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-02-05 21:02:33 +01:00
Bjarki Arge Andreasen
3cacb4d404 tests: drivers: build_all: eeprom: increase requirenments
The test case drivers.eeprom.emul.build requires around 48-58kB of
RAM and 95-119kB of ROM/flash, increase and add these requirenments
to the test case. Similarly add min flash requirenment to
drivers.eeprom.build

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-02-05 21:02:33 +01:00
Bjarki Arge Andreasen
b1b9212116 tests: drivers: stepper: limit test platforms
The stepper driver test cases only specify integration
platforms, which whitelists every other board in tree
for full CI runs. This is not intended as some platforms
are too small to run the test cases.

Whitelist target platforms using platform_allow instead.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-02-05 21:02:33 +01:00
Lauren Murphy
f0eb7ebc83 llext: arc: enforce bitness match
Enforces bitness match of ARC compilers and linkers invoked
building LLEXT apps by inheriting -mcpu flag from Zephyr.
The ARC toolchain becomes confused without the -mcpu flag.
On qemu_hs5x we see GCC select elf32-littlearc64 for
linking an object previously compiled as elf64-littlearc64.

Fixes #80949

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2025-02-05 21:01:01 +01:00