Commit graph

16700 commits

Author SHA1 Message Date
Andries Kruithof
c3e2be4314 Bluetooth: audio: host: call the stream disable callback
Even though the ASCS Sink ASE state machine does not enter the disabling
state according to ASCS spec, it still makes sense to do so.

the state transition unit tests are updated to verify calling or not
calling the disable callback, depending on the transition of the state

fixes #63230

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-12-01 10:50:04 +00:00
Maciej Perkowski
4733a89c50 twister: tests: Add some generic driver tests to the scope
The added tests should be generic enough to run on all reference
platforms.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2023-11-30 19:38:50 -05:00
Maciej Perkowski
ac3d8ebd9e twister: tests: Use inheritance in test_config.yaml
There is no need of repeating the same entries in a scope
that is supposed to extend another one.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2023-11-30 19:38:50 -05:00
Anas Nashif
589d36adcf tests: crc: remove unrelated tag
Remove net tag from tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-30 11:23:11 -05:00
Anas Nashif
e11a71dea0 tests: posix: remove unrelated tags
Remove unrelated tags: net, socket.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-30 11:23:11 -05:00
Manuel Argüelles
de93777d14 tests: drivers: gpio: enable tests for ucans32k1sic
Add DT overlays for running GPIO tests on ucans32k1sic board.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-11-30 11:21:59 -05:00
Alberto Escolar Piedras
a905292eb0 tests/boards/native_sim/rtc: Rename testcase
As it is not just targetting native_posix anymore.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras
690479fc36 tests/*: Switch integration platform to native_sim
Swith integration_platforms from native_posix(_64)
to native_sim(_64).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras
7a778ebc2d tests/kernel/*: Switch integration platform to native_sim
Swith integration_platforms from native_posix(_64)
to native_sim(_64).
And replace it also in a comment.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras
700a251366 tests/kernel/sched/schedule_api: Replace delay with Z_SPIN_DELAY()
This macro was introduced for this purpose

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras
fbf1c19bd6 tests/kernel/common: Enable errno test on native_sim
Enable this test also on native_sim when not using the host
C library

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras
f981bf2fa0 tests/subsys/*: Switch integration platform to native_sim
Swith integration_platforms from native_posix(_64)
to native_sim(_64).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras
0f5a0327e6 tests/subsys/canbus/isotp/conformance: Replace native_posix in comment
Replace native_posix with native_sim in a comment.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras
345c25659c tests/subsys/bindesc/definition: Enable for native_sim
Enable bindesc.define also for native_sim.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras
1a3ba0ec82 tests/lib/*: Switch integration platform to native_sim
Swith integration_platforms from native_posix(_64)
to native_sim(_64).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras
6db47c70fa tests/lib/heap: Minor fix in a comment
That comment applies to all posix arch based boards,
not just native_posix.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras
12bf3bae0f tests/lib/c_lib/common: Do not skip part of test for all posix boards
It is not just native_posix that supports the sqrt test,
but all posix arch based ones.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras
ff30ad15cd tests/drivers/*: Switch integration platform to native_sim
Swith integration_platforms from native_posix(_64)
to native_sim(_64).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras
799cd60745 tests/drivers/charger/sbs_charger: Fix test filter
Fix the test filter, to allow any POSIX arch board,
instead of just native_posix, as this test runs fine
on all of them.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras
f591d0a54d tests/lib/cmsis_dsp: Switch integration_platform to native_sim
Switch integration_platform from native_posix to native_sim

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Alberto Escolar Piedras
6fce48b028 tests/drivers/flash_simulator: Switch to native_sim
Switch the native overlays to be based on the native_sim one,
and set native_sim as the integration_platform
instead of native_posix

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-30 09:42:25 -05:00
Fabio Baltieri
c8f4455ef8 tests: input: api: dedup some test properties
Move some common properties in the common field.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-30 10:19:42 +00:00
Aastha Grover
283a9ef959 tests: cpp: Exclude cpp2B testcase for xt-clang toolchain
c++2B standard is not supported for xt clang compiler so
exclude cpp2B testcase for xt-clang toolchain.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-30 10:07:00 +01:00
Robert Lubos
5bbf898905 tests: net: socket: tcp: Fix FD leak in fionread tests
Socket close was missing in fionread tests, causing file descriptor
leak.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-11-30 10:06:50 +01:00
Robert Lubos
95155c1fae tests: net: tcp: Add small delay when checking context dereference
Since the TCP context (and thus net_context) is not dereferenced
directly from the test thread anymore, add a small delay so that TCP
work queue have a chance to run, before checking net_context count or
reusing the port on new allocation.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-11-30 10:06:50 +01:00
Szymon Janc
530e3670bc bluetooth: tester: Allow to use filter list for advertising
If there is any element on filter list it is used for advertising.
This allows to test all scenarios involving allow list (empty, peer
on list, peer not on list).

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2023-11-30 10:06:39 +01:00
Aleksander Wasaznik
535e003a00 Bluetooth: Use CONFIG_BT_CONN_TX_USER_DATA_SIZE
Replace hardcoded value `8` with `CONFIG_BT_CONN_TX_USER_DATA_SIZE`,
that is `8` but is going to change.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2023-11-30 10:06:19 +01:00
Jonathan Rico
3fe9aaa0f1 tests: Bluetooth: add ATT clopen test
Open. Close. Do it a bunch of times. Cry a lot.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2023-11-30 10:06:19 +01:00
Andreas Chmielewski
72f7a05a8b tests: lwm2m_rd_client: Added more fff tests
If the rdclient is suspended or deregistered any network errors caused
by lwm2m_engine and forwarded by socket_fault handler should not change
the rd client state.

Signed-off-by: Andreas Chmielewski <andreas.chmielewski@grandcentrix.net>
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-11-30 10:05:30 +01:00
Jukka Rissanen
55958d851f net: context: Refactor option getters
Set separate option getters for bool, uint8_t and uint16_t
values. Use those generic getters when fetching the desired
option value.

Noticed mixed usage (bool vs int) for txtime option. Changed
the code to use int type like in other options.

The uint16_t option getter gets the value from uint16_t variable
but returns int value to the caller, and also expects that user
supplies int value.

For uint8_t value, it is expected that uint8_t value is supplied
instead of int.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-11-30 10:05:06 +01:00
Piotr Narajowski
e91e65b5fd bluetooth: tester: GMCS Server tests
Add support for Generic Media Control Service tests

Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
2023-11-30 10:01:35 +01:00
Jakub Michalski
685b45be94 tests: console: add line splitting tests
Add tests for line splitting in console echo and console_getline()

Signed-off-by: Jakub Michalski <jmichalski@internships.antmicro.com>
Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
2023-11-29 17:16:35 -05:00
Konrad Derda
f9c4ae6cf6 tests: net: hostname: test hostname related events
Add test case to ensure that NET_EVENT_IF_HOSTNAME_CHANGED event is
triggered properly when the hostname changes.

Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
2023-11-29 13:16:16 -06:00
Rodrigo Peixoto
2fa6a440ae tests: zbus: replacing K_NO_WAIT with K_FOREVER in integration tests
The zbus_chan_read with K_NO_WAIT was generating a fail in the
qemu_riscv32_smp board. This fix replaces the K_NO_WAIT with a K_FOREVER
on the test, which would not affect the test execution for other
platforms/boards.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2023-11-29 19:51:13 +01:00
Fabio Baltieri
35de07a528 tests: gnss: add some tests for gnss_dump
Add a testsuite for gnss_dump, testing that various values are printed
correctly.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-29 14:30:40 +00:00
Armin Brauns
5b1b260f80 bluetooth: add HCI driver parameter to set controller's public address
This allows HCI drivers to expose vendor-specific functions to set the
public address.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2023-11-29 10:44:25 +01:00
Christopher Friedt
fe456ee5be tests: posix: test pthread_cleanup_push() / pop()
Add a test for pthread_cleanup_push() and
pthread_cleanup_pop().

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-29 10:08:44 +01:00
Kyra Lengfeld
07d04b0f40 Bluetooth: Host: build shell power_control_request
(Not to mistake it for the dynamic power control nor the zephyr LL
vendor-specific commands controlling local tx power) this yaml addition
will build the shell code for the LE Power Control Feature API's, acting
as verification.

Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
2023-11-29 09:59:39 +01:00
Alberto Escolar Piedras
15b2f7166a tests/bsim/compile: Add option to pass extra cmake arguments
Add an extra optional input to the script which can be used
to pass more options to cmake.
Background: With sysbuild needing to pass extra options is quite
normal. Users would normally want to add options, without necessarily
wanting to change the default cmake_args, so this new options
provides that.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-11-28 16:45:00 -05:00
Keith Packard
9f703b88f9 tests/log_output: Avoid printf stack overflow with old picolibc
Before picolibc version 1.8.5, the only version of printf available with
long long output support was the version including full support for
floating point numbers and positional parameters. That version uses more
stack space than the limited version causing an overflow.

Increase the ztest stack space by 128 bytes.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-11-28 15:32:12 -05:00
Peter Mitsis
77abd6f89d tests: Allow thrd test to run on xtensa
On some SMP platforms (such as intel_adsp_ace15_mtpm) it is not
safe to access the stack of a thread that is currently executing
on another CPU. This requires that tests be written such that
objects and data that are shared between threads that may execute
concurrently on different CPUs be placed into memory that is not
a thread's stack.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-11-28 14:46:15 -05:00
Emilio Benavente
617cb789c3 tests: drivers: spi: spi_loopback: added overlay file for mimxrt1170
Added an overlay file for mimxrt1170_evk_cm33 to test rtio
with the spi_loopback test.
Added mimxrt1170_evk_cm7 to the testcase.yml file

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2023-11-28 12:11:52 -06:00
Fabio Baltieri
0670609bc6 tests: console_switching: drop CONFIG_ZTEST_NEW_API
The option is long gone, PR was sitting for a long time so this got
merged and now it's failing compliance check.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-28 14:55:57 +00:00
Christopher Friedt
b13ec704d0 tests: drivers: console: add console_switching test
This testsuite exercises a number of things. Namely

  * `mutable` devices (i.e. those backed in SRAM)
  * `uart_emul` support for interrupt mode (receive only)
  * `devmux` capabilities of multiplexing several uarts
  * switching the system console between several uart backends

Testing Done:
```
west build -p auto -b qemu_riscv64 -t run \
  tests/drivers/console_switching/
...
*** Booting Zephyr OS build zephyr-v3.4.0-3988-gaaefb2d764ea ***
Running TESTSUITE console_switching
================================================================
START - test_read
read "Hello, uart_emul0!" from uart_emul0
read "Hello, uart_emul1!" from uart_emul1
read "Hello, uart_emul0!" from uart_emul0
read "Hello, uart_emul1!" from uart_emul1
 PASS - test_read in 0.005 seconds
================================================================
START - test_write
wrote "Hello, uart_emul0!" to uart_emul0
wrote "Hello, uart_emul1!" to uart_emul1
wrote "Hello, uart_emul0!" to uart_emul0
wrote "Hello, uart_emul1!" to uart_emul1
 PASS - test_write in 0.003 seconds
================================================================
TESTSUITE console_switching succeeded

------ TESTSUITE SUMMARY START ------

SUITE PASS - 100.00% [console_switching]: pass = 2, fail = 0,...
 - PASS - [console_switching.test_read] duration = 0.005 seconds
 - PASS - [console_switching.test_write] duration = 0.003 seconds

------ TESTSUITE SUMMARY END ------

===============================================================
PROJECT EXECUTION SUCCESSFUL
```

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-28 15:35:39 +01:00
Christopher Friedt
28dccf236b tests: misc: iterable_sections: add named alternate tests
Add tests for the newly added
STRUCT_SECTION_ITERABLE_NAMED_ALTERNATE(). This type of
section should be iterated with
STRUCT_SECTION_FOREACH_ALTERNATE().

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-28 15:35:39 +01:00
Fabio Baltieri
407e9a4c74 test: add a gnss build_all test
Add a generic test for GNSS devices.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-28 15:33:28 +01:00
Peter Mitsis
a51bd53cef tests: Update posix common test for Xtensa
Updates the posix common test so that it will pass on Xtensa SMP
boards such as intel_adsp_ace15_mtpm. This involves ensuring that
a newly created thread does not attempt access/modify the stack of
a thread that is currently running on a different CPU.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-11-27 20:10:51 -05:00
Vinayak Kariappa Chettimada
411731f778 tests: bsim: Bluetooth: Enable nrf5340bsim CIS ACL group test
Enable testing CIS ACL group test on nrf5340bsim.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-11-27 19:59:13 +01:00
Jukka Rissanen
5539a47eb6 tests: net: socket: Add recv pktinfo ancillary tests for recvmsg
Make sure recvmsg() is able to return IPv4 IP_PKTINFO and
IPv6 IPV6_RECVPKTINFO ancillary data to the caller.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-11-27 19:58:47 +01:00
Jukka Rissanen
bb880c6457 tests: net: udp: Make receive timeout shorter
No need to wait 2.5 seconds for the test to pass, 400ms wait
is enough.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-11-27 19:58:47 +01:00