Commit Graph

71 Commits

Author SHA1 Message Date
Juha Heiskanen
3e0ed42427 tests: mcumgr: Updated MCUmg & smp client tests
Fixed broken MCUmgr client unit test.
Added test_ -prefix to tests.
Added testcase.yaml to test trigger test run.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2023-09-19 15:21:08 +01: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
Daniel Leung
59d859eb37 tests: mgmt: rename shadow variables
Rename shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-22 11:39:58 +02:00
Jamie McCrae
5c88d45544 treewide: mgmt: mcumgr: Change "ret" to "err" for SMP version 2
This is a stable API treewide change changing the newly introduced
"ret" response to "err" as it was overlooked that the shell_mgmt
group already used "ret" to return the exit code of the command
and this created a collision. Since SMP version 2 was only recently
introduced, there should not be any public implementations of it
as of yet, but the original function has been kept and marked as
deprecated.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-21 10:18:50 +02:00
Jamie McCrae
9aa0d0f5ab tests: mgmt: mcumgr: cb_notifications: Fix SMP sync issue
Fixes an issue with a test whereby the reponse on the dummy device
can be fully send and processed prior to a callback being ran
which updates a variable, add a delay in the test to wait for the
sync to finish.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-02 11:28:41 +02:00
Anas Nashif
66969fc9a7 tests: mgmt: fix test identifiers
Use mgmt as the component, the same we use in other related tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-08-01 13:24:09 -04:00
Juha Heiskanen
9a06ce19ad tests: mcumgr: MCUmgr and smp client unit test
Added unit test for testing IMG and OS group component's.

Added Unit test for SMP Client.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2023-07-27 14:35:43 +02:00
Jamie McCrae
9f56995d35 tests: mgmt: mcumgr: all_options: Add additional checks
Adds additional checks to enable more options for the build-only
check that compilation is successful.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-27 11:16:04 +02:00
Fabio Baltieri
e7781626e7 tests: mcumgr: exclude lpcxpresso51u68
The test is failing for lpcxpresso51u68 with:

soc_flash_lpc.c:25:2: error: #error No matching compatible for
soc_flash_lpc.c
   25 | #error No matching compatible for soc_flash_lpc.c
      |  ^~~~~

Add the board to the exclude list, sort the list as well.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-07-25 09:15:46 +02:00
Jamie McCrae
f99d497281 tests: mgmt: mcumgr: Add handler_demo test
Adds a test that tests a build-only configuration of an
application which uses custom handlers is able to build, and
can be referenced in documentation.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-20 16:22:31 +02:00
Jamie McCrae
0001e23e52 tests: mgmt: mcumgr: all_options: Fix missing Kconfig
Fixes a missing Kconfig enabling MCUboot, which causes the test to
now fail to build.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-17 10:40:24 +00:00
Anas Nashif
f573a702de tests: mcumgr: os_mgmt_info: simplify test yaml file
- Use common section to avoid duplication of excludes
- use mcumgr tag

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-21 09:36:24 +00:00
Anas Nashif
7eea4b514a tests: mcumgr: update tags
add mcumgr as a tag for mcumgr tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-07 05:41:31 -04:00
Anas Nashif
a543ba1f4d tests: use integration_platforms where applicable
Use integration_platforms where coverage is provided using one or few
targets instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-05-26 17:52:02 -04:00
Jamie McCrae
083f05dcdc tests: mgmt: mcumgr: Add smp_version test
Adds a test that checks various conditions of header/responses
for MCUmgr with different protocol versions.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-05-26 15:05:29 +02:00
Dawid Niedzwiecki
aa0c0727b4 mgmt: ec_host_cmd: add config to create a dedicated thread
Add a config to decide if a new dedicated thread for Host Command is
created during initialization.

If not, the ec_host_cmd_task has to be called by another thread to
handle host commands.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-05-23 16:19:53 +02:00
Maciej Perkowski
75b062a6d6 tests: samples: Resolve duplicates in names.
Several duplicates were found with
scripts/twister -T samples/ -T tests/ --dry-run --list-test-duplicates
This is an issue since duplicated names causes overwriting of
results. Most duplicates looked like obvious copy-pase errors.
New names where addopted looking at other tests in the same yaml
or looking at the directory/descriptio.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2023-05-16 06:21:25 -04:00
Jamie McCrae
1c70aebb86 tests: mgmt: mcumgr: all_options: Fix Kconfig options
Fixes an issue with missing depdency Kconfig selections.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-05-15 09:27:16 +02:00
Jamie McCrae
1e1507f480 tests: mgmt: mcumgr: os_mgmt_info: Update callback format
Updates the format of the MCUmgr callback to use the new style.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-05-15 09:27:16 +02:00
Jamie McCrae
3d6035d37e tests: mgmt: mcumgr: cb_notifications: Update callback format
Updates the format of the MCUmgr callback to use the new style.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-05-15 09:27:16 +02:00
Gerard Marull-Paretas
93b63df762 samples, tests: convert string-based twister lists to YAML lists
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-10 09:52:37 +02:00
Dominik Ermel
1e1f3ba73c mgmt/mcumgr: Add tests for zcbor_map_decode_bulk_reset
Testing of zcbor_map_decode_bulk_reset.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-04-24 13:28:49 +02:00
Dominik Ermel
06b0e504e6 mgmt/mcumgr: Add test for zcbor_map_decode_bulk_key_found
Test case for zcbor_map_decode_bulk_key_found.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-04-21 16:28:34 +02:00
Dawid Niedzwiecki
4ef47888ef ec_host_cmd: add UART backend
Add a new backend for Host Commands that uses UART. The backend bases
asynchronous UART API.

The UART backend is mainly used by FPMCU.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-04-07 13:05:59 +02:00
Dawid Niedzwiecki
73480edf00 ec_host_cmd: update test the directory structure
Create a separate directory per backend.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-04-07 13:05:59 +02:00
Fabio Baltieri
bc612b8ebd boards: arm: add Arduino GIGA
Add support for the Arduino GIGA board, an STM32H747XI based development
board in Arduino form factor, featuring external flash, SDRAM, Bluetooth
and WiFi.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-03-06 12:33:57 +01:00
Jamie McCrae
de004f1629 tests: mgmt: mcumgr: all_options: Add FLASH_MAP and STREAM_FLASH
Adds Kconfig options that are no longer automatically selected.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-03-03 10:49:32 +01:00
Dawid Niedzwiecki
2d0a784c41 subsys/mgmt/ec_host_cmd: rework Host Command support
Rework the Host Command support. It includes:
-change API to backend
-change a way of defining rx and tx buffers
-fix synchronization between the handler and backend layer
-simplify the HC handler

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-02-28 10:42:23 +01:00
Dawid Niedzwiecki
b2674a4b34 subsys/mgmt/ec_host_cmd: rename peripheral to backend
Follow naming pattern in the subsystems(logging or shell) and name
the layer between generic handler and peripheral driver "backend".

The name doesn't suit that well to the SHI backend, because there isn't
SHI API itself and the SHI interface is used only for the host
communication. So the backend code includes the peripheral driver itself.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-02-28 10:42:23 +01:00
Dawid Niedzwiecki
e734adfb78 subsys/mgmt/ec_host_cmd: update directory structure
The Host Commands can be used with different transport layers e.g. SHI
or eSPI. The code that provides the peripheral API and allows sending
and receiving Host Commands via different transport layers is not
actually drivers of a peripheral, so move it to the
subsys/mgmt/ec_host_cmd folder.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-02-28 10:42:23 +01:00
Jamie McCrae
8051d974c3 tests: mgmt: mcumgr: fs_mgmt_hash_supported: Exclude boards
Excludes boards which do not have flash drivers which causes this
test to fail to build.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-02-20 11:27:43 +01:00
Jamie McCrae
1b4b979f87 mgmt: mcumgr: Change select to depends on in Kconfigs
Select in Kconfig causes many issues with dependency loops, this
resolves the issue by replacing most select with depends on for
MCUmgr, including updates to the sample smp_svr application and
tests.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-02-20 11:27:43 +01:00
Jamie McCrae
de313d748a tests: mgmt: mcumgr: Add callback notification grouping test
Adds a test that check that grouped events work.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-01-09 17:36:04 -08:00
Jamie McCrae
d6758557f5 tests: mgmt: mcumgr: os_mgmt_info: Check grouped events
Changes one of the callback register/unregister functions to use
2 events OR'd together instead of 2 events registered separately,
this is to help test that grouped events are working.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-01-09 17:36:04 -08:00
Dominik Ermel
db34adf9c3 mgmt/mcumgr: Standardise MCUmgr Kconfig names
Standardise Kconfig options for MCUmgr.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-12-22 12:36:34 +01:00
Jamie McCrae
d7557102c0 mgmt: mcumgr: Add iterable section to register MCUmgr handlers
This replaces the requirement for applications to manually
register MCUmgr handlers by having an iterable section which
then automatically registers the handlers at boot time.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-12-22 11:03:04 +01:00
Dominik Ermel
fc7b5a551f tests/mgmt/mcumgr/zcbor_bulk: Use ZCBOR_MAP_DECODE_KEY_DECODER
Replaces ZCBOR_MAP_DECODE_KEY_VAL with ZCBOR_MAP_DECODE_KEY_DECODER
in test and adds equivalency test between
ZCBOR_MAP_DECODE_KEY_VAL and ZCBOR_MAP_DECODE_KEY_DECODER.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-12-13 11:42:02 +01:00
Dominik Ermel
6effadd773 tests/mcumgr/zcbor_bulk: Add additional test platforms
ARM plaftorms added.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-12-12 15:01:11 +01:00
Dominik Ermel
0fdae69f25 tests/mcumgr/zcbor_bulk: Add test for map in map decoding
The zcbor_map_decode_bulk is able to decode embedded CBOR types
like maps in maps, but this has been missing proper tests.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-12-12 15:01:11 +01:00
Jamie McCrae
43b4350744 tests: mgmt: mcumgr: os_mgmt_info: Add tests
Adds tests for the os_mgmt info command.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-12-07 13:53:02 +00:00
Dominik Ermel
424185e715 tests/mgmt/mcumgr/smp_reassembly: Correct zassert messages
Two simple fixes in zassert messages where one message has
been printing incorrect variable and other has been using
formatting to just print literal 0.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-12-05 17:24:08 +01:00
Jamie McCrae
36b179c43b tests: subsys: mgmt: mcumgr: Add all options test
Adds a test which enables all Kconfig options for MCUmgr (that are
not deprecated and can be supported on the nrf52840dk board) to
ensure that if a breaking change is introduced in CI then it can
be caught.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-23 12:24:59 +01:00
Michał Barnaś
b91849c4bd ec_host_cmd: add missing fields and improve compatibility
Add missing fields in structure containing the arguments used by
the host commands handlers and change the order of parameters
in macro used for defining the handlers.

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2022-11-18 10:11:40 +01:00
Michał Barnaś
369596dc95 ec_host_cmd: increase stack size, change thread priority and alignment
This commit increases the stack size for thread handling the host
commands requests. It was required due to the stack being
corrupted using earlier default size. The thread priority is now
configurable using the Kconfig.
It also adds alignment to the tx_buffer since the npcx MCU requires it
to work correctly and removes clearing the buffer before use due to
the hard time requirements. Tests checking if buffers are cleared
are also removed.

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2022-11-18 10:11:40 +01:00
Dominik Ermel
b3833cf2bc tests/mgmt/mcumgr: Apply rework in MCUMgr subsystem
Code changes required by rework in MCUMgr souce code structure.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-11-17 15:31:17 +01:00
Dominik Ermel
4328f165a8 mgmt/mcumgr: Reworking source code tree and API interface
The commit reworks mgmt/mcumgr subsystem source code to remove
lib subdirectory and make it a little bit more flat.
It also moves all API interface files, which are supposed to be
visible by applications using MCUMgr, to interface sub-directories,
and exposes them with full paths; for example to include general
MCUMgr support, group registration and so on, user would now include:
 <mgmt/mcumgr/mgmt/mgmt.h>
to additionally have control on File System group management
registration user would need:
 <mgmt/mcumgr/mgmt/grp/fs_mgmt.h>

All internal headers have been removed from interface.

CMAkeLists.txt get significant rework and various MCUMgr subsystems
have been divided into separate sub-libraries.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-11-17 15:31:17 +01:00
Dominik Ermel
7c2924f4bc mgmt/mcumgr: Move transport headers to transport subdir
The MCUmgr transport headers have been moved to
zephyr/mgmt/mcumgr/transport/

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-11-17 15:31:17 +01:00
Anas Nashif
61b56cae44 tests: mgmt: fix tags and identifiers
Fix tags and identifiers for all mgmt subsys tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-15 05:32:28 -05:00
Jamie McCrae
379d23001f tests: mgmt: mcumgr: Add fs_mgmt_hash_supported test
Adds a test which checks that the fs_mgmt supported hash/checksum
functionality is working and returns the expected response.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-10 11:10:03 +01:00