Commit Graph

1064 Commits

Author SHA1 Message Date
Marcin Niestroj
df50fa6f1a tests: settings: remove unused settings_enc.c
This file was just built, but none of its functions were executed since the
commit 84a88f107c ("tests: subsys: settings: stream encoding tests"),
which introduced it.

At this point it makes little sense to make it run/working, mainly because
of:
 * "line" encoding, which this module intends to test, behaves differently
   based on Kconfig options like `bool SETTINGS_ENCODE_LEN`; this is set
   differently based on (FCB/File) backend used, so it is hard to make this
   "generic" tests work, because it is shared by all storage backends tests
 * base64 encoding is expected in this test module, which was dropped 2
   years ago in [1]
 * settings subsystem has changed a lot during last 4 years, so those tests
   might no longer be valid with current implementation.

[1] commit 55be783c85 ("settings: Remove deprecated SETTINGS_USE_BASE64
  support")

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-08 09:59:34 +00:00
Marcin Niestroj
eca7bd12a4 tests: settings: file: remove unused c2_var_count
This variable is just a copy-paste from FCB backend tests and actually has
no use in File backend tests.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-08 17:38:35 +09:00
Marcin Niestroj
6bb3d32f32 tests: settings: nvs: remove unused settings handlers
There are three settings handlers defined, but just the first
one (`c_test_handlers[0]`) is registered and used in NVS specific tests.
Remove unused handlers, as it is really a dead code.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-08 17:38:35 +09:00
Marcin Niestroj
f2b129d35c tests: settings: fcb: remove unused zephyr/sys/printk.h
There are no printk invocations from ztest, so drop that header.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-08 17:38:35 +09:00
Marcin Niestroj
f34ed3d181 tests: settings: fcb: remove local test_config_insert{2,3} prototypes
Both functions are declared in `settings_test.h`, so there is no reason to
declare them locally as well.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-08 17:38:35 +09: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
Yuval Peress
0f174e5758 zdsp: Fix missing kconfig and no source library
Adds a missing menuconfig for the DSP library as well as fix an issue
with the zephyr library being a STATIC library and having no sources
in the case of the cmsis backend.

Signed-off-by: Yuval Peress <peress@google.com>
2022-12-07 10:24:24 +00:00
Dominik Ermel
7c3a70a35b settings: file: Fix flash area erase offset
Incorrect erase start offset has been given.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-12-07 10:22:41 +00:00
Marcin Niestroj
47c8db5e63 tests: settings: remove passing -DTEST_${TEST} from cmake
This feature is not used in most tests, as there is no logic in C code that
utilizes `#ifdef TEST_x` statement.

The only test that does that is `tests/subsys/settings/fcb/` where `#ifdef
TEST_LONG` is used, so leave that test case untouched.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-07 10:19:57 +00:00
Marcin Niestroj
673b0665d3 tests: settings: file: remove declarations of ZTEST() routines
Remove declarations of ZTEST() routines in header file, because there is
simply no value in having it.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-06 09:45:50 -05:00
Xinyang Tan
535f5a6c04 shell: support setting help string for each entry in a dictionary command
Add support for setting the help description for each entry in a dictionary
command. Currently the syntax string alone may not provide sufficient
description of its entry. This commit also helps keep the help messages
consistent with existing style.

Signed-off-by: Xinyang Tan <xinyang.tan@delve.com>
2022-12-05 18:40:46 +01: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
Franciszek Zdobylak
659c2143b5 tests: fs: Add test of fs_mkfs
Test is added to common directory and used in LittleFS tests.

Signed-off-by: Franciszek Zdobylak <fzdobylak@internships.antmicro.com>
2022-12-05 15:36:00 +01:00
Yuval Peress
041e85303c dsp: Update tests for basicmath to use dsp subsystem
Update the relevant tests in basicmath to use the dsp subsystem. Note
that f16 is not updated since it's much more architecture specific and
did not become a part of zdsp.

Signed-off-by: Yuval Peress <peress@google.com>
2022-12-02 20:15:55 +01:00
Yuval Peress
0433965982 dsp: move cmsis_dsp basicmath tests
Move the tests to tests/subsys/dsp/ as they'll be a part of the Zephyr
dsp subsystem.

Signed-off-by: Yuval Peress <peress@google.com>
2022-12-02 20:15:55 +01:00
Krzysztof Chruscinski
6efc55e8d7 tests: logging: log_immediate: Add LOG_PRINTK=n
Do not direct printks to logging subsystem in the test.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-12-01 00:36:13 +09:00
Anas Nashif
ba7d730e9b tests/samples: use integration_plaforms in more tests/samples
integration_platforms help us control what get built/executed in CI and
for each PR submitted. They do not filter out platforms, instead they
just minimize the amount of builds/testing for a particular
tests/sample.
Tests still run on all supported platforms when not in integration mode.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-29 16:03:23 +01:00
Krzysztof Chruscinski
063984d0b8 tests: logging: log_link_order: Align to LOG_PRINTK as default
Alignging test to a change which enabled LOG_PRINTK as default.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Krzysztof Chruscinski
1cfe927629 tests: logging: log_links: Align to LOG_PRINTK as default
Alignging test to a change which enabled LOG_PRINTK as default.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Krzysztof Chruscinski
85052a1383 tests: openthread: Align to LOG_PRINTK as default
Alignging test to a change which enabled LOG_PRINTK as default.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Krzysztof Chruscinski
34010e3bd0 tests: logging: log_switch_format: Align to LOG_PRINTK as default
Alignging test to a change which enabled LOG_PRINTK as default.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Krzysztof Chruscinski
fe4a4ce2ad tests: logging: log_syst: Align to LOG_PRINTK as default
Alignging test to a change which enabled LOG_PRINTK as default.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Krzysztof Chruscinski
ea3d03439c tests: logging: log_core_additional: Align test to LOG_PRINTK changes
Align test to accomodate for a change that LOG_PRITNK is by default
enabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Anas Nashif
808266a493 tests: use ignore_fault field instead of tags
Use dedicated field in the yaml file instead of mixing this testing
feature with tags.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-25 06:38:05 -05:00
Marcin Niestroj
daee6cb4a9 settings: file: change FS (or file system) wording to File
Currently there is inconsistency in repository file names, APIs, Kconfig
options and documentation around file / file-system backend for settings
storage, as both "file" and "FS (file system)" are used. As an example,
there is `CONFIG_SETTINGS_FS` Kconfig option, but the file that implements
this settings backend is called `settings_file.c`. Another example are
names of static functions that implement settings storage API:
`settings_file_load()`, `settings_file_save()` and
`settings_fs_storage_get()`.

This backend is actually storing all settings in a single file, so it makes
sense to use "File" as the name of backend, instead of a more general
"FS" (which would make sense if several files would be used to store
settings).

Fix inconsistency in used wording in the tree and unify it to "settings
file backend". This naming is more precise to how the implementation looks.
It will also make it easier to grep through the codebase and analyze
existing code.

Deprecate settings_mount_fs_backend() function and all Kconfig options
starting with `CONFIG_SETTINGS_FS`.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-11-24 09:36:31 +01:00
Anas Nashif
cffe98d9de crc: Make the build of crc function dependent on a Kconfig
Add CONFIG_CRC for building CRC related routines.
CRC routines are now being built for each application, whether used or
not and are add in the build system unconditionally.

Keep CONFIG_CRC enabled by default for now and until all users have
converted to use the new option.

Partial fix for #50654

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-23 13:30:00 +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
Robert Lubos
387a66131e net: pkt: Introduce minimum length requirement to net_pkt_get_frag()
net_pkt_get_frag() and a few other functions did not specify the
allocated fragment length, incorrectly assuming that fixed-sized
buffers are always used.

In order to make the function work properly also with variable-sized
buffers, extend the function argument list with minimum expected
fragment length parameter. This allows to use net_buf_alloc_len()
allocator in variable buffer length configuration, as well as verify if
the fixed-sized buffer is large enough to satisfy the requirements
otherwise.

Update the existing codebase to provide the expected fragment length,
based on the context.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-11-19 07:39:32 -05:00
Andrei Emeltchenko
1ad63d9c13 tests: ibecc: Use LOG api instead of TC_PRINT()
Use proper LOG API instead of TC_PRINT() function for logging output.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-11-19 14:18:40 +09:00
Andrei Emeltchenko
e51c219c6c tests: ibecc: Use Z_TEST_SKIP_IFNDEF() to skip tests
Remove #ifdefs and use macro Z_TEST_SKIP_IFNDEF(). Makes code cleaner
when removing #ifdefs for the price including little bit more code to
one test.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-11-19 14:18:40 +09:00
Andrei Emeltchenko
a7036886de tests: ibecc: Add clearing after injection
Clear registers and injection parameters after test.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-11-19 14:18:40 +09:00
Andrei Emeltchenko
f81a4213df tests: ibecc: Make all tests as separate tests
After several fixes all tests can now be separated.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-11-19 14:18:40 +09:00
Andrei Emeltchenko
74ab62da57 tests: ibecc: Keep track of errors for test shuffling
Keep track of errors which needed if tests are shuffled and API tests
are executed after error injection tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-11-19 14:18:40 +09:00
Andrei Emeltchenko
66966145a5 tests: ibecc_cov: Simulate correct register value
Simulate ECC_ERROR_CERRSTS when reading from register
IBECC_ECC_ERROR_LOG.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-11-19 14:18:40 +09:00
Andrei Emeltchenko
bf1c213e4c tests: ibecc: Use test_fail() instead of k_oops.
Use right API ztest_test_fail() instead of k_oops() and indicate
possible reason.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-11-19 14:18:40 +09:00
Andrei Emeltchenko
ba7d5b7e7f tests: ibecc: Add more debug information
Add more debug information for testing.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-11-19 14:18:40 +09: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
Michał Barnaś
959d3b87fb ec_host_cmd: move the host_cmd_periph.h to subdirectory
Move the header file to corresponding directory which refers to
submodule name instead of root of drivers directory.

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
Andrei Emeltchenko
984effb486 tests: ibecc: Improve test documentation
Make documentation more readable by using code-blocks.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-11-17 11:16:28 +00: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
Rodrigo Peixoto
f8f7523422 tests: zbus: Add zbus runtime observer registration tests
Add zbus subsystem test to verify the channel's runtime observers list
usage. It demonstrates the use of dynamically add and remove observer to
and from channels at runtime.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2022-11-14 17:25:29 -05:00
Rodrigo Peixoto
02b32d8703 tests: zbus: Add zbus dynamic channels tests
Add zbus subsystem test to verify the dynamic channel usage.
It demonstrates the use of static and dynamic external messages.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2022-11-14 17:25:29 -05:00
Rodrigo Peixoto
74797dd736 tests: zbus: Add zbus user_data usage tests
Add zbus subsystem test to verify the user_data usage does not affect
the normal behavior.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2022-11-14 17:25:29 -05:00
Rodrigo Peixoto
26f7d69d9e tests: zbus: Add zbus integration tests
Add zbus subsystem test to verify threads integration based on usual
interaction, masking observers, and delayed interaction to verify semaphore
and queue event dispatcher timeout.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2022-11-14 17:25:29 -05:00
Rodrigo Peixoto
ccae33461a tests: zbus: Add zbus unittests
Add zbus subsystem test to verify read-only and hard channels.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2022-11-14 17:25:29 -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