Commit graph

11213 commits

Author SHA1 Message Date
Bjarki Arge Andreasen bfdd382ffc tests/drivers/build_all/modem: Add modem_cellular driver
Add modem_cellular driver to build_all. Since the driver
is generic, supporting 4 different modems, it builds an
instance for all 4 as they exist in the devicetree.

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-08-30 13:48:51 +02:00
Bjarki Arge Andreasen 10ac828776 tests/subsys/modem: Added unit tests for modem modules
The tests test each module independently using the mock pipe,
which implements the modem_pipe API, making it compatible
with the modem modules.

The modem_ppp module is slightly different from the others
since it also interacts with the network stack. To acheive
this, a mock implementation of the PPP L2 net iface has
been implemented in the test suite for the modem_ppp.

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-08-30 13:48:51 +02:00
Tom Finet 4474860744 tests: fix bsim bt l2cap send_on_connect to fail on err < 0
bt_l2cap_chan_send returns the total bytes sent from the buf,
hence test should only fail when it returns a negative error code
and not a positive number of bytes sent.

Signed-off-by: Tom Finet <tom.codeninja@gmail.com>
2023-08-30 10:23:05 +02:00
Fabio Baltieri a16f1cee4a bluetooth: host: fix few mismatched CONTAINER_OF
Fix a bunch of mismatched CONTAINER_OF, few missing
k_work_delayable_from_work conversions but also many
bt_l2cap_le_chan/bt_l2cap_chan and few others.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-30 10:22:37 +02:00
Thomas Ebert Hansen 00c5edd411 Bluetooth: controller: Fix LLCP enc. execution ctx
rp_enc_state_wait_ltk_reply() is executed in thread context, so
it is not allowed to move the encryption state machine forward.

Defer LTK reply handling to next prepare event by introducing a continue
state.

Update the unit test to reflect this, and remove the TODO that actually
said there was an issue in the first place.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2023-08-30 10:22:15 +02:00
Jeroen van Dooren 772e6fd423 tests: drivers: uart: Adding wide data async tests
Extending async tests with wide data support.

Signed-off-by: Jeroen van Dooren <jeroen.van.dooren@nobleo.nl>
2023-08-30 10:17:17 +02:00
Jeroen van Dooren 930edd8ed4 tests: drivers: uart: Resetting uart state
Resetting uart state before every testcase.

Signed-off-by: Jeroen van Dooren <jeroen.van.dooren@nobleo.nl>
2023-08-30 10:17:17 +02:00
Jeroen van Dooren c3a1730c99 tests: drivers: uart: Adding wide data cfg tests
Extending configuration tests with wide data support.

Signed-off-by: Jeroen van Dooren <jeroen.van.dooren@nobleo.nl>
2023-08-30 10:17:17 +02:00
Jeroen van Dooren 41339562c6 tests: drivers: uart: moving struct declaration
Moving struct in preparation of wide test.

Signed-off-by: Jeroen van Dooren <jeroen.van.dooren@nobleo.nl>
2023-08-30 10:17:17 +02:00
Fabio Baltieri a15e7d2326 tests: work_queue: fix few mismatched CONTAINER_OF
Fix few mismatched CONTAINER_OF, going from struct k_work to struct
triggered_test_item should pass by struct k_work_poll.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-29 20:06:23 -04:00
Eric Holmberg f5b78270bc drivers: sensor: ina230: fix current sign issue
Fix sign handling for ina230 current calculation.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2023-08-29 09:44:20 -05:00
Eric Holmberg 5a6610240e test: sensor: ina230: add emulator unit test
Add emulator unit test of the INA230.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2023-08-29 09:44:20 -05:00
Eric Holmberg f0f7f8b146 dt-bindings: sensor: ina230: add configuration properties
Add properties to replace the configuration register value.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2023-08-29 09:44:20 -05:00
Eric Holmberg 19e44ae9a0 drivers: sensor: ina237: add shunt voltage support
Add ability to retrieve the shunt voltage if the end user wants to do
the power calculation manually to handle negative power values.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2023-08-29 09:44:20 -05:00
Eric Holmberg a70d056513 drivers: sensor: ina237: add high-precision mode
The current-shunt calibration requires a factor of 4x if high-precision
mode is selected.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2023-08-29 09:44:20 -05:00
Eric Holmberg 2d3a391191 drivers: sensor: ina237: fix current sign issue
Fix current sign extension logic and consolidate sensor scaling code
into a single block.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2023-08-29 09:44:20 -05:00
Eric Holmberg 19da119c17 test: sensor: ina237: add emulator unit test
Add emulator unit test of the INA237.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2023-08-29 09:44:20 -05:00
Eric Holmberg c7135a2ac5 dt-bindings: sensor: ina237: add configuration properties
Add properties to replace the configuration register values.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2023-08-29 09:44:20 -05:00
Georges Oates_Larsen b25ea4742e net: conn_mgr: Rename connectivity monitor
The connectivity monitoring subfeature of conn_mgr is currently also
named conn_mgr, which is confusing.

This commit renames it to conn_mgr_monitor, or conn_mgr_mon for short,
for clarity.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-08-29 16:13:37 +02:00
Georges Oates_Larsen 6d2ce0b30b net: conn_mgr: Create separate connectivity implementation API.
Splits many definitions from conn_mgr_connectivity.h off into their own
header, conn_mgr_connectivity_impl.h

conn_mgr_connectivity.h now focuses solely on user/application-facing
APIs, and conn_mgr_connectivity_impl now contains all functions, utils,
definitions intended for use by connectivity implementations, including
conn_mgr_if_get_binding, which is now available for use by connectivity
implementations.

This lays the foundation for allowing connectivity implementations
easier and safer access to their internal state through internal APIs.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-08-29 16:13:37 +02:00
Troels Nilsson 8a2a2bd613 Bluetooth: Controller: Add trpa cache for BT_CTLR_SW_DEFERRED_PRIVACY
Adds a target RPA known unknown cache; it fulfills a similar function
to the existing peer RPA cache, used for scanning of directed
advertisements

Signed-off-by: Troels Nilsson <trnn@demant.com>
2023-08-29 16:13:22 +02:00
Guillaume Gautier 8a9b33729b tests: drivers: watchdog: wdt_basic_api: add nucleo_wba52cg board
Add Nucleo WBA52CG board in the allowed platform for STM32 watchdog tests

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-08-29 10:25:23 +02:00
Anisetti Avinash Krishna 88f0613686 tests: drivers: gpio: gpio_basic_api: Added intel_adl_crb overlay
Added overlay to enable GPIO tests on intel_adl_crb board.

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2023-08-29 10:24:03 +02:00
Emil Gydesen 71b1591337 Bluetooth: CAP: Remove qos from start_stream_param
Remove the qos field from
bt_cap_unicast_audio_start_stream_param as it was not used.

The QOS values are set when creating the unicast group,
and not when starting the streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-08-29 10:22:43 +02:00
Rodrigo Peixoto 6880b8501d tests: zbus: fix tests to work with iterable sections observers
Adjust the `runtime_observers_registration` and `unittests` tests to work
with iterable sections channel observation. Add a sequence check for the
runtime observers. Add a tests for iterator functions for channels and
observer to work with `user_data` pointer.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2023-08-29 10:18:55 +02:00
Anas Nashif b818ca43b7 tests: uoscore-uedhoc: add tag to match module name
Add tag to be able to runs the tests whenever the module sha changes in
the manifest.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-08-28 13:37:39 -04:00
Anas Nashif 5f7b22f094 tests: uoscore: prepend test cases with test_
Tests were missing the test_ prefix.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-08-28 13:37:39 -04:00
Anas Nashif 7741a9baf8 tests: move uoscore-uedhoc tests into tests/modules
Those are tests for a module, so put them under tests/modules.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-08-28 13:37:39 -04:00
Anas Nashif 7fc40ee9fb tests: uoscore: depend on third party module
Tests should depend on the the module, so if we do not have the module,
we should not be building the test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-08-28 13:37:39 -04:00
Anas Nashif 98fc52f754 tests: uoscore: listify tags in testcase.yaml
Move tags to a yaml list instead of cramming them in one string field
the old-fashioned way.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-08-28 13:37:39 -04:00
Dat Nguyen Duy b70c5deb04 tests: ztest: zexpect: include source file directly in main.cpp
The main.cpp was introduced as a symbolic link of main.c
but this makes the test build failure on Windows, so just
remove the symlink and include directly the source

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
2023-08-28 13:36:08 -04:00
Emil Gydesen 6ccd112c56 Bluetooth: Audio: Refactor bt_audio_codec_cfg to flat arrays
Refactor the bt_audio_codec_cfg to use flat arrays to store
metadata and codec specific configurations.

The purpose of this is to make it easier to copy the data
between layers, but also to support non-LTV data for non-LC3
codec configurations.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-08-28 15:56:53 +02:00
Fredrik Danebjer 32b00dd6f4 Bluetooth: Audio: Make BSIM tests for PACS notify functionality
Added a BSIM tests for PACS notification functionality. This test
tests that all optional notifies are working, as well as verifying
that a disconnected subscribed client will be notified on reconnect.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2023-08-28 15:56:26 +02:00
Fredrik Danebjer 4c94056f74 Bluetooth: Audio: Make PACS optional notify actually optional
Added Kconfig options to make the various PACS characteristics that are
optionally notifiable selectable as notifiable. Selecting a
characteristic as notifiable will make it so for all pacs instance on
the device.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2023-08-28 15:56:26 +02:00
Fabio Baltieri ec71be5d9d drivers,subsys: fix few missing k_work_delayable_from_work
Fix few instances of delayable work handlers using the k_work pointer
directly in a CONTAINER_OF pointing to a k_work_delayable.

This is harmless since the k_work is the first element in
k_work_delayable, but using k_work_delayable_from_work is the right way
of handling it.

Change a couple of explicit CONTAINER_OF doing the same work as the
macro in the process.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-28 10:12:21 +02:00
Robert Lubos 9a90440226 tests: net: sockets: misc: Add getsockname() tests
Add tests which verify that getsockname() function works as expected.

Additionally, add a teardown delay in tests involving TCP, to make sure
all resources are released before the test ends, not to interfere with
other tests.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-08-27 07:35:34 -04:00
Georgij Cernysiov 986fb1e85d tests: net: lib: coap: test coap_packet_set_path
Adds testing of 'coap_packet_set_path'.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2023-08-25 13:15:12 +02:00
Jamie McCrae 28e94dca06 tests: mgmt: mcumgr: all_options: Add settings_mgmt
Enables building the test application with settings management
group enabled to ensure it builds successfully.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-25 10:54:06 +01:00
Jamie McCrae a21a80ceb5 tests: mgmt: mcumgr: Add settings_mgmt test
Adds a test which checks settings_mgmt functionality.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-25 10:54:06 +01:00
Robert Lubos e8a00b7ef6 tests: net: socket: udp: Add test to verify connected socket behavior
Add test cases which verify that when UDP socket is connected, it only
accepts datagrams from a remote peer it was connected to, and not
others.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-08-25 10:31:19 +02:00
Fabio Baltieri 7ca4eeaaf9 emul: change stub driver priority to kernel device default
Change the emulator stub driver priority to
CONFIG_KERNEL_INIT_PRIORITY_DEVICE. Makes this play well with build time
priority checking.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-08-25 10:31:02 +02:00
Seppo Takalo e977fde7ee tests: lwm2m: Add more tests to LwM2M registry
Add module tests for all data types and most of deprecated
functions as well.

Refactor event wainting to expect_lwm2m_rd_client_event() which
does not care about the index, just the order.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-08-24 22:07:32 +01:00
Seppo Takalo 0da806736e tests: lwm2m: Add engine tests on security and socket opts
Add tests regarding socket options and various security
options.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-08-24 22:07:32 +01:00
Seppo Takalo 40dd0c1fa0 tests: lwm2m: Add bootstrap tests into RD client tests
Add bootstrap and few corner cases into RD client tests
to improve code coverage.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-08-24 22:07:32 +01:00
Kim Bøndergaard 95ca082e64 test: drivers: rtc: shell: Unittest of rtc_shell
The test mocks an rtc using the rtc_fake driver

Signed-off-by: Kim Bøndergaard <kim.bondergaard@prevas.dk>
2023-08-24 22:06:51 +01:00
Anas Nashif 71eee6da4b tests: fs: add more tags
Add module names as tags, to trigger CI on those tests when module has
changed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-08-24 13:41:26 -04:00
Anas Nashif 7f201f4ccc samples/tests: littlefs: tag littlefs samples/tests
Tag with required module name to make the tests run when the module has
changed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-08-24 13:41:26 -04:00
Manuel Argüelles f9fb4fe234 tests: gpio: nxp_s32: enable get config/direction tests
Enable tests using pin_get_config() and port_get_direction()
GPIO APIs for NXP S32 boards.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-08-24 17:21:18 +02:00
Alberto Escolar Piedras 9eeb78d86d COVERAGE: Fix COVERAGE_GCOV dependencies
CONFIG_COVERAGE has been incorrectly used to
change other kconfig options (stack sizes, etc)
code defaults, as well as some samples behaviour,
which should not have dependend on it.

Instead those should have depended on COVERAGE_GCOV,
which, being the one which adds special code and
temporary RAM storage for embedded targets,
require changes to many features.

When building for the native targets, all this was
unnecessary.

=> Fix the dependency.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-08-24 15:36:31 +02:00
Daniel Gaston Ochoa 818aa2d0c7 drivers: stm32: SPI: SPI nocache buffers can be in CONFIG_NOCACHE_MEMORY
CONFIG_NOCACHE_MEMORY is a valid way of declaring buffers in
nocache regions. Consider them valid in the stm32 SPI driver
nocache check. Also, don't check NULL buffers as the SPI
interface states that such buffers will result in sending
zeroes.

Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
2023-08-24 15:35:50 +02:00