Some of defines are present in several header files.
Those defines are the same with value but with different naming.
Common defines are brought to usb_common.h
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
Extended flash simulator for posix architecture to read/write data
from a binary file on the host file system.
Further enable the flash simulator by default on native_posix(_64)
boards and updated the documentation accordingly.
Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
Running the test under valgrind identified three places where an
uninitialized stack buffer was used as the source of data over which a
CRC was incidently calculated, causing an uninitialized value warning
in the CRC calculation. Zero out the source buffers before using them
as a data source.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Some cleanup in tests code as after duplicates filtering
was introduced there is no need to interpret 0-length readout in
settings h_set handler
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
There are two set of code supporting x86_64: x86_64 using x32 ABI,
and x86 long mode, and this consolidates both into one x86_64
architecture and SoC supporting truly 64-bit mode.
() Removes the x86_64:x32 architecture and SoC, and replaces
them with the existing x86 long mode arch and SoC.
() Replace qemu_x86_64 with qemu_x86_long as qemu_x86_64.
() Updates samples and tests to remove reference to
qemu_x86_long.
() Renames CONFIG_X86_LONGMODE to CONFIG_X86_64.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
According to the comment in #20008 I found out that some test cases
for different tests have same names.
To get rid of it, I decided to change test cases names.
Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
According to the comment in #20008 I found out that some test cases
for different tests have same names.
To get rid of it, I decided to change test cases names.
Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
Some test cases have the same test case name.
To get rid of it, I decided to change test cases names
contained same names.
Please check my logic, how I give them names.
Usually trying to give name same as a directory folder.
There are still more test cases which necessary to change,
but I will make changes by small steps.
Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
NVS back-end initialization should fetch size of the flash erase blocks
from the flash API instead of DT. This allows to work well when used
storage partition is not located in embedded memory.
NVS back-end sector multiplier configuration was set to 8K as
DT value for native posix targets
flash sector sizes is 1 B, while its flash driver supports 8k.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Stops leaking very long source paths in build directories; makes them
deterministic. Finishes what was started in commit b4282bf72d, see
rationale and code reviews there.
See also CMake issue https://gitlab.kitware.com/cmake/cmake/issues/19475
for more details.
Use the opportunity to remove the most obvious duplication.
Test with: sanitycheck -T $ZEPHYR_BASE/tests/subsys/settings/
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit fixes the FCB delete test after PR #19541.
Now the entity callback is not called on deleted element.
Issue: #19963
Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
This commit adds a possibility to activate duplicates filtering
during direct loading.
JIRA: NCSDK-3017
Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
This commit adds a possibility to activate duplicates filtering
during direct loading.
JIRA: NCSDK-3017
Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
A few settings module variables were not initialized before used.
Normally these variable are initialized in the back-end
initialization call which couldn't be done in affected unit tests.
This path initialize these variable via assignments in test code.
fixes#19722
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Re-run with updated script to convert integer literal delay arguments to
k_sleep to use the standard timeout macros.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Stops leaking very long source paths in build directories; makes them
deterministic.
Besides satisfying a CMake requirement, the new empty_file.c provide a
clue that the actual test code is not in the directory of the test case.
See https://github.com/zephyrproject-rtos/hal_nordic/pull/6 and
https://gitlab.kitware.com/cmake/cmake/issues/19475 for more details.
- Test with a simple:
sanitycheck -T $ZEPHYR_BASE/tests/subsys/settings/functional/
- Before:
CMakeFiles
├── app.dir
│ ├── HOME
│ │ └── JOHN
│ │ └── zephyrproject
│ │ └── zephyr
│ │ └── tests
│ │ └── subsys
│ │ └── settings
│ │ └── functional
│ │ └── src
│ │ └── settings_basic_test.c.obj
- After:
func_test_bindir/
├── CMakeFiles
│ └── settings_func_test.dir
│ └── settings_basic_test.c.obj
│
├── libsettings_func_test.a
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Application board.overlay files tend to be paired with
boards/board.conf files that extend the functionality of a board.
Move the overlay files to the same location as the config files that
they work with.
A few overlay files that are paired with a prj_board.conf file in the
application root directory are left in place.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Mostly build tests now, will be extended to verify CTF output once we
have this feature in sanitycheck.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Integrated Settings module tests with the NVS backend. The batch of
tests is shared with other backends.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Changed the name of functional tests for NVS and FCB in the test
configuration file to avoid duplication with other test suites.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Limited the scope of helper functions that are used in the common test
source. Now it is easier to identify which functions are intended to be
used in the test suite.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
As it stands, this option leads to conflict between Newlib and POSIX
headers. (Which needs to be resolved separately.)
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This commit allows loading data from settings permanent storage
directly to the given callback function.
Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
Platforms with limited flash are now failing to link. Add or increase
flash requirements for test cases to exclude the ones that will fail.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
The test needs to cram at least 8 messages into the log buffer, but
with 64-bit pointers only 5 fit, so make the buffer a bit bigger.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>
We don't allow an ifdef in ztest_test_suite because its a macro. We
usually handle this by defining multiple blocks and ifdef around them.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Fatal error reporting now only dumps to the log mechanism,
so enable it in immediate mode for all tests to ensure
that fatal errors are visible and no messages are lost.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Switch form using privater FCB error codes to
errno codes. FCB private codes convention were compatible
with <errno.h> codes:
- 0 mean success
- negative values mean errors
- similar error types.
There was no sense to kept private FCB error codes.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Extended case for testing deletion of the first entry while
it is the most recent one.
This extension allow to reproduce issue #18813 and shows that
the bugfix works well.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Make sure that the last entry added is deleted correctly by storing the
fact that one was found in a local variable.
Fix by Laczen JMS <laczenjms@gmail.com>
Fixes#18813.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The test assumes that storage is clear before it runs. This
might be not true as lot of devices are only partially erased by
'west flash'.
Patch introduce procedure for testing whether test runs the first
time and clear storage if so.
The procedure uses mark which is stored inside SoC embedded program
flash. It will not work one devices on which read/write to it is
impossible.
fixes#16463
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Add test for check whether deleted entry is recognized properly
after settings reload.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Closes#18392 by asserting and returning an error if the block size is
not positive.
Closes#18458. The diagnosis here was not relevant as an in-range EOS
is written before the buffer is used, but using the non-terminated
length is slightly more clear about intent and may avoid a read overrun
of the mount point.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This emulates a RISC-V in 64-bit mode on a SiFive FE310 dev board.
Memory is tight so a few tests had to be disabled due to the extra
memory usage compared to qemu_riscv32.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Added tests of flash driver compatibility with fcb-backend.
For flash drivers which support write-block-size bigger than 1 B
test of unaligned data access uses native write-block-size
as it is dedicated to check whether settings works well on platform
which has 1 B access which is native on the current DUT.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Added test for check behavior on deleting existent entry,
nonexistent entry and already deleted entry.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Added test for check wheter initialization works well when nvs
storage is full filled. Test also check weheter can delet any
entry from full filled NVS.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
There's desire to be able to customize parameters on a per-filesystem
basis, which means we need a way to override the Kconfig defaults which
are global. This also means the littlefs data structure cannot own the
cache and lookahead buffers.
Switch to using a macro to define the littlefs data structure. The
default version uses the Kconfig constants. A custom one takes
arguments providing the most likely partition-specific parameters.
Finally the user is free to bypass the helper macros and set any
parameters desired, though validation is limited and only present when
CONFIG_DEBUG is enabled.
Extend the test suite with a performance module, which confirms that
these settings have an impact proportional to the log of changes to the
cache or IO sizes.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>