Commit graph

5561 commits

Author SHA1 Message Date
Ioannis Glaropoulos ab1600de00 tests: arch: arm: move arm_psci to arm64 directory
arm_psci test suite is specific to ARM64, while
all other test suites in tests/arch/arm directory
are supported in Cortex-M architecture only. We
move arm_psci to arm64 directory, effectively,
separating tests suites for AARCH32 and AARCH64.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-02-19 05:27:31 -06:00
Jukka Rissanen 7699563d81 net: mgmt: Use proper coop thread priority value
If user sets CONFIG_NUM_PREEMPT_PRIORITIES=0, then the priority
of the net_mgmt thread will be -1 which is the same as idle thread.
This will trigger assert in kernel as then the minimum coop priority
is -2 in this case. Remove the net_mgmt thread priority setting from
Kconfig file as it is low value and set the coop thread priority
the same way as other network threads are doing it.

Fixes #32375

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-02-17 16:42:15 +02:00
Gerard Marull-Paretas 42cf4c76ab tests: drivers: enable MAX6675 build
Enable MAX6675 sensor for the build_all test.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-02-17 14:33:29 +01:00
Hubert Miś 2f02ca0b39 tests: net: socket: SO_PROTOCOL socket option
This patch adds tests to verify getting SO_PROTOCOL socket option for
TCP, UDP, and TLS sockets.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2021-02-17 10:36:58 +02:00
Hubert Miś a6e83eb769 tests: net: socket: SO_TYPE socket option
This patch adds tests to verify getting SO_TYPE socket option for
TCP, UDP, and TLS sockets.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2021-02-17 10:36:58 +02:00
Daniel Leung 2011030600 tests: x86/info: enable testing for userspace
This adds some test cases to test with userspace enabled
to make sure will not be broken.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-16 19:08:55 -05:00
Daniel Leung bd5da12297 tests: x86/info: enable for qemu_x86
This now can run on qemu_x86.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-16 19:08:55 -05:00
Kumar Gala fc9b8100c7 devicetree: clocks: provide accessors for controller phandle
Provide a helper to extract the devicetree node_id for a CLOCKS
controller from a clocks phandle array.  This can be used with
DEVICE_DT_GET() to directly reference the corresponding controller
device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Co-authored-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2021-02-16 14:15:40 -06:00
Andy Ross c2339db996 tests/timer_api: Correct precision and fix correctness mistakes
Correct a bunch of precision/analysis errors in this test:

* Test items weren't consistent about tick alignment and resetting of
  the timestamp, so put these steps into init_timer_data() and call
  that immediately before k_timer_start().

* Many items would calculate the initial timestamp AFTER
  k_timer_start(), leading to an extra (third!) point where the timer
  computation could alias by an extra tick.  Always do this
  consistently before the timer is started (via init_timer-data()).

* Tickless systems with high tick rates can easily advance the system
  uptime while the timer ISR is running, so the system can't expect
  perfect accuracy even there (this test was originally written for
  ticked systmes where the ISR was by definition happening "at the
  same time").

  (Unfortunately our most popular high tick rate tickless system,
  nRF5, also has a clock that doesn't divide milliseconds exactly, so
  it had a special path through all these precision comparisons and
  avoided the bugs.  We finally found it on a x86 HPET system with 10
  kHz ticks.)

* The interval validation was placing a minimum bound on the interval
  time but not a maximum (this mistake was what had hidden the failure
  to reset the timestamp mentioned above).

Longer term, the millisecond precision math in these tests is at this
point an out of control complexity explosion.  We should look at
reworking the core OS tests of k_timer to use tick precision (which is
by definition exact) pervasively and leave the millisecond stuff to a
separate layer testing the alternative/legacy APIs.

Fixes #31964 (probably -- that was reported against up_squared, on
which I had trouble reproducing, but it was a common failure on
ehl_crb).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-02-16 12:08:36 -05:00
Wolfgang Puffitsch 42b083915d tests: Bluetooth: Add minimal compilation coverage for openisa
Add minimial compilation coverage for openisa Bluetooth controller to
avoid further rot.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-02-16 12:02:00 -05:00
Daniel Leung ce44048d46 x86: rename CONFIG_SSE* to CONFIG_X86_SSE*
This adds X86 keyword to the kconfigs to indicate these are
for x86. The old options are still there marked as
deprecated.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-15 08:21:15 -05:00
Daniel Leung 29cf9d879d tests: benchmarks/app_kernel: enable for floating point
The app_kernel benchmarking app has the config file for benchmarking
with floating point enabled, but it was never used. So add it
to the testcase.yaml.

Note that this also limits to run on one CPU on a SMP system as
the resulting numbers would be more consistent among runs.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-15 08:21:15 -05:00
Daniel Leung 735c0096ae tests: fpu_sharing: test both FPU and SSE on x86
On x86, it is possible to use FPU (387) and SSE for floating
point operations. So test both.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-15 08:21:15 -05:00
Eugeniy Paltsev 18081e7f11 tests: tinycrypt: disable for ARC QEMU platforms
Even though ARC QEMU has received advanced multiplication
instructions support recently the ARC QEMU in the latest
Zephyr SDK still misses them, so tinycrypt may execute
too long and reach timeout in case of execution on
slow host.

Disable tinycrypt for ARC QEMU platforms till we update
ARC QEMU in Zephyr SDK.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2021-02-15 08:11:19 -05:00
Vinayak Kariappa Chettimada 1e9abde45e tests: Bluetooth: bsim: Fix ISO test to establish periodic sync
Fix the ISO test application to be able to establish
periodic sync.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-15 08:03:22 -05:00
Piotr Pryga d06b8053b3 tests: Bluetooth: df: add UT for enable CTE for periodic advertising
Adds unit tests for verification of enable/disable CTE for periodic
advertiging in controller.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-02-15 08:00:58 -05:00
Piotr Pryga e42334982f tests: Bluetooth: df: Move common code to separate source file
Move common code that may be used by different test units
from main.c to common.c. Main.c should be clean and responsible
for unit tests executioon only. Common functionalities should be
stored in separate file and provided to test source files by
appropriate header file.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-02-15 08:00:58 -05:00
Piotr Pryga 515f95382e Bluetooth: controller: radio: Add DF configuration to enable CTE TX
Add set of functions that will make possible to configure
radio Direction Finding Extension to transmit CTE for periodic
advertising.

Some of the new Radio API functions are provided as separate
functions changing the same Radio peripheral registers, e.g.
radio_df_mode_set_aoa, radio_df_mode_set_aod. This is done on
purpose and is related with lack of DFE in nrf52_bsim.
To avoid use of conditionally compiled constants to represent
e.g. CTE mode; separate functions were introduced.
Thanks to that DF unit tests are able to compile successfully
without changes in nrf52_bsim platform. Also if DFE is added
to nrf52_bsim there is no need to change the code until it is
desired.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-02-15 08:00:58 -05:00
Ioannis Glaropoulos 2573f4b99c tests: remove nrf5340 PDK boards from test .yml files
Remove references to the nRF5340 PDK boards
from samples and tests .yml files.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-02-15 07:59:43 -05:00
Hubert Miś 2e2915a596 tests: net: coap: Acknowledgement initialization
New test that verifies CoAP Acknowledgement initialization function
that create a response packet for given request. Both request and
expected response packets are given in the test as PDU.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2021-02-15 10:17:11 +02:00
Vinayak Kariappa Chettimada 483e789697 tests: Bluetooth: bsim: Enable LL/CON/INI/BV-24-C EDTT test
Enable the LL/CON/INI/BV-24-C [Network Privacy - Connection
Establishment using resolving list, initiator, Ignore
Identity Address, with address resolution disabled] EDTT
test.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-02-14 18:17:05 -05:00
Alexandre Bourdiol a276603c2d test: arch: arm: arm_interrupt: clear FPSCR register in ISR
Clear Floating Point Status and Control Register (FPSCR),
to prevent from having the interrupt line set to pending again,
in case FPU IRQ is selected by the test as "Available IRQ line"

Fixes #31982

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-02-14 16:37:49 -05:00
Andy Ross 015b4f7303 tests/kernel: Coherence: no shared data on stacks
A fairly common idiom in our test code is to put test-local data
structures onto the stack, even when they are to be used from another
thread.  But stacks are incoherent memory on some platforms, which
means that such things may not get a consistent view of memory between
threads.

Just make these things static.  A few of these spots were causing test
failures on intel_adsp_cavs15.  More were found by inspection while
hunting for mistakes.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-02-11 14:47:40 -05:00
Andy Ross 95bcba5946 tests/kernel/thread_stack: Fix KERNEL_COHERENCE interactions
Thread stack memory on coherence platforms needs to be linked into a
special section (so it can be cached).

Also, the test_idle_stack case just can't work with coherence.  It's
measuring the CPU's idle stack's unused data, which was initialized at
boot from CPU0, and not necessarily the CPU on which the test is
running.  In practice on intel_adsp_cavs15, our CPU has stale zeroes
in the cache for its unused stack area (presumably from a firmware
memory clear at boot or something?).  Making this work would require a
cache invalidate on all CPUs at boot time before the idle threads
start, we can't do it here in the test because we don't know where the
idle stack pointer is.

Too much work for an esoteric stack size test, basically.  Just
disable on these platforms.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-02-11 14:47:40 -05:00
Luiz Augusto von Dentz 8df6124deb Bluetooth: ATT: Remove BT_ATT_TX_MAX
ATT channels do support queueing buffer so it no longer need to block
waiting the tx_sem besides the buffer allocation already serves the
same purpose as the application will not be able to have more requests
than there are buffers available.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2021-02-11 12:59:01 -05:00
Alexander Wachter 9f858ac1b6 tests: drivers: can: timing: Fix potential div by zero
If the prescaler is zero in the test, a div by zero would happen.
Add an assert to check for zero prescaler.
Fix CID 216790

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2021-02-11 08:54:12 -05:00
Kumar Gala 651898e13d drivers: sensor: icm42605: Fix build issues
There are several different issues when trying to build the icm42605
sensor driver:

* Missing entry in drivers/sensor/CMakeLists.txt
* Issues with #ifndef in header files
* Issues with const usage
* Missing function prototypes in headers
* Fix use of LOG_MODULE_REGISTER v LOG_MODULE_DECLARE
* Add missing dts node to tests/drivers/build_all/spi.dtsi

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-10 18:21:20 -05:00
Adam Jeliński 9919c14175 m2gl025_miv: Double the test timeouts
The `m2gl025_miv` board needs more time to complete these tests with
Renode.

Signed-off-by: Adam Jeliński <ajelinski@antmicro.com>
2021-02-09 19:41:27 -05:00
Peter Bigot 2a9b9b74bc tests: i2c_slave_api: update to current standard terminology
Zephyr does not currently allow deviation from standard terminology
for a technology even if it is non-inclusive, until the corresponding
standards body has confirmed intent to change that terminology.  The
terms used in a previous attempt to be inclusive do not match the
expected forthcoming standard terms.

Revert to standard terms until the new ones have been announced and
the switch made throughout Zephyr.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-02-09 13:59:17 -05:00
Daniel Leung 89a9096334 tests: threads/tls: add more thread variables
It was discovered that TLS data/bss in stack need to be
aligned correctly or else incorrect variables would be
accessed. This makes tdata and tbss sections to have
odd sizes to make sure everything still works.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-07 23:28:43 -05:00
Emil Gydesen ecf918cadd Bluetooth: tests: Add missing dependency for CONFIG_BT_AUDIO_UNICAST
Two .conf files had enabled the CONFIG_BT_AUDIO_UNICAST config, but
without the CONFIG_BT_AUDIO which is a dependecy.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-02-06 16:20:34 -05:00
Enjia Mai 8474d785f4 tests: memory protect: add some error test cases
Add some error case for initializing memory domain and removing
memory partition.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2021-02-05 08:29:44 -05:00
Andrzej Puzdrowski 6fb7ac233c fs: Fix fs_opendir resource leak when invoked on fs_dir_t object in use
Fixes problem when fs_opendir invoked on fs_dir_t object,
which is already holding information on opened directory,
overwrites references to other memory objects within
the fs_dir_t object causing resource leak.
If fs_opendir is invoked on already used fs_dir_t object,
it will return
-EBUSY.

Note: The change requires that all fs_dir_t objects should be
initialized to 0.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-02-05 07:32:20 -05:00
Andrzej Puzdrowski 9fcf72f8b7 tests/subsys/fs/fs_api: remove dir-multi-open test
That whether a FS implementation allow to open
same directory multiple time is FS implementation
dependent. It shouldn't be tested. Such test was removed.

However need to test whether API transfers failures from
underlying FS properly.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-02-05 07:32:20 -05:00
Andrzej Puzdrowski 0f0cccd45b tests/subsys/fs/fs_api: Add fs_dir_t type variable init.
The commit adds initializations of fs_dir_t variables in preparation
for fs_opendir function change that will require fs_dir_t object, passed
to the function, to be initialized before first usage.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-02-05 07:32:20 -05:00
Andrzej Puzdrowski 100ee2efed tests/subsys/fs/littlefs: Add fs_dir_t type variable initializations
The commit adds initializations of fs_dir_t variables in preparation
for fs_opendir function change that will require fs_dir_t object, passed
to the function, to be initialized before first usage.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-02-05 07:32:20 -05:00
Andrzej Puzdrowski cf9039d679 tests/subsys/fs/fat_fs_dual_drive: Add fs_dir_t type variable init.
The commit adds initializations of fs_dir_t variables in preparation
for fs_opendir function change that will require fs_dir_t object, passed
to the function, to be initialized before first usage.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-02-05 07:32:20 -05:00
Andrzej Puzdrowski 550c2ceef6 tests/subsys/fs/fat_fs_api: Add fs_dir_t type variable initializations
The commit adds initializations of fs_dir_t variables in preparation
for fs_opendir function change that will require fs_dir_t object, passed
to the function, to be initialized before first usage.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-02-05 07:32:20 -05:00
Andrzej Puzdrowski dd7b167040 tests: fs: multifs: Add fs_dir_t type variable initializations
The commit adds initializations of fs_dir_t variables in preparation
for fs_opendir function change that will require fs_dir_t object, passed
to the function, to be initialized before first usage.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-02-05 07:32:20 -05:00
Andrzej Puzdrowski 109f1ab42b fs: Add fs_dir_t_init() function
The fs_dir_t_init() function has been added that should be used
for initialization of fs_dir_t structures before passing them
to fs_open and other functions.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-02-05 07:32:20 -05:00
Enjia Mai bd1d0b22b5 tests: ztest: fix error_hook test case fail in some board
Enlarge the test thread stack size, to fix test case fail
in some board which need more stack size for testing, when
CONFIG_EXCEPTION_DEBUG is enabled.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2021-02-04 13:09:55 -05:00
Erwan Gouriou b389d1940e tests/drivers/dma: Enable tests on nucleo_f746zg and disco_l475_iot1
This will enable dma device testing on these platforms in ST CI.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-02-04 12:35:04 -05:00
Andrei Emeltchenko 89a253b052 edac: Use Device Tree values for BDF and PCI VID
Start using DTS values for PCI Vendor ID and PCI BDF. For the PCI
Device ID we do not use DTS since this would require changing overlay
for different SKU board.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-02-04 09:37:42 -05:00
Erwan Gouriou d74dae2eaf tests/drivers/dma: loop_transfer: Use ztest harness
loop_transfer test was not using ztest framework as test harness.
Fix it.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-02-04 07:41:55 -05:00
Andy Ross 4d4a636555 tests/kernel/common: Skip the printk test when not applicable
When CONFIG_LOG_PRINTK is set, the printk hook mechanism doesn't exist
and this test can't pass.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-02-03 20:56:14 -05:00
Enjia Mai 3035d75fe2 tests: ztest: Fix issues due to test case of accessing NULL address
Fix issue #31339 and #31419, test case fail due to access NULL did not
trigger a fatal error in some platform such as nsim_em and iotdk.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2021-02-03 13:27:23 -05:00
Andy Ross 782c121dd3 tests/sched/deadline: Fix precision rollover
The deadline scheduler as of commit ef626571b2 ("kernel/sched:
Optimize deadline comparison") got an optimization that requires that
the the cycle difference of the deadline time of the "first" and
"last" runnable thread never be higher than 2^31.

The test code here was masking off the bottom 31 bits of the generated
deadlines, so it looked OK.  But because the actual setting of the
deadline values takes time too, it was still possible to select values
that would roll over.  The window was VERY small, but the RNG on one
platform (up_squared) hit it.

Shrink the selected deadlines to live in a 30 bit space for safety.

Fixes #31508

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-02-03 13:10:33 -05:00
Daniel Leung 890e9846c8 Revert "tests: context: disable if DEMAND_PAGING"
This reverts commit 79d73063af.
The issue #31333 is fixed so this can be reverted to
enable tests/kernel/context to run with demand paging enabled.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-02 21:57:43 -05:00
Nicolas Pitre c822e0abbd libc/minimal: fix realloc() allocated memory alignment
The definition for realloc() says that it should return a pointer
to the allocated memory which is suitably aligned for any built-in
type.

Turn sys_heap_realloc() into a sys_heap_aligned_realloc() and use it
with __alignof__(z_max_align_t) to implement realloc() with proper
memory alignment for any platform.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-02-02 19:08:24 -05:00
Ioannis Glaropoulos fb2b77c995 tests: arm: cortex_m: test dynamic lazy stacking on Cortex-m
Test the dynamic lazy stacking activation on Cortex-M.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-02-02 17:58:58 -05:00