Commit graph

16700 commits

Author SHA1 Message Date
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
Emil Gydesen
8be6db67fc Bluetooth: ISO/BAP: Refactor BIS bitfield
Refactors teh BIS bitfield values used for ISO
and BAP.

Previously BIT(1) meant BIS index 1, which was a Zephyr choice
in the early days of ISO, as the BT Core spec did not use
a bitfield for BIS indexes.

Later the BASS specification came along and defined that
BIT(0) meant BIS index 1, which meant that we had to shift BIS
bitfields between BAP and ISO.

This commit refactors the ISO layer to use BIT(0) for Index 1 now,
which means that there is no longer a need for conversion
between the BAP and ISO layers, and that we can use a value
range defined by a BT Core spec (BASS).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-07-27 15:19:46 +03:00
Jordan Yates
c9b1daa7ae tests: fs: fat_fs_api: disable flash disk in RAM test
Disable the flash disk driver in the RAM driver test to prevent the
test using the wrong disk in the tests.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-27 15:19:14 +03:00
Chris Friedt
d0808473f2 tests: posix: net: open native_sim in c++,posix,net,native case
Prior to the fixes in the previous commits, combining a build
for native_sim with

CONFIG_CPP=y
CONFIG_POSIX_API=y
CONFIG_STD_CPP20=y
CONFIG_REQUIRES_FULL_LIBCPP=y

would fail.

It succeeds now.

This change adds a testcase to monitor that scenario in CI.

Note: this was partially necessary because the deprecation of
CONFIG_NET_SOCKETS_POSIX_NAMES is not yet complete, so there
is a dependency cycle, and also because <sys/types.h> was
pulling in the host <sys/types.h> instead of Zephyr's or one
of the embedded OSes we support.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-07-27 15:17:24 +03:00
Emil Gydesen
f338bf6fae Bluetooth: Host: Discard advertising data if not explicit scanning
If the application is not explicitly scanning, then there is not
really any need to parse advertising reports nor send them to the
application.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-07-27 15:12:39 +03:00
Vinayak Kariappa Chettimada
04e3d0081b Bluetooth: Controller: Fix Advertising PDU memory allocation
Fix Advertising PDU memory allocation for redundant Periodic
Advertising related PDU allocations. The buffer count
related to Periodic Advertising was included twice.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2024-07-27 15:09:39 +03:00
Anas Nashif
c5e6416a65 tests: device: test CONFIG_DEVICE_DT_METADATA=y
Looks like this option is not tested with userspace enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-07-27 15:09:10 +03:00
Robert Lubos
dd0a95ec15 tests: net: lib: http_server: core: Add test for RST_STREAM frame
Add test case verifying that stream is closed when RST_STREAM frame is
received.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
338e41a063 tests: net: lib: http_server: core: Add test for trailing header frame
Add test case covering a scenario when a client sends a trailing header
frame in a request.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
a99f70ce42 tests: net: lib: http_server: core: Add tests for continuation frame
Add test cases for continuation frame processing.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
71e0b9fac2 tests: net: lib: http_server: core: Add tests for header with priority
Add test cases verifying that request containing header frame with
priority flag set is processed properly.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
1da42b6626 tests: net: lib: http_server: core: Add tests for frames with padding
Add tests verifying that requests which include frames with padding are
processed correctly.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
d1ebddb110 tests: net: lib: http_server: core: Add tests for dynamic POST/GET
Add tests cases covering interaction with dynamic resources with
POST/GET requests.

Simplify HTTP2 request generation to facilitate adding more tests.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
938088641c tests: net: lib: http_server: core: Add test for connection close
Add test case verifying that the server keeps the connection open if no
Connection: close header is present in the request.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
a6d494b16f tests: net: lib: http_server: core: Clarify existing tests
Remove pointless helper functions, the test code can simply be included
in the test case w/o code duplication.

Clarify the naming of existing test cases. Backward compatibility simply
tests HTTP1. The upgrade test wasn't really testing HTTP upgrade, so
rename the test case too. Add a new test case actually verifying HTTP
upgrade.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
ff65815a3b tests: net: lib: http_server: core: Extend start/stop test
Ensure it's possible to restart the server w/o issues after a client
connected.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
5a23c2d602 tests: net: lib: http_server: core: Cleanup before adding more tests
Do some cleanup regarding naming used in the test suite to prepare it
for adding more test cases.

Extract common setup/teardown into respective before and after ztest
functions to simplify test code. Proper before and after functions also
ensure that individual test case failure does not disrupt other tests
operation.

Split the tests into two separate test suites, one for those which
require pre-setup and second for those which don't.

Finally, enable receive timeout on the client socket to ensure tests
won't stall in case of errors.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Robert Lubos
1e2b2c79a5 tests: net: lib: http_server: Rename prototype test suite
"prototype" is ambiguous in this regard, as it doesn't really tell what
the test suite is testing. As tests in this test suite verify core HTTP
server functionality, rename it to "core".

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 15:08:40 +03:00
Johann Fischer
28b2051bda usb: device_next: add support for configuration string descriptor
Change USBD_CONFIGURATION_DEFINE macro to take the address of a string
descriptor node as an argument. This is a breaking change for macro
users, but quite convenient and easy to implement.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-07-27 15:06:09 +03:00
Robert Lubos
dfbdfb05da tests: net: sockets: misc: Fix SO_BINDTODEVICE test
The test case for SO_BINDTODEVICE socket option was flaky, the client
socket always sent the datagram to the IP address of the second
interface, so in theory every packet should end up on that interface.
In practice though, due to imperfect loopback packet handling, the test
worked as the packet ended up on the interface it was sent from.

The test should send datagrams to the IP addresses of the interface 1
and 2 alternatively. The server socket binds to ANY address, so w/o
interface binding it should receive all datagrams, so it allows to
verify if SO_BINDTODEVICE filtering works fine.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-27 10:44:48 +03:00
Seppo Takalo
9fc2048bcc tests: lwm2m: Add Portfolio testcases
Add testcases:
* LightweightM2M-1.1-int-1630 - Create Portfolio Object Instance
* LightweightM2M-1.1-int-1635 - Delete Portfolio Object Instance

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-07-27 10:44:12 +03:00
Yong Cong Sin
58f66623aa tests: gdbstub: add build-only test
Add build-only test for existing boards.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-07-27 10:42:59 +03:00
Yong Cong Sin
b97d97ff17 tests: gdbstub: minor refactor to the testcase.yaml
Change the `platform_allow` to multi-line format so that newly
supported archs/boards can be added as a new line.

Refactor the tags out to `common`, and add
`CONFIG_ARCH_HAS_GDBSTUB` filter

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-07-27 10:42:59 +03:00
Fabian Pflug
ca53d2bf80 net: l2: ieee802154: mgmt: allow beacon payload
The standard does allow for a optional beacon payload, which gets lost
during scan, that could be interesting for the application to access
in the NET_EVENT_IEEE802154_SCAN_RESULT callback.

See section 7.3.1.6 in IEEE Std 802.15.4 for more information about
the beacon payload field. And section 7.3.1 and figure 7-5 about general
beacon frame format.

Signed-off-by: Fabian Pflug <fabian.pflug@grandcentrix.net>
2024-07-27 10:42:45 +03:00
Fabio Baltieri
ef14c9b867 lib: os: add a header for printk hook functions
Add a zephyr/printk.h header for the __printk_hook functions, these are
currently manually declared by all console drivers for no good reason.

Move the documentation into the header and also unify the way that
console drivers call the function.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-07-27 10:41:01 +03:00
Anas Nashif
569dbd8e0f tests: cmake: fix test identifier
cmake is part of the build system area.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-07-18 06:47:57 -04:00
Anas Nashif
84221f5219 tests: display: fix test identifier
Fixed test identifiers and places in correct area.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-07-18 06:47:57 -04:00
Anas Nashif
366ddac79e tests: sensing: fix identifier
Fix identifier of test and add to MAINTAINERS file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-07-18 06:47:57 -04:00
Yannis Damigos
d2a4522250 tests: uart_elementary: Correct typos
Correct typos in uart_elementary test

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2024-07-15 15:15:36 -04:00
Tomi Fontanilles
50c03e9bbe modules: mbedtls: fix MBEDTLS_PSA_P256M_DRIVER_RAW Kconfig option
Make it depend on MBEDTLS_PSA_P256M_DRIVER_ENABLED instead of
selecting it.

This fixes the build of
tests/crypto/secp256r1/crypto.secp256r1.p256-m_raw on filtered-out
platforms since PR #75441 (83cd9f5a01).

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-07-15 10:36:58 -04:00
Krzysztof Chruściński
60911a6d5e tests: drivers: spi: spi_controller_peripheral: Fix nrf54h20_cpurad
Add more memory to dma region for cpurad as otherwise it fails
during initialization due to not enough memory for dmm heap.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-12 09:12:35 -04:00
Evgeniy Paltsev
b4f49bf5fc tests: posix: env: fix failure in case toolchain with minimal libc
In case of minimal libc we have CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE = 0
by default. Some toolchains uses minimal libc by default (for example
ARC MWDT toolchain). Let's set CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE
explicitly so we can allocate memory for environment variables.

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2024-07-11 13:24:02 -04:00
Rubin Gerritsen
85eadcfddc Bluetooth: Mark bt_<type>_err_to_str() APIs experimental
It was pointed out in a future PR that they should have
a corresponding experimental Kconfig entry.

See PR #73795.

This updates the APIs added in PR #73826 and PR #74295.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-07-11 13:11:59 -04:00
Anas Nashif
83bd3658c3 tests: do not get ZEPHYR_BASE from ENV
find_package() already deals with finding ZEPHYR_BASE, so do not rely on
it being set in ENV, use the variable directly adter find_package() was
called.

Fixes #75387

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-07-11 13:09:53 -04:00
Brett Witherspoon
c76818d949 dts: bindings: dac: ad569x: Remove unused properties
These properties are not used by the driver at all, but are
inconveniently marked as required. Lets just remove them.

Signed-off-by: Brett Witherspoon <brett@witherspoon.engineering>
2024-07-11 16:15:28 +02:00
alperen sener
8382fea5b3 test: bluetooth: Correct profile names MBT and DFU
Profile names MBT and DFU are updated as MBTM and DFUM respectively,
according to TCRL 2024-1.

Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
2024-07-11 16:15:10 +02:00
Jonathan Rico
4afe745a1d Bluetooth: host: Add lower bound for CONFIG_BT_BUF_ACL_RX_COUNT
See comment above assert for more.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-07-10 11:47:26 -04:00
Jonathan Rico
ff5c577aa8 tests: Bluetooth: Add ACL re-assembly test
This tests shows that there is a problematic buffer configuration.

The host locks up when `CONFIG_BT_BUF_ACL_RX_COUNT` is smaller or equal
to the number of connected peers, and all those peers send an L2CAP PDU
that needs re-assembly at the same time.

Although this seems far-fetched, this bug has been observed in a
real-life situation on actual hardware.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-07-10 11:47:26 -04:00
Théo Battrel
96d8682a5b Bluetooth: Shell: Fix native shell build
Following changes in HCI drivers
(https://github.com/zephyrproject-rtos/zephyr/pull/72323) the build for
the snippet allowing to have the Bluetooth shell run with BabbleSim was
broken.

Fix the snippet by disabling the HCI UART driver.

Add a twister test case that will build the snippet in CI to avoid
silent breaking.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2024-07-10 11:47:07 -04:00
Nikodem Kastelik
c0d508a142 soc: nordic: common: dmm: fix region alignment getter
Getting the required alignment size for memory region node
and device node needs to be handled by a separate macro.
Otherwise alignment of single byte is reported for any region.
Add a test that checks for this particular issue.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2024-07-10 08:42:40 -04:00
Krzysztof Chruściński
a575d9bc31 tests: drivers: counter: nrf: fixed_top: Rework nrf54h20 cpuppr config
Rework configuration so that it does not require special treatment
in testcase.yaml.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-10 08:42:03 -04:00
Krzysztof Chruściński
407aa5cc79 tests: drivers: counter: basic_api: Rework nrf54h20 cpuppr config
Rework configuration so that it does not require special treatment
in testcase.yaml.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-10 08:42:03 -04:00
Declan Snyder
6eaadc312f tests: i2s_speed: Fix RT1170_EVK overlay files
Remove an overlay with a wrong name not being picked up,
and change the "A" revision overlay to be used by all revisions.

Also fix the "clocks" property in the overlay causing a fault with sai4.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-07-10 11:38:39 +02:00
Jukka Rissanen
794d7cf3c5 net: sockets: Remove async service support
As found in PR #75525, we should not modify the polled fd array
in multiple places. Because of this fix, the async version of
the socket service could start to trigger while it is being handled
by the async handler. This basically means that the async version
cannot work as intended so remove its support.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-07-10 11:36:59 +02:00
Yong Cong Sin
49e8c98996 tests: arch: common: stack_unwind: fix symtab test
The symtab test should have the
`CONFIG_EXCEPTION_STACK_TRACE_SYMTAB` enabled. This was not
caught in the CI previously as the regex was also wrong, '['
and ']' are regex syntax and should be escaped.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-07-09 19:44:08 -04:00
Daniel Leung
0b76fd92fc tests: logging/dictionary: pytest only looks at last output
There are instances where on hardware tests would result in
multiple dictionary logging blocks. This is usually due to
flashing and running via twister in separate steps. Once
flashing is done, the device starts running and sending
logging string to output, but twister is not ready to read
them, thus leaving the strings in the host's UART buffer.
Then twister starts its testing run by resetting the device
which results in another dictionary logging block to show
up. So the pytest script has to be updated to only look at
the last dictionay logging block.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-07-09 17:25:22 -04:00