Commit graph

374 commits

Author SHA1 Message Date
Anas Nashif
1fbbfc819a tests/samples: add tags to some tests
Some tests/samples had no tags, fill those..

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-20 17:44:16 -04:00
Simon Glass
740b99c937 tests: shell: shell_flash: Add a test for 'flash read'
Add a simple test for this command to check that the output is as
expected.

This requires a larger output buffer in shell_dummy, so update that
too.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-07 17:19:26 -04:00
Tobias Svehagen
0171bd9578 tests: fs: nvs: Add two test cases for testing nvs_gc
Add tests for checking that nvs_gc can handle corrupt ate's.

Tests #26407

Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
2020-06-26 12:07:13 -05:00
Carles Cufi
22be0d8fd5 tests: nvs: Disable running the 0x00 test suite
There is an issue when running the 0x00 erase value test suite, so
disable it temporarily.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-06-25 13:24:07 -05:00
Anas Nashif
3791ec1491 tests: jwt: increase timeout for test
Some platforms need some more time here.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-25 11:05:29 -04:00
Håkon Øye Amundsen
a4957be25b storage/stream: allow NULL data pointer
This is done to support the idiomatic way of performing flush
operations, where the caller might not have access to the proper data
pointer. Also, there is no reason why reading from address 0 should
not be allowed.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2020-06-22 14:36:05 +02:00
Dominik Ermel
076282a117 subsys/fs/nvs: Use flash_get_parameters() to get erase value
Use new flash API call to obtain erase value instead of relaying on
hardcoded literals.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-06-22 14:35:03 +02:00
Marek Porwisz
3c0124a0a0 tests: openthread: Test passing net_pkt to OpenThread thread
Passing TX messages from sockets was reworked for openthread
thus tests need to be created/updated in order to pass.

Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
2020-06-18 19:37:06 +02:00
Roman Vaughan
0562d9fac6 tests: fs: Ensure file_path includes max file name length
A hardcoded path lenth of 80 will not be able to suppor the full length
of 255 when LFN is enabled. This does produce a compiler error,
thankfully, this is only applicable to the test cases.

Signed-off-by: Roman Vaughan <nzsmartie@gmail.com>
2020-06-17 17:07:45 +02:00
Roman Vaughan
70df7a87a1 tests: fs: Add test case for LFN with FATFS
Rerun the same test but with CONFIG_FS_FATFS_LFN=Y and
with a long filename.

Signed-off-by: Roman Vaughan <nzsmartie@gmail.com>
2020-06-17 17:07:45 +02:00
Maciej Perkowski
bd14a9d493 tests: littlefs: Increase timeout to 180s
The test takes ~175s to end on nrf5284dk_nrf52840 and was failing
due to too short default timeout (60s).

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2020-06-15 16:45:38 +02:00
Reto Schneider
0b4b3ae4dd cmake, samples, tests: Use semi-accurate project names
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming multiple projects
"NONE" defeats this functionality.

This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names, small, manual adjustments
have been done.

See also 7eabab2f5d ("samples, tests: Use semi-accurate project names")

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2020-06-09 08:18:29 -04:00
Kumar Gala
a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Marc Herbert
debade9121 tests: make find_package(Zephyr...) REQUIRED
... because it is (required).

This makes a difference when building with CMake and forgetting
ZEPHYR_BASE or not registering Zephyr in the CMake package registry.

In this particular case, REQUIRED turns this harmless looking log
statement:

-- Could NOT find Zephyr (missing: Zephyr_DIR)
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- ...
-- ...
-- ...
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:8 (target_sources):
  Cannot specify sources for target "app" which is not built by
  this project.

... into this louder, clearer, faster and (last but not least) final
error:

CMake Error at CMakeLists.txt:5 (find_package):
  Could not find a package configuration file provided by "Zephyr" with
  any of the following names:

    ZephyrConfig.cmake
    zephyr-config.cmake

  Add the installation prefix of "Zephyr" to CMAKE_PREFIX_PATH or set
  "Zephyr_DIR" to a directory containing one of the above files.  If
  "Zephyr" provides a separate development package or SDK, be sure it
  has been installed.

-- Configuring incomplete, errors occurred!

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Andrzej Puzdrowski
48af970339 tests/subsys/settings/functional/nvs: add nrf52xx configuration
Added configuration which allows to run test-suite
on nrf52840dk_nrf52840 and nrf52dk_rf52832 boards.

fixes #25701

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-05-28 17:11:12 +02:00
Andrzej Puzdrowski
74730d0c5f tests/subsys/storage/stream_flash: add unaligned flash test
Added test for check proper service of flush-write when buffer
contains unaligned amount of data.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-05-26 16:35:19 +02:00
Carles Cufi
855b6c1a5d tests: logging: Add a clean ouput test and clarify output
Add a new test with clean output and warn the user that the version
without clean output will output garbled text.

Fixes #23799

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-05-25 21:41:46 +02:00
Kumar Gala
ff579a3af3 flash: Convert DT_FLASH_AREA to FLASH_AREA macros
Convert with a combo of scripts and by hand fixups:

git grep -l DT_FLASH_AREA_.*_ID | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_ID/FLASH_AREA_ID(\L\1)/'

git grep -l DT_FLASH_AREA_.*_OFFSET | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_OFFSET/FLASH_AREA_OFFSET(\L\1)/'

git grep -l DT_FLASH_AREA_.*_SIZE | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_SIZE/FLASH_AREA_SIZE(\L\1)/'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-13 21:22:53 +02:00
Anas Nashif
ad82b38b8f tests: ztest: prefix tests with test_
Tests should always start with test_, otherwise detection of subtests
will not work through sanitycheck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-13 18:16:07 +02:00
Kumar Gala
6693c1d8a1 tests: stream_flash: Convert old DT syntax to new macros
Convert DT_SOC_NV_FLASH_0_SIZE to DT_REG_SIZE()

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-08 05:21:58 -05:00
Anas Nashif
29a06975e3 tests: stream_flash: skip tests correctly
User ztest_test_skip() to skip tests, not by conditionally including the
tests in the suite.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-07 14:24:02 -04:00
Stephanos Ioannidis
30e8aac754 tests: subsys: canbus: frame: Remove redundant logging configurations
This commit removes the redundant `LOG` and `LOG_IMMEDIATE` selections
in `prj.conf`, since the `TEST_LOGGING_DEFAULTS`, which is enabled by
default for all tests, selects `LOG` and `LOG_MINIMAL`.

This effectively allows the test to run with the default test logging
policy, set by the testing subsystem.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-07 14:47:35 +02:00
Håkon Øye Amundsen
a9676831cb storage: add stream flash library
This library supports stream writes to flash with
optinal progressive erase.

This module is a direct copy of the functionality found in
subsys/dfu/img_util/flash_img.c

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2020-05-06 11:14:00 +02:00
Alexander Wachter
464f135ce6 canbus: Convert canbus driver and subsys to new timeout API
Convert all canbus related API/samples/tests/subsys
to the new timeout API with k_timeout_t.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-05-06 10:19:13 +02:00
Kumar Gala
8101a0f661 flash: dts: replace DT_FLASH_{ERASE,WRITE}_BLOCK_SIZE with new macros
Replace:
	DT_FLASH_ERASE_BLOCK_SIZE ->
	DT_PROP(DT_CHOSEN(zephyr_flash), erase_block_size)

	DT_FLASH_WRITE_BLOCK_SIZE ->
	DT_PROP(DT_CHOSEN(zephyr_flash), write_block_size)

As this allows us to phase out the old generator.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 13:26:04 +02:00
Marek Porwisz
673b1da46d tests: subsys: openthread: OpenThread radio interface tests
Currently there are no test for openthread on zephyr.
Created tests for OpenThread platform radio interface.

Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
2020-05-04 12:00:02 +02:00
Anas Nashif
eaba71738e samples: move tracing sample from tests/
This is more a sample than a test, so put it under samples with the goal
of having dedicated tracing tests in the future under tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-29 22:30:19 -04:00
Kumar Gala
3f236f2183 can: dts: Convert can-primary alias to zephyr,can-primary chosen prop
Convert CAN to use a chosen node property that is similar to how we
handle zephyr,entroy or zephyr,flash-controller as the means to select a
specific peripheral instance utilized by a subsystem.

Replace references of the form:

alias {
	can-primary = &can1;
};

with:

chosen {
	zephyr,can-primary = &can1;
};

Replace various macro/define references with either
DT_CHOSEN(zephyr_can_primary) or replace DT_ALIAS_CAN_PRIMARY_LABEL
with DT_CHOSEN_ZEPHYR_CAN_PRIMARY_LABEL.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-29 14:27:31 -05:00
Kumar Gala
7a15afc1d4 drivers: flash: replace DT_FLASH_DEV_NAME with DT macro
Replace DT_FLASH_DEV_NAME with DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL.
We now set zephyr,flash-controller in the chosen node of the device
tree to the flash controller device.

NOTE: For a SoCs with on die flash, this points to the controller and
      not the 'soc-nv-flash' node.  Typically the controller is the
      parent of the 'soc-nv-flash' node).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-27 18:43:20 -05:00
Dominik Ermel
c8e3b1f68b tests/subsys/fs/fcb: Fix flash_area_write failure on NRF
The commit fixes problem with test attempting to perform 1 byte writes
to flash, which are not emulated by default.

GH issue: #24207

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-04-17 10:23:47 +02:00
Carles Cufi
6656214af2 boards: nrf52_pca10040: Rename to nrf52dk_nrf52832
The board name for the nRF52 DK, so far known as nrf52_pca10040, is
renamed to nrf52dk_nrf52832.  Its documentation and all references
to its name in the tree are updated accordingly. Overlay and
configuration files specific to this board are also renamed, to
match the new board name.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-04-06 13:09:07 +02:00
Andy Ross
32bb2395c2 timeout: Fix up API usage
Kernel timeouts have always been a 32 bit integer despite the
existence of generation macros, and existing code has been
inconsistent about using them.  Upcoming commits are going to make the
timeout arguments opaque, so fix things up to be rigorously correct.
Changes include:

+ Adding a K_TIMEOUT_EQ() macro for code that needs to compare timeout
  values for equality (e.g. with K_FOREVER or K_NO_WAIT).

+ Adding a k_msleep() synonym for k_sleep() which can continue to take
  integral arguments as k_sleep() moves away to timeout arguments.

+ Pervasively using the K_MSEC(), K_SECONDS(), et. al. macros to
  generate timeout arguments.

+ Removing the usage of K_NO_WAIT as the final argument to
  K_THREAD_DEFINE().  This is just a count of milliseconds and we need
  to use a zero.

This patch include no logic changes and should not affect generated
code at all.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-03-31 19:40:47 -04:00
Oleg Zhurakivskyy
b1e1f64d14 global: Replace BUILD_ASSERT_MSG() with BUILD_ASSERT()
Replace all occurences of BUILD_ASSERT_MSG() with BUILD_ASSERT()
as a result of merging BUILD_ASSERT() and BUILD_ASSERT_MSG().

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-03-31 07:18:06 +02:00
Torsten Rasmussen
407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Andrzej Głąbek
4253eae005 boards: nrf52840_pca10056: Rename board to nrf52840dk_nrf52840
The nRF52840 DK board target, so far known as nrf52840_pca10056,
is renamed to nrf52840dk_nrf52840.
Its documentation and all references to its name in the tree are
updated accordingly. Overlay and configuration files specific to
this board are also renamed, to match the new board name.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-03-27 09:14:08 +01:00
Ioannis Glaropoulos
f3807f19dc boards: arm: nrf51_pca10028: rename board to nrf51dk_nrf51422
We rename the nRF51 Dev Kit board target (nrf51_pca10028)
to nrf51dk_nrf51422. We update all associated references
in the supportive documentation and all nRF51-related
cofigurations and overlay files in the samples and tests
in the tree.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-24 11:45:27 +01:00
Carles Cufi
4b37a8f3a4 Revert "global: Replace BUILD_ASSERT_MSG() with BUILD_ASSERT()"
This reverts commit 8739517107.

Pull Request #23437 was merged by mistake with an invalid manifest.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-03-19 18:45:13 +01:00
Oleg Zhurakivskyy
8739517107 global: Replace BUILD_ASSERT_MSG() with BUILD_ASSERT()
Replace all occurences of BUILD_ASSERT_MSG() with BUILD_ASSERT()
as a result of merging BUILD_ASSERT() and BUILD_ASSERT_MSG().

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-03-19 15:47:53 +01:00
Wayne Ren
649c678e3b tests: openocd tracing does not support SMP
current openocd tracing does not support SMP

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2020-03-12 13:02:17 -04:00
Håkon Øye Amundsen
64d8e65f33 DFU: add init function with area id as parameter
This allows flash_img.c to be used outside of mcuboot scope.
Add new call to not break existing code.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2020-03-10 15:07:27 +02:00
Dominik Ermel
dd41b12250 tests/subsys/fs/fat: Incorrect mount path has been tested
While testing statvfs operation, same mount path has been tested twice,
instead of two different mount points as intended.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-02-27 11:37:25 +02:00
Maksim Masalski
c25262c829 tests: remove duplicate names for tests
After running command  --list-test-duplicates
I found out that some test cases have same names (duplicated).
To get rid of it, I decided to change names in .yaml files

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-02-13 14:45:56 -06:00
Alexander Wachter
1faaff1ea5 tests: canbus: isotp: Fix wrong variable used for assert
The assert for error checking used the wrong variable.
data_buf was checked instead of the ret variable.

Fixes #22656
Coverity-CID: 208192

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-10 12:32:01 +02:00
Anas Nashif
e8be579e43 tests: tracing: remove implied config options
Removed implied configuration options through CONFIG_TRACING.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-02-07 15:58:05 -05:00
Anas Nashif
b3226f8668 tests: tracing: cleanup configuration
Remove Kconfig options that are enabled by default or through
dependencies.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-02-07 15:58:05 -05:00
Anas Nashif
c0ad9f61b1 tests: tracing: move tracing under tests/subsys
Move under sybsys/ directly to align with subsystem reorg.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-02-07 15:58:05 -05:00
Anas Nashif
73008b427c tracing: move headers under include/tracing
Move tracing.h to include/tracing/ to align with subsystem reorg.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-02-07 15:58:05 -05:00
Brooks Prumo
e426c0c4e1 tests: Remove erroneous # before extern "C"
A few test header files have C++ guards around them, but are incorrect.
Those files had a leading `#` placed before `extern`, which is
incorrect.  This commit simply removes those leading `#` characters.

Signed-off-by: Brooks Prumo <brooks@prumo.org>
2020-02-06 19:45:21 -05:00
Alexander Wachter
3650f21bd8 tests: subsys: can: Add tests for iso tp
This commit adds testing for CAN ISO-TP

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2020-02-06 10:16:29 +02:00
Wentong Wu
9d1614477e tests: tracing: add test cases for tracing infrastructure
Add test cases for currently supported backends (UART, USB
and POSIX) of tracing infrastructure.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-02-05 23:54:26 -05:00