Commit graph

5954 commits

Author SHA1 Message Date
Nicolas Pitre
f1f63dda17 arm64: FPU context switching support
This adds FPU sharing support with a lazy context switching algorithm.

Every thread is allowed to use FPU/SIMD registers. In fact, the compiler
may insert FPU reg accesses in anycontext to optimize even non-FP code
unless the -mgeneral-regs-only compiler flag is used, but Zephyr
currently doesn't support such a build.

It is therefore possible to do FP access in IRS as well with this patch
although IRQs are then disabled to prevent nested IRQs in such cases.

Because the thread object grows in size, some tests have to be adjusted.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-05-03 11:56:50 +02:00
Joakim Andersson
de60823d9a Bluetooth: tester: fix bt_le_oob_set_legacy_tk excluded when supported
Fix bt_le_oob_set_legacy_tk excluded when Legacy OOB pairing is
supported. We still support legacy OOB when
CONFIG_BT_SMP_OOB_LEGACY_PAIR_ONLY is not defined.
It is only when we disable Legacy pairing that it is not included.

Check that the OOB data type is in fact Legacy OOB before calling
bt_le_oob_set_legacy_tk.

Log an error if the OOB type was not handled by the callback.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-05-03 10:00:44 +02:00
Mahesh Mahadevan
96fd76edda tests: i2s: Fix i2s_states_test test suite
1. Update the way test_i2s_state_error_neg test handles
RX overflow.
2. Clean up after test_i2s_state_stopping_neg test in case the
receiving channel is stuck in the STOPPING State if the data
was received prior to calling the STOP trigger.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-04-30 12:02:55 -05:00
Mahesh Mahadevan
06c1020304 tests: i2s: Update i2s_speed test
1. Allow loopback over different I2S ports
2. Add a config option to indicate if the ports
   are separate

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-04-30 12:02:55 -05:00
Mahesh Mahadevan
3df8733276 tests: i2s: Update i2s_api test
1. Provide an option to loopback over separate I2S ports
2. Increase the buffer count in the loopback test to 4
3. Update test_i2s_transfer_rx_overrun test on how to
   handle RX overrun failures

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-04-30 12:02:55 -05:00
Piotr Pryga
9a14f62742 tests: Bluetooth: df: Fix undefinded symbols error
Remove undefined functions (unsued anymore).
Add missing stub implementation for new DF related radio functions.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-04-30 11:07:55 +02:00
Jukka Rissanen
6e1df0d603 tests: net: Refactor tests when running in real hw
The network tests were expecting that network interfaces
are in certain order. As we cannot guarantee that, refactor
the tests like this:

* if test is using DUMMY L2 driver, then disable Ethernet L2
  and fetch only DUMMY L2 instead of default interface
* if test is using Ethernet L2 driver, then make sure that the
  test is using the Ethernet interface specified in the test
  instead of the one provided by the DUT

Fixes #34505

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-04-30 11:59:10 +03:00
Jukka Rissanen
d367fc73c5 tests: net: igmp: Remove device_pm_control_nop
The use of device_pm_control_nop is deprecated so remove it
from the test as it will give warning in CI.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-04-29 14:23:11 -04:00
Bob Recny
81f839b157 boards: arm: Add u-blox EVK-NINA-B4
Add support for u-blox EVK-NINA-B4, which uses the nRF52833

This board is similar to the nrf52833dk_nrf52833, though it
uses a u-blox NINA-B40x openCPU module with DC-DC support
included.
Simplified pwm LED aliases
Corrected LED assignments for red, green, and blue
Addressed review comments (spi & gpio 0 0)

Tested with blinky, button, and Bluetooth peripheral_hr

Signed-off-by: Bob Recny <bob.recny@u-blox.com>
2021-04-29 09:52:19 -04:00
Guðni Már Gilbert
2d81d2d91e boards: arm: Add adc1 node to board nucleo_l412rb_p
The board has 16 input channels on ADC1.

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-04-29 09:51:39 -04:00
Anas Nashif
bfb1634af5 tests: cpp: run exceptions tests only on mps2_an385
While we wait for #32448, run only on mps2_an385.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-29 09:00:40 -04:00
Anas Nashif
8e5c09b2c6 tests: cpp: fix test identifier
use cpp as the main section in the identifier.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-29 09:00:40 -04:00
Anas Nashif
174afccced tests: move cpp tests to subsys/cpp
Wrongly places under application_development. We have a CPP subsystem,
so move them under tests/subsys/cpp for consistency.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-29 09:00:40 -04:00
Krzysztof Chruscinski
acd8d8ebda tests: kernel: fatal: Add no multithreading test
Added test which verifies that when multithreading is disabled
exception as correctly handled by the kernel.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-29 14:50:35 +02:00
Krzysztof Chruscinski
4f949a28fb tests: kernel: mem_heap: Add CONFIG_MULTITHREADING=n configuration
Extended mheap_api_concept test suite to support case when
multithreading is disabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-29 14:50:35 +02:00
Krzysztof Chruscinski
693c3fbb9d tests: kernel: mem_slab: Add no multithreading support
Extended mslab_api test suite with CONFIG_MULTITHREADING=n
configuration.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-29 14:50:35 +02:00
Krzysztof Chruscinski
e99a015ba3 tests: kernel: threads: no-multithreading: Extend test
Extended test to validate following functionality:
- k_busy_wait
- k_timer
- irq_lock/irq_unlock
- k_cpu_idle
- SYS_INIT()

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-29 14:50:35 +02:00
Krzysztof Chruscinski
2e085a5202 tests: kernel: timer: timer_api: Extend with CONFIG_MULTITHREADING=n case
Extended test to validate that timer API is working as expected
when CONFIG_MULTITHREADING=n.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-29 14:50:35 +02:00
Marcin Niestroj
9f478e0a80 tests: net: dns_addremove: cover dns_resolve_reconfigure()
Add tests for just introduced dns_resolve_reconfigure() API, which
allows to replace old DNS servers with new ones.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-04-29 08:00:09 -04:00
Marcin Niestroj
71c31c45c7 net: dns: add dns_resolve_reconfigure() API
So far there was no dedicated mechanism for replacing DNS servers with
new list. Add dns_resolve_reconfigure() API that allows to achieve that
in a thread-safe manner.

Introduce 3rd state in DNS context lifetime by converting from 'bool
is_used' to 'enum dns_resolve_context_state state'. This new
DEACTIVATING state allows to mark a DNS context as busy and safely close
context without holding lock. Closing DNS context with released lock
prevents deadlock in case net_context_close() has to synchronize with a
separate thread executing handler passed to net_context_recv() (which is
the case for example with ESP-AT WiFi driver).

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2021-04-29 08:00:09 -04:00
Jukka Rissanen
a4c119a23d tests: net: igmp: Add IPv4 IGMP tests
IGMP (Internet Group Management Protocol) support tests.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-04-29 14:49:55 +03:00
Gerard Marull-Paretas
f163bdb280 power: move reboot functionality to os lib
Reboot functionality has nothing to do with PM, so move it out to the
subsys/os folder.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-28 20:34:00 -04:00
Enjia Mai
e53d549e21 tests: mem_protect: add a test case of adding memory partition
Add a test case to validate when adding a new partition into a memory
domain with over its maximum specified limit number, an assertion
failure happens.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2021-04-28 14:34:17 -04:00
Paul Sokolovsky
bb77186cc6 tests: kernel: no-multithreading: Use tc_util.h
The comment in this test says that it cannot use ztest, as the latter
spawns some threads. However, still format the output in a way
compatible with ztest output, by using tc_util.h macros. This is
similar to a few other tests which can't use ztest library directly.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2021-04-28 12:54:13 -04:00
Paul Sokolovsky
25a553f800 tests: drivers: ipm: Add TC_SUITE_START/TC_SUITE_END
Apparently, this test cannot be immediately converted to ztest, but
make the output match the standard ztest format, by wrapping it in
a testsuite brackets. (Also, "cleanup" testcase name, TC_END_RESULT
uses __func__ as the name, so just pass __func__ to TC_START either).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2021-04-28 12:54:13 -04:00
Maksim Masalski
2c138fb59f tests: add new kernel objects tests
Found out that important requirements are not tested by current
kernel objects tests. Decided to fix that situation

New added tests:
1. test_kobj_assign_perms_on_alloc_obj()
Create kernel object semaphore, dynamically allocate it from the
calling thread's resource pool.
Check that object's address is in bounds of that memory pool.
Then check the requestor thread will implicitly be assigned
permission on the allocated object by using
semaphore API k_sem_init()

2. test_no_ref_dyn_kobj_release_mem()
Dynamically allocated kernel objects whose access is controlled by
the permission system will use object permission as a reference count
If no threads have access to an object, the object's memory released.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2021-04-28 12:53:55 -04:00
Gerard Marull-Paretas
e4ec9f7685 tests: fs: remove usage of device_pm_control_nop
device_pm_control_nop is now deprecated in favour of NULL.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-28 12:53:09 -04:00
Gerard Marull-Paretas
5899b8a190 tests: net: remove usage of device_pm_control_nop
device_pm_control_nop is now deprecated in favour of NULL.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-28 12:53:09 -04:00
Gerard Marull-Paretas
6aee84e747 tests: lib: devicetree: remove usage of device_pm_control_nop
device_pm_control_nop is now deprecated in favour of NULL.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-28 12:53:09 -04:00
Gerard Marull-Paretas
1eabc24469 tests: kernel: remove usage of device_pm_control_nop
device_pm_control_nop is now deprecated in favour of NULL.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-28 12:53:09 -04:00
Gerard Marull-Paretas
9a2fcb7a97 tests: drivers: remove usage of device_pm_control_nop
device_pm_control_nop is now deprecated in favour of NULL.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-28 12:53:09 -04:00
Michał Narajowski
00681f0241 Bluetooth: tester: Implement Provisioning Node Added event
This information is useful to the automation framework when implementing
tests where the IUT is the provisioner and the test uses two PTS
instances.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-04-28 11:13:45 -04:00
Gerard Marull-Paretas
e25dc6ff80 tests: kernel: device: adjust for device pm changes
- If device PM is not supported -ENOSYS is returned, update test case to
  account for that
- Remove usage of device_pm_control_nop

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-27 16:28:49 -04:00
Bob Recny
3a4f08cd90 boards: arm: Add u-blox EVK-NINA-B1
Add support for u-blox EVK-NINA-B1 which uses the nRF52832.

This board is similar to the nRF52dk_nrf52832 with
different pin assignments on the header pins and not having
the debug-in and shield SWD headers.

Tested with blinky, button, and Bluetooth peripheral_hr
Corrected duplicate pin assignment for i2c1 in dts file
Corrected copyright date in Kconfig.defconfig
Rebase to update test_adc.c
Corrected sda-pin, scl-pin assignments and LED aliases

Signed-off-by: Bob Recny <bob.recny@u-blox.com>
2021-04-27 13:33:20 -04:00
Hou Zhiqiang
0700a24276 devicetree: Add DT_FOREACH_CHILD_STATUS_OKAY macro
The macro only iterates the enabled child nodes and invokes
provided macro for each node.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2021-04-27 13:32:55 -04:00
Enjia Mai
d3747db66f tests: kernel: fix two test cases of condvar hang up in SMP
Make some change on two codvar test cases to fit testing under SMP,
and shorter the test cases execution time.

Fixes #33558.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2021-04-27 13:30:24 -04:00
Enjia Mai
2e1ac6b46b tests: smp: cancel CONFIG_MP_NUM_CPUS limit of some testcases
Try to remove CONFIG_MP_NUM_CPUS=1 configuration for the test of
condvar, sysmutex and semaphore, in order to test SMP condition more.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2021-04-27 13:30:24 -04:00
Peter Bigot
707dc22fb0 kernel: fix error in synchronous work cancellation return value
The return value is documented to be true if the work was pending, but
the implementation returned true only if the work was actually running
(i.e. the caller had to wait).  It should also return true if
scheduled or submitted work was cancelled.

Note that this means the return value cannot be used to determine
whether the call slept.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-04-27 13:28:45 -04:00
Anas Nashif
80116f1413 tests: benchmarks: footprints: this is not a test
Do not configure this as a test, this will change footprint drastically
and will skew results and tracking.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-27 12:15:14 -04:00
Marek Pieta
66b6f07ea3 tests: drivers: Add LED GPIO driver to build_all
Change adds LED GPIO driver to build_all test.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2021-04-27 16:21:48 +02:00
Henrik Brix Andersen
d6318075b7 boards: arm: twr_ke18f: Add pinctrl dts properties
Add pinctrl-0 properties for configuration of UART, I2C, SPI, FTM,
DAC, ADC, ACMP, and PWT peripherals. These settings are based on what
is defined in the board/pinmux.c file.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-04-27 08:43:23 -05:00
Jukka Rissanen
91ff30513f tests: net: poll: Increase ztest thread stack size
The socket poll test was running out of ztest stack so increase
it by 256 bytes.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-04-27 12:02:19 +03:00
Jukka Rissanen
a9b3057f15 tests: net: ptp: Compile only on relevant boards
The tests need gPTP support so set the options and boards
properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-04-27 12:02:19 +03:00
David Leach
70edc3c1d0 tests: net: tcp2: Perform tests on DUMMY interface
Tests are designed to run over the DUMMY interface but when run on
hardware, net_if_get_default() can return the actual hardware
interface.

Fixes: #31969

Signed-off-by: David Leach <david.leach@nxp.com>
2021-04-27 12:00:14 +03:00
Thomas Stranger
32fe8a23af tests: gen_isr_table: nucleo_g071rb: decr. NUM_IRQS to avoid conflicts
After the introduction of usart1 the kernel/genisr_table test could
no longer build, due to an interrupt conflict.
Adopt the TEST_NUM_IRQS to resolve the conflict.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-04-26 14:16:03 -04:00
Thomas Stranger
8e3e5b3d2c tests: spi: add nucleo_g0b1re to spi_loopback test in async mode
Add nucleo_g0b1re to spi_loopback test using spi async configuration.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-04-26 14:16:03 -04:00
Thomas Stranger
4cce172f27 tests: uart_async_api: add nucleo_g071rb board
Adds nucleo_g071rb board to the uart_async_api test.
Therefore additionally add usart1 in board definitions.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-04-26 14:16:03 -04:00
Thomas Stranger
2cf23469e5 tests: driver: dma: enable tests on stm32g0 boards
Enables dma test cases loop_transfer and chan_blen_transfer
on stm32g03116_disco, nucleo_g071rb and nucleo_g0b1re.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-04-26 14:16:03 -04:00
Flavio Ceolin
0f5cfa9f86 tests: power_states_api: Test exit-latency-us
Test exit-latency-us property on power API test.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-04-26 08:21:30 -04:00
Flavio Ceolin
bae326b95e tests: power_states_api: Just use more realistic values
Using more realistic values to avoid confusion and make it clear the
distinction between min-residency-us and other idle properties like
exit-latency-us.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-04-26 08:21:30 -04:00