Commit graph

374 commits

Author SHA1 Message Date
Kamil Piszczek
43943b94d7 tests: subsys: settings: tightening scope of common test functions
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>
2019-09-27 10:06:40 -07:00
Paul Sokolovsky
ae5a7bb579 tests: subsys: jwt: Remove unneeded CONFIG_PTHREAD_IPC option
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>
2019-09-25 20:56:29 -07:00
Radoslaw Koppel
6c2add5445 settings: Direct loading functionality
This commit allows loading data from settings permanent storage
directly to the given callback function.

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2019-09-24 14:15:38 +02:00
Peter Bigot
d2ad8fca48 tests: exclude platforms with limited flash
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>
2019-09-23 17:49:46 -07:00
Jan Van Winkel
7a70fa8488 usb: tests: Pass correct lengths to hexdump in usb bos test
Pass correct length to hexdump in usb bos test to prevent overun
of global data.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-09-16 15:33:10 -05:00
Charles E. Youse
097c30c863 tests/subsys/logging/log_core: increase log buffer size
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>
2019-09-15 11:33:47 +08:00
Kumar Gala
69ba9dafcb tests/subsys/settings/fcb: Fix ifdef in ztest_test_suite
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>
2019-09-13 10:27:49 -05:00
Andrew Boie
2192499fe0 tests: enable log in immediate mode by default
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>
2019-09-12 05:17:39 -04:00
Andrzej Puzdrowski
94a022c954 fcb: start using errno codes
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>
2019-09-08 12:42:53 +02:00
Jan Van Winkel
4539c4bee1 tests: littlefs: Added support for native posix
Added support for native posix boards to littlefs tests.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-09-08 12:35:39 +02:00
Kamil Piszczek
c05b0c74a3 tests: subsys: settings: functional: nvs & fcb split for CI
Splitted configuration for NVS & FCB so it is possible for the CI to
pick it up.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-09-08 12:35:15 +02:00
Kamil Piszczek
03c79fa10e tests: subsys: settings: functional: fix for nvs backend
Fixed build failure for the Settings NVS backend.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-09-08 12:35:15 +02:00
Andrzej Puzdrowski
6bae22d290 tests/subsys/fs/nvs: extend entry delete test
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>
2019-09-02 12:31:42 +02:00
Carles Cufi
6f5dc33ef4 nvs: Fix deletion of the last entry added
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>
2019-09-02 12:31:42 +02:00
Carles Cufi
351bef1dd2 tests: settings: Fix coverity issue CID 203623
Mask the value passed to memset() to avoid an error from Coverity.

Fixes #18687.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-08-30 12:30:59 +02:00
Andrzej Puzdrowski
93702e2daf tests/subsys/settings/fcb_int: add storage preparation
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>
2019-08-24 00:58:41 +02:00
Andrzej Puzdrowski
bf4c969b62 tests/subsys/settings/fcb: deletion test
Add test for check whether deleted entry is recognized properly
after settings reload.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-08-20 13:18:38 +02:00
Peter Bigot
204c9971ab subsys/fs/littlefs: fix Coverity issues
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>
2019-08-19 08:34:17 +02:00
Nicolas Pitre
7f74825958 riscv: add a qemu_riscv64 board
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>
2019-08-09 09:11:45 -05:00
Andrzej Puzdrowski
27109e6378 tests/subsys/settings/fcb: add check for target compatibility
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>
2019-08-08 08:47:44 -05:00
Andrzej Puzdrowski
f46cf1d6d2 tests/subsys/fs/nvs: entry delete test
Added test for check behavior on deleting existent entry,
nonexistent entry and already deleted entry.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-08-08 11:07:48 +02:00
Andrzej Puzdrowski
84d657c217 tests/subsys/fs/nvs: init on full storage test
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>
2019-08-08 11:07:48 +02:00
Peter A. Bigot
167eb53e74 subsys/fs/littlefs: allow customization of file system configuration
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>
2019-08-06 19:39:26 +02:00
Peter A. Bigot
a8b7a21524 subsys/fs: remove ambiguity in readdir results
Existing file system implementations do not provide the special "."
(current) and ".." (parent) directory entries in the readdir results.
littlefs does.

Remove these entries in the abstraction layer.  This simplifies code in
higher level consumers that aren't prepared to see them.  Consumers like
FUSE that need them can put them back without having to worry about
conflicts.

Closes issue #17951

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-06 19:39:26 +02:00
Peter A. Bigot
979fb85d50 tests/subsys/fs/littlefs: add tests
Verify all FS API calls using the nRF52840 development kit.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-06 19:39:26 +02:00
Anas Nashif
ffaba63b10 boards: remove arduino 101 and related boards
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Peter A. Bigot
c59bac35db tests/subsys/settings/functional: test external flash
Use the external flash on the Particle Xenon to confirm basic
functionality on a spi-nor device.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-24 09:20:56 -04:00
Peter A. Bigot
33b10aa76a tests/subsys/settings/functional: ensure settings area is cleared
The test assumes that the settings area is empty.  This happens
naturally when the area is in the SOC flash and the chip flash is
entirely erased when the test is programmed.  The test will fail if the
programmed board is reset and the test run again.

The test cannot pass by reprogramming when the storage area is in an
external flash device.

Make things repeatable for FCB by erasing the storage partition before
running the test.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-24 09:20:56 -04:00
Peter A. Bigot
765c06376c Revert "sys/util.h: helper macro to perform pointer difference"
This reverts commit 755cc644cc.

This approach is problematic in several ways.  First, `intptr_t` could
cause undefined behavior in the subtraction when the pointer converts to
a negative value.  Except in weird cases where the sign of the pointer
identifies a memory domain (like kernel vs userspace) I'm unaware of any
valid use of `intptr_t`.

Second, this macro was created to address a special need that cannot
rely on defined behavior: i.e. to ensure that data definitions are
placed in contiguous space and access is provided through linker-defined
symbols, for which the language required alignment and continuity is not
guaranteed.

A macro that calculates the span between linker symbols has very
different semantics than one that calculates the difference between
pointers.  Replace the global PTR_DIFF with a documented local macro
that tests what's necessary without risking integer overflow.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-17 03:44:03 -04:00
Nicolas Pitre
6609c12516 tests: enable native_posix_64 testing
Whenever conditions are applied to native_posix, they should apply to
native_posix_64 too.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-07-16 10:41:11 -07:00
Nicolas Pitre
9fac66ca54 tests: usb: make 64-bit compatible
Let's use the PTR_DIFF() helper which performs pointer difference in a
64-bit compatible way, and use %zu for printing sizeof() results.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-07-12 17:39:43 -07:00
Nicolas Pitre
0aa796cbaa print format: adjust specifiers to be compatible with a 64-bit build
The size_t type is either compatible with an int on 32-bit target, or
a long on 64-bit targets. It could even be a long even on some 32-bit
targets. Let's use the z qualifier in the printf format to be compatible
with whatever flavor in use.

In case of pointers, let's just use %p with pointers directly and
avoid casts altogether.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-07-11 20:12:26 -07:00
Nicolas Pitre
d7e49ee3e7 tests: subsys: settings: fix pointer mismatch on 64-bit targets
This fixes the following error:
passing argument 5 of ‘fsutil_read_file’ from incompatible pointer type

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-07-11 09:40:20 +02:00
Kamil Piszczek
2222d14549 tests: settings: adding nvs backend configuration to functional tests
Added the NVS backend configuration to functional tests of the Settings
module.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-07-10 10:57:22 +02:00
Nicolas Pitre
6455ddbd4e test/usb: fix pointer type mismatch
The 4th argument of usb_dc_ep_write() should be a u32_t* not a size_t*.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-07-05 14:16:50 -04:00
Johann Fischer
ab8bcd2044 tests: usb: do not set device address
Forced attempt to set the device address is unpredictable
and also should not be done during testing.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-07-04 21:36:07 +02:00
Nicolas Pitre
70e77becb1 shell_history_test: make the test succeed on 64-bit targets
A buffer size of 128 bytes is just not quite big enough on 64-bit
targets.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-07-04 07:24:56 -04:00
Ioannis Glaropoulos
e8f2d86d94 tests: remove redundant CONFIG_HW_STACK_PROTECTION=y setting
CONFIG_TEST_HW_STACK_PROTECTION is set by default in tests,
and that one selects HW_STACK_PROTECTION option. Therefore,
we do not need to set that one explicitly in the test project
configuration files. We clean up some redundant occurrences of
CONFIG_HW_STACK_PROTECTION=y from the tree.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-07-01 12:54:20 -07:00
Anas Nashif
5b0aa794b2 cleanup: include/: move misc/reboot.h to power/reboot.h
move misc/reboot.h to power/reboot.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
9ab2a56751 cleanup: include/: move misc/printk.h to sys/printk.h
move misc/printk.h to sys/printk.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
5d001f3e41 cleanup: include/: move misc/byteorder.h to sys/byteorder.h
move misc/byteorder.h to sys/byteorder.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
5eb90ec169 cleanup: include/: move misc/__assert.h to sys/__assert.h
move misc/__assert.h to sys/__assert.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
fe051a9055 cleanup: include/: move flash.h to drivers/flash.h
move flash.h to drivers/flash.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
c0c9396d44 cleanup: include/: move can.h to drivers/can.h
move can.h to drivers/can.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
4be2e9ebb6 cleanup: include/: move zephyr/jwt.h to data/jwt.h
move zephyr/jwt.h to data/jwt.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
0abdacf3a4 cleanup: include/: move json.h to data/json.h
move json.h to data/json.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
f641d099cc cleanup: include/: move disk_access.h to disk/disk_access.h
move disk_access.h to disk/disk_access.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
52e0efac97 cleanup: include/: move stats.h to stats/stats.h
move stats.h to stats/stats.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
f048792888 cleanup: include/: move nvs/nvs.h to fs/nvs.h
move nvs/nvs.h to fs/nvs.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
d918c98e1d cleanup: include/: move fcb.h to fs/fcb.h
move fcb.h to fs/fcb.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
656f4dfdac cleanup: include/: move fs.h to fs/fs.h
move fs.h to fs/fs.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
83508a5677 cleanup: include/: move flash_map.h to storage/flash_map.h
move flash_map.h to storage/flash_map.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Johann Fischer
abaeaed2af usb: sort usb config data by section
USBD_CFG_DATA_DEFINE macro has not consider that a class
could have more than one set of usb_cfg_data struct.
If a class has more than one set of usb_cfg_data
then they should be sorted the same way like by
USBD_DEVICE_DESCR_DEFINE macro.

Fixes: #16240

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-06-27 12:18:05 +02:00
Charles E. Youse
ca4910827b boards/x86/quark_d2000_crb: drop support for Quark D2000 dev board
Remove the board directory as well as references in tests and samples.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-25 08:06:43 -04:00
Nicolas Pitre
1fd379da44 log_msg test: rework test_log_std_msg() to better cope with 64-bit builds
Remove #ifdef's and use a loop to avoid duplicating the code.

Suggested by Krzysztof Chruscinski.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-24 08:58:52 +02:00
Nicolas Pitre
6987937582 log facility: make its records 64-bit compatible
Log records may store either data or pointers to more records. In both
cases they must have the same size. With 64-bit pointers, the amount
of data that can occupy the same space as a pointer has to be adjusted.
And storage alignment has to accommodate actual pointers not u32_t.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-24 08:58:52 +02:00
Nicolas Pitre
0567f161d8 log facility: make its arguments 64-bit compatible
Log arguments were hardcoded to u32_t values. On 64-bit systems, this
is rather restrictive. To make things clear, arguments now have their
own type, log_arg_t, which now can be adjusted in only one location
if need be.  It is currently defined as unsigned long whose effective
width is equivalent to u32_t on 32-bit systems, and u64_t on 64-bit
systems.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-24 08:58:52 +02:00
Marc Herbert
3f9151dae6 tests: minor FCB re-ordering not to leave a random flash.bin behind
The last FCB test to run (fcb_test_last_of_n) uses uninitialized
test_data[] and leaves behind a flash.bin with random content. Pick
another one (fcb_test_reset) that leaves a deterministic flash.bin
behind and run that last instead.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-06-21 13:44:40 +02:00
Anas Nashif
f2cb20c772 docs: fix misspelling across the tree
Found a few annoying typos and figured I better run script and
fix anything it can find, here are the results...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-19 15:34:13 -05:00
Ulf Magnusson
eba81c6e54 yaml: Remove redundant document separators
YAML document separators are needed e.g. when doing

  $ cat doc1.yaml doc2.yaml | <parser>

For the bindings, we never parse concatenated documents. Assume we don't
for any other .yaml files either.

Having document separators in e.g. base.yaml makes !include a bit
confusing, since the !included files are merged and not separate
documents (the merging is done in Python code though, so it makes no
difference for behavior).

The replacement was done with

    $ git ls-files '*.yaml' | \
        xargs sed -i -e '${/\s*\.\.\.\s*/d;}' -e 's/^\s*---\s*$//'

First pattern removes ... at the end of files, second pattern clears a
line with a lone --- on it.

Some redundant blank lines at the end of files were cleared with

    $ git ls-files '*.yaml' | xargs sed -i '${/^\s*$/d}'

This is more about making sure people can understand why every part of a
binding is there than about removing some text.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-06-19 10:40:10 +02:00
Laczen JMS
36edf92ca8 subsys/settings: change processing to const char
The settings module processes the variable name by splitting it up in
a set of variables. This PR removes the splitting up and keeps the
variable name as one string.

It is an alternative to #16609

The possibility is introduced to register handler including a
separator, or to register a handler for each variable.

The ability is introduced to load a subtree from flash or even to load
a single item.

Two ways to operate on variable and settings_handler names are provided:

settings_name_steq(const char *name, const char *key, const char **next)
which checks if name starts with key, returns 1/0 if it does/does not
the remaining part of name is in next.

settings_name_split(const char *name, char *argv, const char **next)
which splits up name in a part before "/"" that is found in argv and
the remaining part that is in next.

A mutex is added to make settings thread-safe

The settings_handlers list is stored in reverse alphabetical order, this
allows registration of e.g. bt and bt/mesh in separate handlers, the bt
handler itself should not contain any handling of bt/mesh.

A settings_deregister() method is added. Settings_handlers can now be
added/removed when required. This saves RAM when settings_handlers are
not needed.

Tests have been updated to reflect changes in the settings api.

Updates after meeting:
1. Removed settings_deregister

2. Changed settings_name_split() in settings_name_next:

int settings_name_next(const char *name, const char **next): returns
the number of characters before the first separator. This can then be
used to read the correct number of characters from name using strncpy
for processing.

3. New functional test added

Update in settings.h: settings_name_next() changed position -> index

Added some comments in settings.h (settings_name_steq())

Updated tests to reflect change to settings_name_next() and pointer
value comparison. The functional test can now also run on qemu_x86.

Corrected some documentation in header.

Changed registration of handlers to be non ordered.

Changed handler lookup to handle non ordered list of handlers, this
improves handler matching in case different length names are compared
and also makes it easier to add rom based handlers as they will not be
ordered.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2019-06-18 17:57:08 +02:00
Anas Nashif
2fb19fcbdd style: samples/tests: add braces around if/while statements
Per guidelines, all statements should have braces around them. We do not
have a CI check for this, so a few went in unnoticed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-06 15:20:21 +02:00
Henrik Brix Andersen
fd3d4156d6 tests: flash_map: configure MPU to allow flash writes on twr_ke18f
Configure the NXP MPU to allow flash writes when running the flash_map
test.

This fixes #16224.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-05-31 09:50:36 -05:00
Maureen Helm
c8ae05dd80 tests: flash_map: Configure mpu to allow flash write
On boards that have the arm or nxp mpu, configure the mpu to allow flash
writes. Otherwise this test will fail with an mpu fault.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-05-30 17:13:13 -04:00
Krzysztof Chruscinski
3555c81111 tests: shell: shell_history: Add more tests
Extended test suite with more tests for shell_history module.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-05-30 09:44:03 -04:00
Krzysztof Chruscinski
c2cb60f613 shell: Refactor shell_history to use less RW memory
Shell history module reworked to use ring buffer for storing
commands. Dedicated buffer is used to story all command lineary.
History capacity is in bytes not in number of entries, e.g.
many short commands can be stored or few long (depending on
CONFIG_SHELL_HISTORY_BUFFER).

Removed implicit command null termination from shell_history and
added it to shell after fetching command line from the history.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-05-30 09:44:03 -04:00
Krzysztof Chruscinski
80f8481feb tests: subsys: shell: Add shell_history test
Add test suite for shell_history module.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-05-30 09:44:03 -04:00
Radoslaw Koppel
974231ee6e subsys/settings: Add const modifier to the value pointer
This commit adds const modifier for value pointer in
settings_save_one function.

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2019-05-29 10:11:12 -04:00
Krzysztof Chruscinski
93fb695244 tests: subsys: logging: Test for detection of missed log_strdup
Added test to validate algorithm for missed log_strdup() call.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-05-29 13:52:31 +02:00
Jan Van Winkel
afdbc20364 tests: Added native POSIX to flash based tests
Added native POSIX boards as target for flash related tests.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-05-28 21:14:19 -04:00
Andrei Emeltchenko
5970b66311 tests: usb: device: Refactor device api test
Refactor device api test using standard placement for descriptor table
and configuration data.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Andrei Emeltchenko
3880a42375 usb: Align legacy and composite interface
Remove duplicated execution path for composite configuration, USB
device stack initialization is done inside stack for both cases.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Aurelien Jarno
819e749ccd usb: move the request handler buffer to the USB device code
In order to unify the legacy and composite code, move the class and
vendor request handler buffer into the USB device code, just like in
composite mode. The option is renamed from USB_COMPOSITE_BUFFER_SIZE
into USB_REQUEST_BUFFER_SIZE and also replaces the USB_DFU_MAX_XFER_SIZE
and USB_HID_MAX_PAYLOAD_SIZE options.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Kamil Piszczek
cbc2ff6631 tests: fs: nvs: unittest with corrupted sector close op
Added a test case with corner case scenario, in which sector closing
operation is interrupted (e. g. due to power-down).

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-27 12:26:20 +02:00
Kamil Piszczek
302dc9878e tests: fs: nvs: moving nvs_clear to setup method
Flash clearing operation is now moved to the setup method inside the
NVS unit test.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-27 12:26:20 +02:00
Andrzej Puzdrowski
2d48f4337d tests/fs/nvs: GC full round test
Added a test for testing full round GC on 3-sectors
configuration. In this case all kind off sector can
appeared so this test covers well more numerous
sectors configurations.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-05-24 11:13:59 +02:00
Kamil Piszczek
b76edc1a1d tests: fs: nvs: garbage collector test
Added a simple test for the NVS Garbage Collector.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-22 10:22:53 +02:00
Kamil Piszczek
35a9299a76 tests: fs: nvs: test cases clean up flash on completion
Modified tests for the NVS to clean up the flash memory at the end of
their execution.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-22 10:22:53 +02:00
Yannis Damigos
bf74f5410f tests/subsys/usb/device: Fix comment and message
Fix comment and message.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2019-05-20 09:04:08 -04:00
Andrei Emeltchenko
6378e1e4a2 tests: usb: desc_sections: Fix coverity issue
Move increment out of zassert_*().

Fixes #15770

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-17 08:06:28 -07:00
Andrei Emeltchenko
875d5a2bf6 tests: usb: desc_sections: Fix coverity issue
Coverity thinks that zassert_*() is debug stuff so move out increment.

Fixes #16163

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-17 08:06:28 -07:00
Kamil Piszczek
e81090cff6 tests: fs: nvs: added basic unittests for nvs
Added basic tests for the NVS file system. One of the tests covers power
down during the flash write operation.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-13 17:07:28 +02:00
Andrei Emeltchenko
d05b260e9c tests: usb: desc_sections: Cleanup test
Strip loopback name from the structures. Fix bNumEndpoints.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 19:00:02 -04:00
Andrei Emeltchenko
4626a8cb51 tests: usb: desc_sections: Check EP assignment order
Check that endpoints are assigned in the right order.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 19:00:02 -04:00
Andrei Emeltchenko
c840383c6a tests: usb: desc_sections: Use automatic endpoint assignment
Use automatic assignment defined in usb_descriptor.h

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 19:00:02 -04:00
Andrei Emeltchenko
fbfe75c55e usb: tests: Add second IN endpoint to test
Demonstrate automatic endpoint assignment in tests for similar
endpoint types.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-28 12:22:23 -04:00
Andrei Emeltchenko
7c35a4e89a tests: usb: Add endpoint allocation verification test
Add verification that interface number and endpoint addresses are
correctly allocated.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-28 12:22:23 -04:00
François Delawarde
94451b22fc subsys/settings: Allow to register custom backends in settings subsystem
Major changes are:
- Expose settings backend API to enable custom backend support.
- Add a new CONFIG_SETTINGS_CUSTOM backend to allow registering a custom
backend.
- Change api of the handlers h_set() routines to allow for
backend-specific read callbacks.
- Provide a customizable settings_backend_init() routine for custom
backends.
- Move runtime settings support to be its own backend.

Signed-off-by: François Delawarde <fnde@oticon.com>
2019-04-26 11:24:31 +03:00
Kamil Piszczek
dae15fa736 tests: storage: flash_map: adding qemu platform
Added QEMU platform to the Flash Map test and defined partitions for
QEMU dts.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-04-24 13:05:11 -07:00
Anas Nashif
27c97911b7 flash_map: fix test names
API names have changed, but not the test name.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-19 13:41:02 -05:00
Andrei Emeltchenko
f350c275e1 tests: usb: Add write() and set_callback() tests
Add more tests for invalid EP testing.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
8cf9bf032b tests: usb: Add usb_read() for invalid endpoint
Check that reading invalid endpoint does not succeed.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
1178042cf4 tests: usb: Add more USB DC tests and refactor names
Add more tests covering almost all DC API with invalid parameters.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
1b1c5f72d9 tests: usb: Add write() and set_callback() tests
Add more tests for invalid EP testing.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
dad6ddef7f tests: usb: Cleanup tests
General test cleanup and remove optimized variables.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
d0bc6891d8 tests: usb: Add usb_read() for invalid endpoint
Check that reading invalid endpoint does not succeed.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
9fa5d9a5bf tests: usb: Fix checking error code
Instead of checking for -EINVAL check that return is not successful
since USB device may return other error code.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
69726bbccb usb: tests: Enable other boards for test
Enable other boards with USB device supported

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Johann Fischer
c13e201b18 usb: replace MAX_PACKET_SIZE0 with meaningful USB_MAX_CTRL_MPS
Replace MAX_PACKET_SIZE0 with meaningful USB_MAX_CTRL_MPS.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-04-11 13:35:24 -04:00
Andrzej Puzdrowski
bfb7e4531c tests/subsys/settings/fcb: fix unaligned test
Unaligned test might filed in case fcb area was not clen before
run.
The patch insert clean operation before this test.

fixes #15063

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-04-08 10:50:10 -04:00
Anas Nashif
3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Andrew Boie
7b1ee5cf13 tests: CONFIG_TEST_USERSPACE now off by default
Unlike CONFIG_HW_STACK_PROTECTION, which greatly helps
expose stack overflows in test code, activating
userspace without putting threads in user mode is of
very limited value.

Now CONFIG_TEST_USERSPACE is off by default. Any test
which puts threads in user mode will need to set
CONFIG_TEST_USERSPACE.

This should greatly increase sanitycheck build times
as there is non-trivial build time overhead to
enabling this feature. This also allows some tests
which failed the build on RAM-constrained platforms
to compile properly.

tests/drivers/build_all is a special case; it doesn't
put threads in user mode, but we want to ensure all
the syscall handlers compile properly.

Fixes: #15103 (and probably others)

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-04-06 14:30:42 -04:00
Andrei Emeltchenko
721f3d1cd0 usb: Refactor USB status callback
Merge cb_usb_status_composite and cb_usb_status and use common
forward_status_cb for both composite and normal devices.

Fixes #14882

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-05 12:23:57 +02:00
Cinly Ooi
9bfc1eb8a6 sample: nffs_fs_api: basic: Increase time for testing
Increase test timeout to 500s because it was noticed
that the default of 60s has truncated the test
suite run for nrf52840_pca10056

Signed-off-by: Cinly Ooi <cinly.ooi@intel.com>
2019-03-29 18:24:48 -04:00
Patrik Flykt
24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Michael Scott
83aa7cecd4 boards: arm: nrf52840-based: Free up flash room for sample apps
The current flash configurations for all nRF52840's in Zephyr is
VERY constrained when it comes to allowing samples any space for
storage or custom areas.  It only leaves the last 4 pages of flash
for "storage".

The nRF52840 is also capable of using OpenThread which defaults
to using the last 4 pages of flash for storing OpenThread-related
network data.

This means that while using OpenThread under any configuration
designed to use mcuboot partition slots, there is no space left
over for storage of any kind.

Let's adjust the partition table to set storage at 8 pages of
flash (32k).  This fixes the conflict with OpenThread and leaves
room for future use cases that may arise.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-03-15 08:52:06 -05:00
Andrzej Puzdrowski
7a00658b8e tests/subsys/fs/nffs_fs_api: build ram back-end only for qemu_x86
Ram back-end was unnecessary included in non qemu test which
increased RAM footprint much.

Patch includes ram backend into build only for qemu_x86 build.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-03-09 10:34:17 -05:00
Varun Sharma
145d8f06e0 tests: subsys: fs : Fix coverity issue
Fix Unchecked return value in func: nffs_test_util_create_file_blocks

Coverity-CID: 190955
Fixes: #13860

Signed-off-by: Varun Sharma <varun.sharma@intel.com>
2019-03-07 09:39:39 -05:00
Andrew Boie
90132d3543 tests: jwt: lower heap size
The heap, plus a few globals relevant to mbedtls get put in
their own memory partition.

With systems that have power-of-two region size/alignment
constraints, this results in a 64K partition being created,
even though we are using just a whisker above 32K.

Lower the heap size a little so everything fits in 32K.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-03-07 04:27:32 -06:00
Andrzej Puzdrowski
15159dddf1 settings: always uses the storage partition for FCB
It was possible via Kconfig to assign any partition for FCB using
its number. Partitions flash_area_id becomes non predefined
(are auto-generated). So it is possible only to guess which
number will be signed to certain area.

Unfortunately it is not possible to transfer FLASH_AREA_XXX_ID
label via Kconfig.

Patch assigns settings to the storage partition and remove
SETTINGS_FCB_FLASH_AREA property from settings Kconfig.

fixes #13388

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-03-04 16:51:19 +01:00
Daniel Leung
602a79cfeb tests: fs/nffs_fs_api: fix uninitialized reference time variable
The reftime variable used for performance numbers is not initialized
prior to being used. Initialize it to the current uptime so delta
can be calculated correctly.

Fixes #13877
Fixes CID-190936

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-03-02 12:27:30 +01:00
Daniel Leung
8b523e944b tests: fs/fat_fs_dual_drive: check fs_seek return values
Inside test_file_truncate(), the results of fs_seek() are not
checked. So adds some checks there.

Fixes #13874
Fixes CID-190939

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-03-02 12:26:37 +01:00
Flavio Ceolin
b92f104b66 tests: fs: Add missing return check
Checking the return of fs_stat to ensure that there is not hidden error.
Problem spotted by coverity.

CID 190949

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-01 09:50:15 +01:00
Jukka Rissanen
c478b5bb6e can: Rename can_msg and can_msg_filter structs
In order to follow the naming from Linux, change the name of
can_msg to zcan_frame, and can_msg_filter to zcan_filter.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-22 08:07:03 -05:00
Jukka Rissanen
14d4023338 tests: can: Add CAN frame struct handling tests
Make sure that can_copy_*() functions work as expected.
These functions are used by SocketCAN support.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-22 08:07:03 -05:00
Andrzej Puzdrowski
b1a7e71436 settings: fix base64 encode test
settings_line_len_calc() calculates only setting record
payload size, not record layout in flash size.

this patch remove inadequate test for this function.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-02-21 19:09:04 -05:00
Andrzej Puzdrowski
5bc3ad2a1c tests/subsys/settings: fcb unaligned value test
Added test for check whether value lenght is properly
stored for unaligned settings record size.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-02-21 19:09:04 -05:00
Carlos Stuart
75f77db432 include: misc: util.h: Rename min/max to MIN/MAX
There are issues using lowercase min and max macros when compiling a C++
application with a third-party toolchain such as GNU ARM Embedded when
using some STL headers i.e. <chrono>.

This is because there are actual C++ functions called min and max
defined in some of the STL headers and these macros interfere with them.
By changing the macros to UPPERCASE, which is consistent with almost all
other pre-processor macros this naming conflict is avoided.

All files that use these macros have been updated.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
2019-02-14 22:16:03 -05:00
Krzysztof Chruscinski
b44e06ea5b tests: subsys: logging: Enable log_core test on nios2
Nios2 platform was disabled due to compilation error. Meanwhile,
issue has been solved and tests can be re-enabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-12 07:51:50 -05:00
Andrei Emeltchenko
030f06ae7b tests: usb: Use UTIL_LISTIFY macros
macros allows to define variable number of instances.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-12 07:49:04 -05:00
Kumar Gala
2508818bc3 tests: fs: nffs_fs_api: Convert FLASH_AREA to DT_FLASH_AREA
Use DT_FLASH_AREA prefixed defined instead of FLASH_AREA as the non-DT
version is deprecated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-08 22:39:07 -06:00
Kumar Gala
1b2496866c tests: fs: multi-fs: Convert FLASH_AREA to DT_FLASH_AREA
Use DT_FLASH_AREA prefixed defined instead of FLASH_AREA as the non-DT
version is deprecated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-08 22:39:07 -06:00
David Brown
f8b838d404 jwt: Add JSON web token library
This patch adds a JSON web token library that adds the capability
to sign JSON tokens.  This was located in subsys due to the dependency
on MBEDTLS, which resides in /ext.

Signed-off-by: David Brown <david.brown@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2019-02-08 15:32:58 -06:00
Findlay Feng
2d2e1614b5 dfu/flash_img: use flash_map instead of flash API
Patch introduces flash_map subsystem to operate on flash
image instead of direct operation using flash_driver API.
Changes allows to support operation on the image in any flash
device.

flash_map was not available when this subsystem was introduced.

Signed-off-by: Findlay Feng <i@fengch.me>
2019-02-08 09:13:09 -06:00
Findlay Feng
04bf2e1bd1 dfu/mcuboot: use flash_map instead of flash API
Patch introduces flash_map subsystem to operate on flash
footprint instead of direct operation using flash_driver API.
Flash area ID is used in API instead of direct flash-bank-offsets.
Changes allows to support operation on the partition in any flash
device.

flash_map was not available when this subsystem was introduced.

Signed-off-by: Findlay Feng <i@fengch.me>
2019-02-08 09:13:09 -06:00
Andrei Emeltchenko
43d7c5bd2c tests: usb: Add more basic device API tests
Add more tests testing basic API and native_posix driver.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 07:56:24 -05:00
Andrei Emeltchenko
9832f1c1cb tests: device: Remove wpanusb mentions from the test
Remove wpanusb prefixes for the test to be more generic.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 07:56:24 -05:00
Andrei Emeltchenko
0c1f8eb28d teste: desc_sections: Add simple test
Add one more simple test.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 07:56:24 -05:00
Andrew Boie
41f6011c36 userspace: remove APPLICATION_MEMORY feature
This was never a long-term solution, more of a gross hack
to get test cases working until we could figure out a good
end-to-end solution for memory domains that generated
appropriate linker sections. Now that we have this with
the app shared memory feature, and have converted all tests
to remove it, delete this feature.

To date all userspace APIs have been tagged as 'experimental'
which sidesteps deprecation policies.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-02-08 07:04:30 -05:00
Kumar Gala
b89a808b26 tests: subsys: settings: Use DT_FLASH_AREA_<FOO>_ID define
Set Kconfig symbol SETTINGS_FCB_FLASH_AREA based on the
DT_FLASH_AREA_<FOO>_ID define instead of being hard coded.

We replace 3 with DT_FLASH_AREA_IMAGE_SCRATCH_ID and
we replace 4 with DT_FLASH_AREA_STORAGE_ID.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-07 10:31:27 -06:00
Kumar Gala
25eae07217 tests: subsys: fs: fcb: Use DT_FLASH_AREA_<FOO>_ID define
Rather than using hard coded 2, use DT_FLASH_AREA_IMAGE_1_ID
that is now generated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-07 10:31:27 -06:00
Andrzej Puzdrowski
ee5106e3d3 tests/subsys/storage/flash_map: use auto-generated fa ID
After addition of flash_map auto-generation it is needed to
use generated flas_area name instead of hard-code.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-07 10:31:27 -06:00
Andrei Emeltchenko
5b3bd4e099 tests: usb: Include desc_sections test for native_posix
After including native_posix USB controller we can perform some simple
tests on native_posix.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-06 17:53:04 -05:00
Anas Nashif
58632f8da7 doc: change board dts documentation with new URLs
flash-partitions page has moved...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-05 07:04:40 -05:00
Andrei Emeltchenko
bf9c6d72e8 usb: Add instance parameter to descriptors definitions
This allows to place instances of the class one after another in the
linker section.

Fixes #12908

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-01 19:11:32 -05:00
Andrei Emeltchenko
a49125ca90 tests: usb: Test USB data allocations in sections
USB relies on descriptors and configuration data allocations in
specific sections. This simple test verifies that at least size of the
data is correct.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-01 19:11:32 -05:00
Andrei Emeltchenko
b483804c75 usb: tests: Add basic unit test for USB drivers
Add basic tests testing simple endpoint enable and configuration.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-01 19:03:12 -05:00
Krzysztof Chruscinski
80a60412c9 tests: subsys: logging: Add log_output test suite
Add test to log_output module. Test suite covers usage of
log_output_string function.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-01-29 17:24:37 +01:00
Krzysztof Chruscinski
1d9e5ee108 logging: Refactoring 'in place' mode to reduce memory footprint
Changed 'in place' mode to bypass logger system and directly
call active backends. With this approach memory footprint of
the logger can be significantly reduced in terms of RAM and ROM.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-01-29 17:24:37 +01:00
Jan Van Winkel
26c9c7480e tests: mcuboot: Erase image slot before starting test
Erase image slot 0 in MCUBOOT test write confirm before starting
actual test.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-01-21 12:00:55 -05:00
Jan Van Winkel
bea1568217 tests: mcuboot: Do not read past image bounds
Make sure that the MCUBOOT test case bank erase does not read passed
image bounds.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-01-21 12:00:55 -05:00
Carles Cufi
962f900c0b test: nffs: Remove unsupported ICs from CMake files
The smaller Nordic ICs are not supported for those tests due to not
enough RAM.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-17 12:01:16 -06:00
Carles Cufi
9897904254 tests: nffs: Run NFFS tests on nRF52840
After the builds have been fixed, enable the tests on the 256KB-RAM
Nordic IC.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-17 12:01:16 -06:00
Carles Cufi
4f10f8ba2e tests: nffs: Tweak Kconfig to fit in RAM
NFFS tests do not fit in RAM on nRF5x, tweak the configurations so that
they do.

Fixes: #12065

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-17 12:01:16 -06:00
Anas Nashif
5060ca6a30 cmake: increase minimal required version to 3.13.1
Move to latest cmake version with many bug fixes and enhancements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-03 11:51:29 -05:00
Varun Sharma
3d9213ac57 tests: subsys: fs: multifs: Enable fs shell using new shell
Fixes #11356, resolved compilation issue wrt to NFFS_FLASH_DEV_NAME

Enabled new shell implementation for testing fs shell

Signed-off-by: Varun Sharma <varun.sharma@intel.com>
2018-12-14 13:14:17 +01:00
Krzysztof Chruscinski
0899a6c0b7 logging: severity-wise filtering of function name prefix presence
Extended logger configuration to allow function name prefix for
messages with certain severity levels. By default only debug
messages are prefixed with function name.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-13 14:21:25 +01:00
Andrzej Puzdrowski
55024fe5f0 tests: subsys: settings: tests value get len API
This Patch add tests for API in nffs and fcb back-ends.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-12-11 11:22:16 +01:00
Andrzej Puzdrowski
e5a09ccb3e settings: add API for check value size
Such API is convinient for check the persistent storage
value size or whether the value is NULL.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-12-11 11:22:16 +01:00
Andrzej Puzdrowski
03efd7d049 tests: subsys: settings: extend fcb back-end testing
Since it is possible to test back-end with base64 and without
test suite should be extended.

This patch introduce tests with and without base64 encoding

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-12-11 11:22:16 +01:00