Commit Graph

600 Commits

Author SHA1 Message Date
Andrei Emeltchenko 5469310628 tests: edac: Add statistic check
Add testing error counting after each error injection test.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-08-17 17:21:50 +02:00
Andrei Emeltchenko 5f8e026278 tests: edac: Add verification of defaults
Add verification of default parameters for error injection tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-08-17 17:21:50 +02:00
Flavio Ceolin b6bd40f5fa tests: pm: Add device wakeup test
Add a test to exercise PM device wakeup API.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-08-11 19:39:13 -04:00
Gerard Marull-Paretas 7ccc1a41bc pm: use actions for device PM control
Instead of passing target states, use actions for device PM control.
Actions represent better the meaning of the callback argument.
Furthermore, they are more future proof as they can be suitable for
other PM actions that have no direct mapping to a state. If we compare
with Linux, we could have a multi-stage suspend/resume. Such scenario
would not have a good mapping when using target states.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00
Gerard Marull-Paretas d41dadc569 pm: rename PM_DEVICE_STATE_SUSPEND to PM_DEVICE_STATE_SUSPENDED
The verb tense for the suspended state was not consistent with other
states. The likely reason: state was being used as a command/action.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00
Gerard Marull-Paretas 11eef4d8c8 pm: device: remove pointer usage for state
Since the state is no longer modified by the device PM callback, just
use the state value.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00
Gerard Marull-Paretas 9e7d545bb4 pm: device: remove ctrl_command callback argument
The ctrl_command is not used anymore, so remove it from the callback
signature.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00
Gerard Marull-Paretas da0ff4ae46 pm: device: remove usage of ctrl_command
The callback is now invoked to set the device PM state in all cases, so
the usage of ctrl_command is redundant.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00
Gerard Marull-Paretas c2cf1ad203 pm: device: remove usage of local states
The device PM subsystem already holds the device state, so there is no
need to keep duplicates inside the device. The pm_device_state_get has
been refactored to just return the device state. Note that this is still
not safe, but the same applied to the previous implementation. This
problem will be addressed later.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00
Johann Fischer 3240e0cc51 tests: remove USB configuration option
Remove USB configuration option, replace it where necessary
with USB_DEVICE_STACK.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:00:12 -04:00
Krzysztof Chruscinski 8c68a7a587 tests: subsys: logging: log_api: Fix test for 64 bit timestamp
Test for dropping log messages was expecting certain number of
dropped messages assuming that buffer size is dividable by the
message size. That was not the case when timestamp was 64 bit.
In that case, additional message is dropped.

Modified the test to take that into account.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-08-03 16:11:49 -05:00
Krzysztof Chruscinski 013c2da3e1 tests: subsys: logging: log_api: Minor improvemnt in mock
Use long long to print 64 bit timestamps in zassert macro.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-08-03 16:11:49 -05:00
Johann Fischer c0ea13ba85 tests: usb: use new USB framework header
Replace all macros with the new ones from usb/usb_ch9.h header.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 13:20:07 +02:00
Kumar Gala edb78537f9 tests: power_mgmt: Add nucleo_l476rg to integrations platforms
Add a real board/SoC that supports power mgmt on the STM32 side to
get some additional coverage and hopefully catch any build issues
in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-07-28 09:47:05 -05:00
Flavio Ceolin d45a0e1919 pm: Fix weak linkage symbols
Define SoC hooks as weak symbols so this way applications can
overwritten them defining strong symbols.

The problem is that currently SoCs are defining these interfaces as
strong symbol inhibiting the possibility of applications bring their
own implementation.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-07-26 04:31:54 -04:00
Henrik Brix Andersen 2486b45098 tests: pm: power_mgmt_soc: enable testing on twr_ke18f
Enable the SoC power management test suite on the NXP TWR-KE18F
development board.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-14 22:54:34 +03:00
Gerard Marull-Paretas 26ad8376bd pm: remove callback from control function
The callback is not used anymore, so just delete it from the pm_control
callback signature.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-13 09:36:45 -04:00
Gerard Marull-Paretas 217e610d8f pm: remove redundant callback usage
the device PM callback is not used anymore by the device PM subsystem,
so remove it from all drivers/tests using it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-13 09:36:45 -04:00
Gerard Marull-Paretas cc2f0e9c08 pm: use enum for device PM states
Move all PM_DEVICE_STATE_* definitions to an enum. The
PM_DEVICE_STATE_SET and PM_DEVICE_STATE_GET definitions have been kept
out of the enum since they do not represent any state. However, their
name has not been changed since they will be removed soon.

All drivers and tests have been adjusted accordingly.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-07 14:13:12 -04:00
Andrei Emeltchenko d5a8f1200e edac: Add dumy EDAC driver for API coverage
Add dummy EDAC driver for -ENOSYS test coverage.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-06-30 18:29:21 -04:00
Andrei Emeltchenko 32b17d3b0a edac: tests: Use new EDAC API in tests
Use new EDAC API in tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-06-30 18:29:21 -04:00
Andrzej Puzdrowski b13009141e tests/subsys/dfu: add testsuite for multi-image support
Added tests for exercise boot_request_upgrade_multi() API.
Added tests for exercise boot_write_img_confirmed_multi() API.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-06-17 12:41:17 +02:00
Kumar Gala 4e347d41ff tests/samples: Remove setting of CONFIG_DEBUG_OPTIMIZATIONS
CONFIG_DEBUG_OPTIMIZATIONS should not be enabled by default in
prj.conf for tests or samples.  Remove it from a few places that it
is.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-16 13:35:29 -05:00
Stephanos Ioannidis 615371900e tests: cpp: libcxx: Test with full and nano variants of newlib
In order to increase test coverage, this commit updates the libcxx test
to run with both full and nano variants of the newlib.

Note that C++ exception handling feature is only enabled for the newlib
full variant because the nano variant does not support C++ exception
handling.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-06-08 11:45:28 -05:00
Stephanos Ioannidis 518dd32efe tests: cpp: libcxx: Use full version of newlib for testing
Use the full version of newlib (i.e. not nano) for libcxx testing since
some features (e.g. C++ exception handling) require the full version of
newlib.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-06-08 11:45:28 -05:00
Anas Nashif 86209aced7 boards: qemu_x86_coverage: remove board testing coverage
This board was added to test coverage feature when coverage was
introduced. This is now being testing with other boards and
configurations on a regular basis, so no need for this extra overhead in
CI.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-06-01 14:06:56 -05:00
Stephanos Ioannidis cec683d209 tests: cpp: libcxx: Test C++ exception handling on all archs
The C++ exception handling feature is now supported on all
architectures.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-05-28 12:07:46 -05:00
Martin Åberg dda2e71097 tests: libcxx: added qemu_leon3 to C++ exception test
This exercises the SPARC support for C++ exceptions.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2021-05-28 06:32:36 -05:00
Stephanos Ioannidis 5a9d0d5e20 tests: cpp: libcxx: Update C++ exceptions testing filter
This commit updates the filter for cpp.libcxx.exceptions test to allow
testing on all architectures except the ones that are known to be
broken (see #32448).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-05-27 14:36:13 -05:00
Torsten Rasmussen 08dfe74c15 tests: libcxx: increase ZTEST_STACKSIZE and added platforms for testing
Increasing ZTEST_STACKSIZE to 4096.
This ensures that the riscv32 platforms can succesfully execute the
C++ exception test cases.

Also add the following platforms to allow list:
- qemu_arc_em
- qemu_arc_hs
- qemu_cortex_m0
- qemu_cortex_m3
- qemu_cortex_r5
- qemu_riscv32
- qemu_x86
- qemu_xtensa

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-05-27 07:43:28 -05:00
Flavio Ceolin d67a5786bc pm: device_runtime: Change API behavior s/_sync/_async
Most APIs have the default synchronous and an asynchronous version
with the sufix _async because that is the most common use.

All devices in tree right now are using the synchronous version, so
just change it to be consistent with the rest of the system.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-05-26 10:56:55 -04:00
Flavio Ceolin 4c16d391c7 tests: pm: Add device_runtime test
- Test two threads changing states concurrently
- Test multiple calls to get/put
- Test async / sync API

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-05-26 10:56:55 -04:00
Andrzej Puzdrowski da9e947f7a tests/subsys/setting/functional: ignore settings_delete() retval
Explicitly ignore return value of the settings_delete() call.

fixes #32921

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-05-20 19:44:35 +02:00
Flavio Ceolin 9524956b48 tests: pm: Remove unused Kconfig on power_mgmt_soc
Remove no longer needed Kconfig symbol.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-05-19 07:47:21 -05:00
Flavio Ceolin 8773c74079 tests: pm: Remove unused Kconfig on power_mgmt
This test was defining a symbol that is no longer needed.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-05-19 07:47:21 -05:00
Dominik Ermel ca0f31ee89 tests/logging/log_backend_fs: Fix test failed on dirty file system
One of subtests had been supposed to check if log files are numbered
properly and in continuous manner, but due to logic error it would
also count non-log files.

Fixes: #33629

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-05-18 16:59:36 -04:00
Dominik Ermel a4d017c684 tests/dfu/mcuboot: Remove unneeded overlay file for nrf52840dk
The board definition provides partition configuration that is enough
for this test and does not require overlay.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-05-18 11:24:18 -05:00
Hake Huang 437a5b6028 tests: flash: Enable flash driver and file system tests on mimxrt1060_evk
now the XIP feature can work in NXP RT series boards
so enable below cases on mimxrt1060_evk with XIP
tests/kernel/xip
tests/drivers/flash
tests/subsys/fs/littlefs
samples/shell/fs
samples/subsys/fs/littlefs

for tests/subsys/fs/littlefs:
need add --erase to erase the nor flash if you are using below partition
e.g. west flash --runner=pyocd --erase
&is25wp064 {
        partitions {
                compatible = "fixed-partitions";
                #address-cells = <1>;
                #size-cells = <1>;

                partition@310000 {
                        label = "large";
                        reg = <0x00310000 DT_SIZE_M(3)>;
                };
                partition@610000 {
                        label = "image-scratch";
                        reg = <0x00610000 DT_SIZE_K(128)>;
                };
                partition@630000 {
                        label = "small";
                        reg = <0x00630000 DT_SIZE_K(64)>;
                };
                partition@640000 {
                        label = "medium";
                        reg = <0x00640000 DT_SIZE_K(960)>;
                };
        };
};

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-05-18 11:19:15 -05:00
Krzysztof Chruscinski 236aaf994f tests: logging: log_api: Fix in mock backend
Mock backend is using 32 bytes for hexdump data and
only hexdumps with less data shall be compared against
expected one. Wrong operator was used and comparing
was performed only when hexdump size exceeded 32 bytes.
Spotted by Coverity CID 236015.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-12 23:36:01 -05:00
Krzysztof Chruscinski f7b7a672e9 tests: logging: log_api: Prevent negative array index write
Coverity CID 235911.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-12 23:36:01 -05:00
Krzysztof Chruscinski 92d1d1ab2f tests: logging: log_msg2: Prevent using negative array index
Move assert check before array access to ensure that
negative index is not used in an array. Coverity CID 222151.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-12 23:36:01 -05:00
Krzysztof Chruscinski d7140a5831 tests: logging: log_api: Remove accidental early return
There was an accidental early return in the test. Spotted by
coverity CID 235986, 236006.

Additionally, test had to be fixed because early returned covered
issues.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-12 23:36:01 -05:00
Krzysztof Chruscinski 2f3dbfde9b tests: logging: log_api: Use positive CONFIG_LOG_BUFFER_SIZE
When immediate mode is used CONFIG_LOG_BUFFER_SIZE is not defined
in kconfig. For proper compilation it is then defined in the test
file. Use positive value to please coverity which complains about
dead code when it is set to 0. Fixing CID 235961, 235965.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-12 23:36:01 -05:00
Kumar Gala 73e3cd5f44 tests: power_mgmt: exclude bl5340_dvk_cpunet
The nrf5340 cpunet based builds are excluded from this test and a new
platform bl5340_dvk_cpunet was added that needs to be excluded.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-05-08 09:59:20 -05:00
Jonathan Nilsen e1891b3e9a storage/stream: Move fill value handling to flash_sync
Move the code responsible for aligning the flash write by writing fill
values - from stream_flash_buffered_write to flash_sync. This avoids
having to correct buf_bytes/buf_written after the write and thus
simplifies error handling.

This commit also fixes an issue where the write length passed to the
callback in flash_sync includes the fill length.

Signed-off-by: Jonathan Nilsen <Jonathan.Nilsen@nordicsemi.no>
2021-05-08 07:10:31 +02:00
Anas Nashif 4d994af032 kernel: remove object tracing
Remove this intrusive tracing feature in favor of the new object tracing
using the main tracing feature in zephyr. See #33603 for the new tracing
coverage for all objects.

This will allow for support in more tools and less reliance on GDB for
tracing objects.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-07 22:10:21 -04:00
Flavio Ceolin 0c607adb63 pm: device: Align state names with system states
Change device pm states to the same pattern used by system power
management.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-05-07 18:35:12 -04:00
Flavio Ceolin 7eba310220 power: device: void *context -> uint32_t *state
The context parameter used across device power management is
actually the power state. Just use it and avoid a lot of
unnecessary casts.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-05-07 16:55:31 -04:00
Anas Nashif 5343aed002 tests: fix testcase.yaml files
Puts all filter in common section and fix filters. Platforms in
integration_platforms must also be allowed first, otherwise the tests
will never run.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-07 09:39:08 -05:00
Krzysztof Chruscinski 9280b90939 tests: logging: log_msg2: Fix test on qemu_cortex_a53
Test was failing because of uninitialized variable and wrong
pointer being used (pointer to char).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-07 09:39:08 -05:00