Commit Graph

751 Commits

Author SHA1 Message Date
Dominik Ermel a99118d140 tests/mgmt/mcumgr/smp_reassembly: Unit tests for re-assembly
The commit adds unit tests for SMP packet re-assembly.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-03-21 18:03:18 +01:00
Nicolas Pitre ce8dabfe9e riscv: implement arch_switch()
The move to arch_switch() is a prerequisite for SMP support.

Make it optimal without the need for an ECALL roundtrip on every
context switch. Performance numbers from tests/benchmarks/sched:

Before:
unpend  107 ready  102 switch  188 pend  218 tot  615 (avg  615)

After:
unpend  107 ready  102 switch  170 pend  217 tot  596 (avg  595)

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-03-21 07:28:05 -04:00
Nazar Kazakov f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Anas Nashif 97af0c8c33 tests: remove subsys prefix from test identifier
No need for subsys, the subsystem is expected to be the first component
of the identifier.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-03-18 10:50:57 -04:00
Gerard Marull-Paretas 1add69b5c3 tests: pm: policy_api: test latency change callback
Test that we get notified correctly when latency requirements change.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas 9f355c73bc tests: pm: policy_api: test latency API
Add a new tests that checks the behavior of the policy when latency
requirements are imposed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas 8714154338 tests: pm: policy_api: check status lock behavior
Test that policy manager behavior is correct when allowing/forbidding
certain states.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Gerard Marull-Paretas 22fe2142f0 pm: policy: use DEFAULT/CUSTOM naming
The residency policy, is in reality, influences by other parameters for
example constraints. It has been renamed to "DEFAULT" policy to make it
more general. The "APP" policy has been renamed to "CUSTOM" to better
represent its purpose.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Tomasz Bursztyka 521c9d13fb pm: constify all device instances
Run cocci script to constify device instances.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2022-03-16 12:33:12 +01:00
Tomasz Bursztyka c94b341a54 tests: constify all device instances
Run cocci script to constify device instances.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2022-03-16 12:33:12 +01:00
Krzysztof Chruscinski 3dc12753ff tests: logging: log_api: Extend with frontend feature
Extend test to check also frontend feature.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-14 14:08:49 -04:00
Krzysztof Chruscinski 92fb1af09a tests: logging: log_api: Fix test cases setup
Execute log_setup even when test is skipped. This is especially
vital when test infrastructure is using logging (e.g. LOG_PRINT
is enabled).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-14 14:08:49 -04:00
Krzysztof Chruscinski 89a3b4eee0 tests: logging: log_stack: Align stack usage numbers
Align stack usage for riscv64 smp case.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-14 10:53:40 -04:00
Krzysztof Chruscinski c917e6c2ce lib: os: cbprintf: Extend API to support new packaging modes
Added new flags to packaging API:
- CBPRINTF_PACKAGE_ADD_RO_STR_IDXS - when set, read-only string
  locations are appended to the package
- CBPRINTF_PACKAGE_ADD_RW_STR_IDXS - when set, read-write string
  locations are appended to the package (instead of appending actual
  strings)
- CBPRINTF_PACKAGE_FIRST_RO_STR_CNT(n) - indicate that n first strings
  are known to be read only. Ignored in runtime packaging.

Add function for copying packages with optional appending strings.

Changed CBPRINTF_MUST_RUNTIME_PACKAGE to use same flags as packaging.

Aligned logging and test to those changes.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-14 11:16:14 +01:00
Krzysztof Chruscinski 47ae656cc1 all: Deprecate UTIL_LISTIFY and replace with LISTIFY
UTIL_LISTIFY is deprecated. Replacing it with LISTIFY.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-08 11:03:30 +01:00
Gerard Marull-Paretas cd21d17b51 tests: subsys: fs: nvs: use nvs_mount
Replace deprecated nvs_init() with nvs_mount().

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-01 12:46:34 +01:00
Anas Nashif 145bcd7ab9 tests: log_stack: define for riscv smp
Define stacks for riscv smp configurations.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-02-26 10:08:46 -05:00
Krzysztof Chruscinski fcb32090ea tests: logging: log_stack: Adjust log stack limits for SPARC
Recent changes c0d7e10 increased stack usage for SPARC platform.
Adjusting values for immediate mode.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-24 08:51:26 -08:00
Henrik Brix Andersen 695722d787 tests: subsys: canbus: filter out tests if zephyr,canbus not enabled
- Filter out the CAN-BUS tests if no zephyr,canbus chosen node is
  enabled in the devicetree.
- Rename the tests to follow the general test naming scheme.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-02-24 07:12:54 -06:00
Flavio Ceolin 78454e5e93 pm: Rename pm_power_state_exit_post_ops
Aligning with the rest of PM API, replace pm_power_state_exit_post_ops
with pm_state_exit_post_ops.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-02-23 07:33:46 -05:00
Flavio Ceolin 89fee61b43 pm: Rename pm_power_state_set
Aligning with the rest of PM API, replace pm_power_state_set with
pm_state_set.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-02-23 07:33:46 -05:00
Krzysztof Chruscinski 3e551d658c tests: logging: log_stack: Fix Kconfig option
Renaming:
- CONFIG_TEST_EXTRA_STACKSIZE -> CONFIG_TEST_EXTRA_STACK_SIZE
- CONFIG_ZTEST_STACKSIZE -> CONFIG_ZTEST_STACK_SIZE

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-22 09:09:24 -05:00
Krzysztof Chruscinski a43d41483b tests: logging: Add test for stack usage characterization
Added test which estimates stack usage of few types of logging
messages in various modes, with and without optimization. Test
was used to determine usage for various architectures and is expected
to be used to detect stack usage increase since it fails when
stack usage in given configuration goes beyond the hardcoded limit.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-22 14:44:11 +01:00
Krzysztof Chruscinski 402c9b8895 tests: logging: log_api: Add test for argument evaluation
Added test which checks that log argument is evaluated only
once when log message is created.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-22 14:44:11 +01:00
Carles Cufi e83a13aabf kconfig: Rename the TEST_EXTRA stack size option to align with the rest
All stack sizes should end with STACK_SIZE.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-02-22 08:23:05 -05:00
Carles Cufi 4b8f1c04ab kconfig: Rename the ZTEST stack size option to align with the rest
All stack sizes should end with STACK_SIZE.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-02-22 08:23:05 -05:00
Anas Nashif b4d28a8186 Revert "tests: logging: Add stress test"
This reverts commit 12f9b4b31c.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-02-22 00:29:17 -05:00
Krzysztof Chruscinski 12f9b4b31c tests: logging: Add stress test
Add stress test for logging to validate that logging is coherent:
All message are processed by the logger or dropped and no message
is lost.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-21 22:19:00 -05:00
Carlo Caione c5894df5ec pm: Change parameters of pm_power_state_{set,exit_post_ops}
Just pass state and substate_id instead of the whole info structure
pointer.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-02-21 20:58:01 -05:00
Carlo Caione 11f1dd2370 pm: Reference pm_state_info only by pointer
It's unnecessary to move the pm_state_info around by value, just use a
pointer.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-02-21 20:58:01 -05:00
Sebastian Bøe 5e63f8fbce samples: rename user-tls.conf to user-tls-conf.h
user-tls.conf is a header file and should therefore have the suffix
.h.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2022-02-21 20:55:20 -05:00
Eduardo Montoya a0093eeda0 net: openthread: fix handling tx done to report all kind of errors
Fix bug in radio implementation that reported any transmit error
as `OT_ERROR_NO_ACK` to OpenThread.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2022-02-21 20:49:20 -05:00
Krzysztof Chruscinski df9b8721e2 logging: Prevent multiple arguments evaluation
Logging v2 is utilizing complex preprocessing operations to
prepare message at compile time. Multiple operations are peformed
on log message arguments. However, it is expected that argument
will be evaluated only once (e.g. it can be a call to a function
with side effects). Adding additional layer which creates copies
of user arguments on stack and passes them to further processing.

Updated test for log_msg2 which is using internal macro which
got renamed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-21 20:41:17 -05:00
Ederson de Souza 863ffbf1b7 tests and samples: Don't build some C++ tests under XCC
XCC (based on GCC 4.2) doesn't support C++11, and can't build those
tests. So exclude them from twister.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-02-21 19:37:54 -05:00
Johann Fischer ca6f24d36f tests: modbus: correct test fixture description
Correct test fixture description for FRDM-K64F board.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-02-15 18:56:36 +01:00
Yuval Peress d733153fe6 tests: settings: Update test project structures
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>
2022-02-11 09:47:57 -05:00
Yuval Peress 7f90587e7e test: settings: functional: fix missing test_main
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>
2022-02-11 09:47:57 -05:00
Yuval Peress 7b1a56f40f tests: settings: Remove invalid config
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>
2022-02-11 09:47:57 -05:00
Johann Fischer 906274e94e tests: modbus: add test fixture
Test fixture is required for the test on FRDM-K64F board.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-02-09 22:11:16 -05:00
Maureen Helm 27afc77a4b Revert "tests: logging: log_api: Add test for argument evaluation"
This reverts commit f647201bbd.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-02-08 17:02:48 -05:00
Maureen Helm f60f034c07 Revert "logging: Prevent multiple arguments evaluation"
This reverts commit 3f56567b08 which
caused build failures with the XCC toolchain on all samples and tests,
as well as a runtime failure with the nrf52_bsim board on
tests/bluetooth/bsim_bt/bsim_test_mesh.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-02-08 17:02:48 -05:00
Krzysztof Chruscinski 21867fd4d0 tests: logging: Update test after adding rodata detection on sparc
Updated tests to tread sparc as any other platforms that are
capable of detection if string is read only.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-08 09:41:37 -05:00
Krzysztof Chruscinski f647201bbd tests: logging: log_api: Add test for argument evaluation
Added test which checks that log argument is evaluated only
once when log message is created.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-08 07:32:43 -05:00
Krzysztof Chruscinski 3f56567b08 logging: Prevent multiple arguments evaluation
Logging v2 is utilizing complex preprocessing operations to
prepare message at compile time. Multiple operations are peformed
on log message arguments. However, it is expected that argument
will be evaluated only once (e.g. it can be a call to a function
with side effects). Adding additional layer which creates copies
of user arguments on stack and passes them to further processing.

Updated test for log_msg2 which is using internal macro which
got renamed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-08 07:32:43 -05:00
Anas Nashif ca565118ea tests: settings: provide correct test prototypes
More issues with missing prototypes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-02-07 12:39:42 -05:00
Anas Nashif 6b3cde2289 tests: settings: provide correct test prototypes
Add prototypes for renamed test functions. Issue was introduced in
677ffc883a.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-02-07 10:48:18 -05:00
Piotr Golyzniak 677ffc883a tests: settings: fix wrong test case names
Change test case names to proper one, which start from "test_"
characters.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
2022-02-07 09:29:09 -05:00
Guillaume Lager 5387c25e81 shell: Add test for dictionary command
The test also check that dictionary set with matching
items can be declared

Signed-off-by: Guillaume Lager <g.lager@innoseis.com>
2022-02-04 11:14:21 +01:00
Krzysztof Chruscinski 4012e7ddc6 tests: logging: log_api: Execute message dropping test on 1 cpu
Ensure that test is executed on 1 CPU. When target has multiple
CPUs other core may process logging and we won't get expected number
of dropped messages.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-01 08:16:10 -05:00
Krzysztof Chruscinski 3e58625acd tests: logging: log_api: Reworking suite setup
Reworking test suite setup.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-02-01 08:16:10 -05:00