Commit graph

7830 commits

Author SHA1 Message Date
Carlo Caione 1608c8adba pm: Introduce CONFIG_PM_DEVICE_RUNTIME_EXCLUSIVE
Sometimes we want to entirely decouple the system PM from the device PM,
leaving the devices to manage its own power states using the runtime PM.

This is currently not possible because the suspend / resume code path is
triggering the device PM hooks even when the runtime PM is enabled.

Introduce a new PM_DEVICE_RUNTIME_EXCLUSIVE symbol to allow the platform
to skip the device PM triggers on suspend / resume.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-06-22 12:24:43 +02:00
Vinayak Kariappa Chettimada 1f2cbbf318 tests: Bluetooth: bsim: Add GATT Write test
Add BabbleSim test to verify central_gatt_write and
peripheral_gatt_write.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-06-22 12:22:29 +02:00
Yinfang Wang 540ab5eb4c tests: sched: preempt: Fix the skipped testing when enabling SMP
When SMP feature is enabled on board, this test suite will skip.
Enable the test suite by removing the filter.
Note that these testings only run SMP platform on single core
which are handled by setting MP_NUM_CPUS=1 in prj.conf.

Signed-off-by: Yinfang Wang <yinfang.wang@intel.com>
2022-06-22 12:22:01 +02:00
Morten Priess 44f8166c3b test: bluetooth: Fix hci_test_app iso_data_pool element size
Size of ISO RX data pool did not account for the EDTT timestamp.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2022-06-22 12:21:16 +02:00
Nirosharn Amarasinghe 64c9a521d4 tests: bluetooth: Reworked ISO-AL RX unit tests
Fixes incorrect use of the test framework and updates tests according
to the new test API.

Signed-off-by: Nirosharn Amarasinghe <niag@demant.com>
2022-06-22 12:21:16 +02:00
Dominik Ermel 40b8041dd5 tests/subsys/mgmt/mcumgr: Add unit tests for zcbor_bulk
The commit adds unit tests for zcbor_bulk utility function,
which has been provided to internally support zcbor in decoding
maps with command parameters.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-06-21 11:46:45 +02:00
Yinfang Wang 4278d69924 test: Enable the GPIO tests on EHL_CRB.
Enable testcases under tests/drivers/gpio/gpio_basic_api
To run in twister, "-X gpio_loopback" parameter is needed.

Signed-off-by: Yinfang Wang <yinfang.wang@intel.com>
2022-06-21 10:47:56 +02:00
Anders Storrø 11e238a1ff Tests: Bluetooth: Mesh: Mesh shell prj stack size
Increases the main stack size of the mesh shell test application.
This resolves issue where application is not able to pass initialization
step.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2022-06-20 10:28:15 +02:00
Francois Ramu 06d222d16d tests: arm: runtime nmi testcase is flushing DCACHE
On mcu with Data Cache, when it is enabled (CONFIG_DCACHE=y),
the DCACHE must be flushed after the NMI loop to trig all
the irq, else the last one is missing.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-06-20 10:27:27 +02:00
Stephanos Ioannidis 2e19e914bb tests: kernel: schedule_api: Migrate to K_THREAD_STACK_ARRAY_DECLARE
This commit updates all deprecated `K_THREAD_STACK_ARRAY_EXTERN` macro
usages to use the `K_THREAD_STACK_ARRAY_DECLARE` macro instead.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-20 10:25:52 +02:00
Stephanos Ioannidis 34704dba40 tests: benchmarks: sys_kernel: Migrate to K_THREAD_STACK_DECLARE
This commit updates all deprecated `K_THREAD_STACK_EXTERN` macro usages
to use the `K_THREAD_STACK_DECLARE` macro instead.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-20 10:25:52 +02:00
Stephanos Ioannidis e846a18cae tests: benchmarks: footprint: Migrate to K_THREAD_STACK_DECLARE
This commit updates all deprecated `K_THREAD_STACK_EXTERN` macro usages
to use the `K_THREAD_STACK_DECLARE` macro instead.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-20 10:25:52 +02:00
Stephanos Ioannidis d6de29cd97 tests: kernel: thread_apis: Migrate to K_THREAD_STACK_DECLARE
This commit updates all deprecated `K_THREAD_STACK_EXTERN` macro usages
to use the `K_THREAD_STACK_DECLARE` macro instead.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-20 10:25:52 +02:00
Stephanos Ioannidis 0b0d21efe7 tests: kernel: schedule_api: Migrate to K_THREAD_STACK_DECLARE
This commit updates all deprecated `K_THREAD_STACK_EXTERN` macro usages
to use the `K_THREAD_STACK_DECLARE` macro instead.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-20 10:25:52 +02:00
Stephanos Ioannidis ff0471a59b tests: kernel: msgq_api: Migrate to K_THREAD_STACK_DECLARE
This commit updates all deprecated `K_THREAD_STACK_EXTERN` macro usages
to use the `K_THREAD_STACK_DECLARE` macro instead.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-20 10:25:52 +02:00
Stephanos Ioannidis 19ba592f07 global: Correct extern K_THREAD_STACK_DEFINE usage
This commit corrects all `extern K_THREAD_STACK_DEFINE` macro usages
to use the `K_THREAD_STACK_DECLARE` macro instead.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-20 10:25:52 +02:00
Anas Nashif 64af112d30 tests: condition variables: move to new ztest API
Move test to new ztest API.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-06-18 08:10:32 -04:00
Rubin Gerritsen bdc19bf274 tests: bluetooth: bsim: Pretend that the controller supports CIS
The test relies on enabling connection iso features in the host. As the
controller does not yet support them, this configuration does not really
make sense. But because the test is not using this functionality, we
work around it by pretending the controller supports it.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-06-17 10:49:51 -05:00
Herman Berget 63c68dbbbb Bluetooth: Tester: Add support for EATT connection
A new command is added to connect EATT channels.

Affects L2CAP/TIM/BV-03-C, which tests requirements on ATT.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-06-17 10:48:05 -05:00
Stephanos Ioannidis 2904b0020e tests: kernel: stack_random: Disable -Wdangling-pointer warning
This commit selectively disables the dangling pointer warning
(`-Wdangling-pointer`) for the compilation of the `alternate_thread`
function because it deliberately makes use of a dangling pointer in
order to test stack randomisation.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-17 10:18:26 +02:00
Yuval Peress d813e9b39f ztest: Fix incorrect use of this as fixture
Update `this` to `fixture` to avoid C++ keyword error.

Fixes #46459

Signed-off-by: Yuval Peress <peress@google.com>
2022-06-16 16:13:18 -04:00
Flavio Ceolin 8df552fb06 tests: log_immediate: Increase tests timeout
Slightly increase timeout for these tests since it is often failing in
xtensa simulator.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-06-16 16:01:41 -04:00
Krzysztof Chruscinski c5f2cdef09 logging: Remove logging v1 from the logging
Remove v1 implementation from log_core and all references in the tree.
Remove modules used by v1: log_list and log_msg.
Remove Kconfig v1 specific options.
Remove Kconfig flags used for distinction between v1 and v2.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-16 10:51:15 -04:00
Carlo Caione b6a3d598f3 device_mmio: Introduce DEVICE_MMIO_NAMED_ROM_INIT_BY_NAME
Currently the device MMIO APIs is only able to map single DT-defined
regions and also the _NAMED variant is assuming that each DT-defined
device has only one single region to map.

This is a limitation and a problem when in the DT are defined devices
with multiple regions that need to be mapped.

This patch is trying to overcome this limitation by introducing the
DEVICE_MMIO_NAMED_ROM_INIT_BY_NAME macro that leveraged the 'reg-names'
DT property to map multiple regions defined by a single device.

So for example in the DT we can have a device like:

  driver@c4000000 {
    reg = <0xc4000000 0x1000>, <0xc4001000 0x1000>;
    reg-names = "region0", "region1";
  };

and then we can use DEVICE_MMIO_NAMED_ROM_INIT_BY_NAME doing:

  struct driver_config config = {
    DEVICE_MMIO_NAMED_ROM_INIT_BY_NAME(region0, DT_DRV_INST(0)),
    DEVICE_MMIO_NAMED_ROM_INIT_BY_NAME(region1, DT_DRV_INST(0)),
  };

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-06-16 11:26:10 +02:00
Nicolas Pitre f00573555b Z_POW2_CEIL: simplify implementation
Avoid potentially calling __builtin_clz() twice with non-constant
values. Also add a test for it.

Clang produces false positive vla warnings so disable them. GCC will
spot real vla's already.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-06-16 10:28:15 +02:00
Gerard Marull-Paretas 74ed64139c tests: remove redundant <zephyr/zephyr.h> includes
Files including <zephyr/kernel.h> do not have to include
<zephyr/zephyr.h>, a shim to <zephyr/kernel.h>.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-15 09:13:11 +02:00
Krzysztof Chruscinski abc690cbe7 tests: logging: log_syst: Remove reference to logging v1
Remove references to CONFIG_LOG1 and CONFIG_LOG2 macros.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski e37afb4772 tests: logging: Remove log_msg test suite
Removing the suite for log_msg v1 as part of logging v1 removal.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski c60d5ff565 tests: logging: Remove log_list test suite
Log_list module is used by the logging v1. Removing
the suite as part of logging v1 removal.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski 69d3337349 tests: logging: log_core_additional: Remove v1 support
Remove testing of v1 from the test suite.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski 076ad119ae tests: logging: Remove log_core test suite
Test suite was only for logging v1 which is now being removed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski 0d2f33cae8 tests: logging: log_benchmark: Remove v1 support
Remove support for logging v1 from the test.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Krzysztof Chruscinski 61532e93b4 tests: logging: log_api: Remove v1 support
Remove support for logging v1 from the test.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 09:12:04 +02:00
Marcin Niestroj 994f6c8630 tests: net: sockets: tls: increase ztest and sysworkq stack sizes
Increase threads stack sizes from 2k to 3k, so that it will pass without
stack overflow on qemu_x86 platform when SHA384 support will be reenabled.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-06-15 09:11:09 +02:00
Anas Nashif 411a91902f tests: remove intel_s1000_crb tests
Remove all tests specific to the intel_s1000_crb board.
The board is no longer supported.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-06-13 16:19:51 -04:00
Filip Kokosinski 06615c148d tests/kernel/usage/thread_runtime_stats: relax precision test for RISC-V
This commit relaxes the precision requirements for idle event statistic
test when RISC-V machine timer driver is used. This is needed for some
platforms (e.g. hifive1), for which the cycle count is too low to pass
the checks where a percent deviation of peak cycles count is allowed.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2022-06-13 13:21:16 -04:00
Keith Packard 08d4dc90a1 tests/heap_listener: Store 'malloc' value in global to avoid optimizer
When the compiler is allowed to know the semantics of malloc and free,
this test needs to be careful to not have both calls elided by not using
the result at all. Simply storing the malloc pointer in a global
variable is sufficient here.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-06-14 01:50:36 +09:00
Keith Packard 5d6b43f684 tests/timer_api: Use correct 'abs' macro with correct type parameter
Subtracting with a uint64_t operand yields a uint64_t result, for which
the absolute value is not terribly interesting. Cast the operand to
int64_t.

Use llabs instead of abs as abs takes an int parameter and not an
int64_t. This appears to work even with the minimal C library.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-06-14 01:50:36 +09:00
Daniel Leung a9972f3d99 tests: mem_protect/mem_map: enable userspace on qemu_x86_tiny
Due to qemu_x86_tiny having very small defined SRAM area,
enabling userspace results in not having enough free physical
pages to run the tests. So make the memory a bit larger so
we can actually test memory mapping with userspace.

Fixes #46398

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-06-13 12:12:42 +02:00
Piotr Pryga f4faf948fc tests: Bluetooth: df: remove unnecessary testcase.yaml
The testcase.yaml file in tests/bluetooth/df directory makes
twister trying to build tests that are not available.
All tests in the df subdirectory have private testcase.yaml
files.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-06-13 12:12:27 +02:00
Piotr Pryga fded540143 tests: Bluetooth: df: Missing conf for max num of CTE in per adv chain
Implementation of ll_df_set_cl_cte_tx_params was updated to verify
if the number of requested CTE in a periodic advertising chain is less
or equal to maximum supported value that is provided by CONFIG_BT_CTLR-
_DF_PER_ADV_CTE_NUM_MAX Kconfig option. In the past the value was
verified against maximum value allowed by BT Core Spec Vol 4, Part E,
section 7.8.80. Check against BT Core spec provided value could lead to
memory overwrite.

The unit tests start to fail because default value of the CONFIG_BT_-
CTLR_DF_PER_ADV_CTE_NUM_MAX is 1, hence is shall be changed in unit test
configuration file.

The commit adds missing configuration.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-06-13 12:12:27 +02:00
Piotr Pryga f731a12e9b tests: Bluetooth: df: Wrong feature set for features_used
Wrong feature was enabled for a connection object as one the currently
used features. The enabled feature was CTE response. In case if the
feature exchange has not happened, it is verified if CTE request feature
is enabled, not the CTE response feature. The problem is in a common
code that prepares connection object for unit tests.

The commit fixes enabled features preparation for a connection object.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-06-13 12:12:27 +02:00
Chay Guo a4c9e13ea8 boards: arm: Enable flash for storage on mimxrt595_evk
- The MX25UM51345G flash is connected to FLEXSPI PortA for
  mimxrt595_evk.
- Updated flexspi_mx25um51345g driver to support DTR OPI mode.
- Tested with tests/drivers/flash.

Signed-off-by: Chay Guo <changyi.guo@nxp.com>
2022-06-13 12:10:57 +02:00
Chay Guo c846537820 boards: arm: Add wdog support on mimxrt595_evk
Add watchdog support to the mimxrt595 platform.
The mimxrt595 platform is excluded from the watchdog
test case because the test case uses variables in the
noinit section that need to be retained through a reset
but the rt595 does not retain this memory through a
reset.

Signed-off-by: Chay Guo <changyi.guo@nxp.com>
2022-06-13 12:10:57 +02:00
Chay Guo 77a0bc2135 boards: mimxrt595: Add SPI support
Enable access to the HS_SPI pins(JP26) on the mimxrt595_evk board.
Using DMA mode, tested with spi_loopback testcase.

Signed-off-by: Chay Guo <changyi.guo@nxp.com>
2022-06-13 12:10:57 +02:00
Hu Zhenyu 001cae0a5a test: Increase the tolerance between A3/A5
As the type of A(n) is integer, and A3 and A5 are close to
each other. Sometimes A3 is equal to A5. So change the ">" to
">="

Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
2022-06-10 07:08:49 -04:00
Carlo Caione 63fa264c22 tests: mem_protect/mem_map: qemu_x86_tiny: Exclude userspace testing
There are no enough free pages to run the test with userspace enabled on
qemu_x86_tiny. Disable it.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-06-10 09:48:23 +02:00
Carlo Caione f094542d64 tests: mem_protect/mem_map: Test also K_MEM_PERM_USER
The tests is currently testing all the memory mapping parameters but
K_MEM_PERM_USER. Add a test case to test that as well.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-06-10 09:48:23 +02:00
Krzysztof Chruscinski 0e1d86c6bb tests: logging: log_stack: Adjust thresholds
Adjust tresholds for multiple platforms.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-09 14:32:39 +02:00
Markus Rekdal 071a017b18 net: lwm2m: Add SenML CBOR content writer tests
This will add unit tests for the SenML CBOR content encoder/decoder

Signed-off-by: Markus Rekdal <markus.rekdal@nordicsemi.no>
2022-06-09 11:32:01 +02:00