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>
Devices with write block size greater than 16 could not use settings_fcb
due to small buffer size.
Update value in test as well.
Signed-off-by: Nicolas VINCENT <nicolas.vincent@vossloh.com>
The scratch partition is not needed since MCUboot now operates in
swap using move mode instead of swap with scratch, as a result, the
main partitions on Nordic nRF51, nRF52, nRF53 and nRF91 boards can be
expanded to help in fitting large applications to them.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
All per-platform prj_*.conf files are the same as prj.conf, so there is no
need to duplicate those configuration files.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This option is selected by default, so there is no need to select it
explicitly. Additionally, selecting this option for native_posix platforms
results in configuration time warning due to unsatisfied
!NATIVE_APPLICATION dependency.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Remove CONFIG_ARM_MPU=n from all settings tests. This is possible due to
CONFIG_MPU_ALLOW_FLASH_WRITE=y automatically being enabled, which was not
true some time ago.
Enabling ARM MPU allows to detect stack overflows during tests runtime.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Running tests on `nrf52840dk_nrf52840` with ARM MPU enabled results in
following error:
Running TESTSUITE settings_config_fs
===================================================================
I: LittleFS version 2.5, disk version 2.0
I: FS at mx25r6435f@0:0x0 is 16 0x1000-byte blocks with 512 cycle
I: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
E: WEST_TOPDIR/modules/fs/littlefs/lfs.c🔢 Corrupted dir pair at \
{0x0, 0x1}
W: can't mount (LFS -84); formatting
E: ***** MPU FAULT *****
E: Stacking error (context area might be not valid)
E: Data Access Violation
E: MMFAR Address: 0x20001f78
E: r0/a1: 0x00000000 r1/a2: 0x00000000 r2/a3: 0x00000000
E: r3/a4: 0x0000b461 r12/ip: 0x00000000 r14/lr: 0x0000da8d
E: xpsr: 0x00003800
E: Faulting instruction address (r15/pc): 0x00000000
E: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
E: Current thread: 0x20000468 (main)
E: Halting system
Increase main stack size to 2kB to prevent stack overflow.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Tests are passing now on `nrf52840dk_nrf52840` platform, just because ARM
MPU is disabled and stack overflow is not detected. When running those
tests on `qemu_x86` there is following error during runtime:
START - test_config_compress_reset
E: Double Fault
E: EAX: 0x0011c1c8, EBX: 0x00000002, ECX: 0x00000002, EDX: 0x0000100a
E: ESI: 0x0000000a, EDI: 0x0021f370, EBP: 0x0021f000, ESP: 0x0021f000
E: EFLAGS: 0x00000202 CS: 0x0008 CR3: 0x0022b000
E: call trace:
E: EIP: 0x001075be
E: corrupted? (bp=0x21f000)
E: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
E: Current thread: 0x11b140 (test_config_compress_reset)
E: Halting system
Same happens on `nrf52840dk_nrf52840` when ARM MPU is enabled:
START - test_config_compress_reset
E: ***** MPU FAULT *****
E: Stacking error (context area might be not valid)
E: Data Access Violation
E: MMFAR Address: 0x20008cb8
E: r0/a1: 0x39beca54 r1/a2: 0x9abe9566 r2/a3: 0xe333d994
E: r3/a4: 0x41387fc2 r12/ip: 0x7c2e5c00 r14/lr: 0xdc5006d9
E: xpsr: 0x81000000
E: Faulting instruction address (r15/pc): 0x0000b50e
E: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
E: Current thread: 0x200001d8 (test_config_compress_reset)
E: Halting system
Increase ZTEST stack size to 2kB to prevent stack overflow.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
There is already CONFIG_SETTINGS_FILE_PATH, which is set to full file path,
while CONFIG_SETTINGS_FILE_DIR is required to be set to its parent
directory. This is redundant, as parent directory path can be easily found
out either during runtime or optionally during buildtime by CMake.
CONFIG_SETTINGS_FILE_DIR was actually introduced recently after Zephyr 3.2
release as a replacement of deprecated CONFIG_SETTINGS_FS_DIR. This means,
that there is no need to deprecate it for 3.3 release and dropping it
should be fine. Adjust 3.3 release notes accordingly, so that
CONFIG_SETTINGS_FILE_PATH will be used directly.
This patch stops using deprecated CONFIG_SETTINGS_FS_DIR. There is actually
no value in respecting it, as setting anything other than parent directory
of CONFIG_SETTINGS_FS_FILE makes no sense.
There is actually one use of CONFIG_SETTINGS_FILE_DIR in file backend
tests, to derive directory for files containing tested settings.
CONFIG_SETTINGS_FILE_PATH is not used there, so it makes little sense to
derive directory name from it. Instead, just use hardcoded "/settings"
subdirectory, as this was the default value of CONFIG_SETTINGS_FILE_DIR.
Deriving parent directory can be done either in runtime or in
buildtime (e.g. using some helper CMake function). Doing it in runtime
however allows to create directory recursively (which this patch actually
implements), e.g. for some more nested FS tree structure. Additionally it
will simplify migration of settings configuration from Kconfig to
device-tree (yet to be developed feature).
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
There is little point in keeping separate:
* tests/subsys/settings/file
* tests/subsys/settings/file_littlefs
directories, `file_littlefs` is just a thin layer used to setup test suites
for tests implemented in `file` directory.
Merge both directories together. Support for new FS can be added by simply
adding:
* new `settings_setup_<FS_OF_CHOICE>.c` which implements
`config_setup_fs()` function
* expanding `testcase.yaml` to add new tests with
`CONFIG_FILE_SYSTEM_<FS_OF_CHOICE>=y` extra config option
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Do some internal renaming to relax dependency on using LittleFS
specifically, making this test likely to be run on any FS.
Rename device-tree partition name `littlefs_dev` ->
`settings_file_partition`, so as does not need to be LittleFS to be
mounted and used for File settings storage.
Rename `config_setup_littlefs()` to `config_setup_fs()`, which can be
implemented for any other FS of choice.
Change FS mount point from '/littlefs' to '/fs'.
Rename `settings_test_littlefs.c` -> `settings_test_fs.c`, as this one just
defines test suites and there is nothing LittleFS specific.
Build `settings_setup_littlefs.c` only when
`CONFIG_FILE_SYSTEM_LITTLEFS=y`, so that any other FS can be added at a
later point with its specific implementation of `config_setup_fs()`
function.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Move `config_setup_littlefs()` prototype to header file, so that potential
type mismatch will be detected by both `settings_setup_littlefs.c`
implementing it and `settings_test_littlefs.c` using it.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
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>
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>
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>
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>
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>
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>
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>
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>
The commit switches flash area access from FLASH_AREA_ macros
to FIXED_PARTITION_ macros and to usage of DTS node labels,
to identify partitions, instead of label property.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.
The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.
NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
test cases in tests/subsys/settings/fcb, tests/subsys/settings/littlefs,
tests/subsys/setttings/nvs all depend on tests/subsys/settings/src and
tests/subsys/settings/fs, so update them in one commit.
Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
The commit fixes code to pick flash parameters from flash area
device rather than chosen 'zephyr,flash'.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Some files were missed during the migration. This patch adds the prefix
where missing.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Added API function +int settings_storage_get(void **storage)
which allows to get storage instance used by the
settings backed to store its records.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
./raw directories for each testsuite were remains after having
base64 encoding test variant beside which raw variant was existing.
This patch flatten the directories structures.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
These tests are identical as RAW variant,
since the base64 settings encoding was removed (#26053)
from the settings.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Adds few missing zephyr/ prefixes to leftover #include statements that
either got added recently or were using double quote format.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Update the structure to reduce redundancies with additional config
files needed for native_posix platforms that replicate most of the
same config values.
Signed-off-by: Yuval Peress <peress@google.com>
The functional tests for settings subsystem regressed with the
introduction of the weak test_main function. This was caused by
Issue #19582 since the common code was being linked as a library.
Update the logic of the common code to directly add the sources
to the `app` target. This resolved both Issue #19582 and #42396
Signed-off-by: Yuval Peress <peress@google.com>
Tests running on native_posix and native_posix_64 are selecting
CONFIG_STDOUT_CONSOLE, but this config value depends on
!NATIVE_APPLICATION. This configuration causes the CI to fail.
Signed-off-by: Yuval Peress <peress@google.com>