Commit graph

4754 commits

Author SHA1 Message Date
Alexandre Bourdiol ab1a306a84 tests: lib: mem_alloc: restrict newlib config to more than 16K RAM
This test fails for newlib configuration,
for nucleo_f030r8 which has only 8K of RAM.
But each step of the test is successfull when executed solely
or with smaller buffer size.
Note: test is working on nucleo_f091rc which has larger RAM (32K)

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-07-06 17:24:02 +02:00
Joakim Andersson a52c442fc7 Bluetooth: test: Print disconnect reason in hex value
Print the disconnect reason in hex value since the defines are in hex.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-06 11:15:39 +02:00
Joakim Andersson 4be66bd33d Bluetooth: Fix host RX thread deadlock
Fix host RX thread being deadlocked. The deadlock occurs because the
RX thread is stuck waiting in conn_tx_alloc with K_FOREVER but if the
connection is disconnected only the RX thread can unblock it in the
handling of the disconnect event.

This commit fixes this deadlock by splitting the processing of the
disconnected event into two parts.
The part needed to unblock the RX is to release resources held by
unack'ed TX packets and mark the connection state as not connected
anymore.
The RX thread waiting for free_tx fifo and the TX thread waiting for
the bt_dev.le.pkts semaphore will both check the connected state after
having acquired them and will abort if disconnected.
The rest of the processing will be handled at normal RX thread
priority like normal.

Move the bt_recv_prio handling to the Bluetooth host when the host
has defined its own RX thread (CONFIG_BT_RECV_IS_RX_THREAD=n).
If the HCI driver has the RX thread (CONFIG_BT_RECV_IS_RX_THREAD=y),
then the responsibility to call bt_recv and bt_recv_prio correctly
falls to the HCI driver.
The helper function bt_hci_evt_is_prio() is replaced with
bt_hci_evt_get_flags() so that the HCI driver can do this correctly.
This decision to replace was made so that existing HCI drivers
maintained out-of-tree will fail at compile time with the new system.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>

Bluetooth: host: Move bt_recv_prio to host when RX thread is defined

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-06 11:15:39 +02:00
Dominik Ermel 5a40ff1ac5 posix/fs: Fix POSIX lseek to return position upon completion
Bring standard behaviour to lseek, where new file position is returned
on success.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-07-04 07:46:51 -04:00
Sandeep Tripathy 36d1bddb41 tests: interrupt: include bcm platform
GICv3 is now support for SGI generation and test case is updated
to use GICv3 apis. bcm958402m2_a72 can be enabled now.

Signed-off-by: Sandeep Tripathy <sandeep.tripathy@broadcom.com>
2020-07-03 12:19:31 -04:00
Torsten Rasmussen 2eb897ed1c cmake: removing DTS_ROOTS in test samples as they serves no purpose
This commit is a cleanup in two test samples.

In both samples, the following line of code were found:

    set(DTS_ROOTS ${CMAKE_CURRENT_LIST_DIR})

Firstly, it is not needed to set `DTS_ROOT` in samples, as the sample
folder is always added to `DTS_ROOT`.
Secondly, the variable is named `DTS_ROOT`, but the samples used a
misspelled version `DTS_ROOTS`, which means that variable has never
had any effect.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-07-03 12:18:04 -04:00
Henrik Brix Andersen ce426f69f0 tests: drivers: dac: loopback: use internal loopback on the twr_ke18f
Enable internal DAC to ADC loopback on the NXP TWR-KE18F
board.

Increase the ADC sample time to 5 microseconds since there is no
buffer between the DAC and ADC.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-07-03 08:05:25 -04:00
Daniel Leung 95717db0f4 benchmarks: timing_info: fix x86 cycles to nsec conversion
The conversion from cycles to nanoseconds was using the incorrect
macro which resulted in microseconds instead. So fix it by
using the correct macro.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-07-02 20:51:12 -04:00
Anas Nashif 8ff5417dfc Revert "tests: dlist to add a testcase and add some tags"
This reverts commit 2c92af5a80.

See #26619

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-02 14:40:20 -05:00
Anas Nashif 9d0c633f88 Revert "tests: rbtree to add and modify some tastcases"
This reverts commit 09310462fd.

See #26619

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-02 14:40:20 -05:00
Michał Narajowski 7c06f3c38e mesh: Adjust config values to pass Transport test cases
These values were derived experimentally by running PTS test cases.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2020-07-02 16:30:01 +03:00
Enjia Mai 7ac40aabc0 tests: adding test cases for arch-dependent SMP function
Add one another test case for testing both arch_curr_cpu() and
arch_sched_ipi() architecture layer interface.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2020-07-02 08:42:53 -04:00
Stephanos Ioannidis 4b66aae3d3 tests: net: vlan: Fix typos
Fix typos in the test assert messages ("numer" to "number").

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-07-02 08:37:17 -04:00
Stefano Manni 92f142c535 tests: adc: configure adc_api test for waveshare_open103z
Configures the adc api test to use the board waveshare_open103z.

Signed-off-by: Stefano Manni <stefano.manni@gmail.com>
2020-07-02 08:35:48 -04:00
Maksim Masalski 223723e8a9 tests: mem protect syscalls update Doxygen tags, fix API, misprints
1. Doxygen tags updates of the existing tests.
2. Fixed use of API K_MSEC in test_syscall_torture
3. Removed misprints

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-07-02 08:26:12 -04:00
Dominik Ermel 03df4d3fb0 tests/drivers/flash_simulator: Add tests for non-0xff erase
Modify and add tests to support simulation of non-0xff erased flash
devices.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-07-02 08:24:19 -04:00
Sandeep Tripathy f54c57effe tests: kernel: interrupt: fix gic sgi priority
GICC_BPR has minimum legal values in secure and non-secure states.
'3' is the minimum BPR value leading to group and sub-group priority
as 'gggg.ssss'. In order to make an IRQ preemptible they need to
be in different priority group.

Hence to be generic priority values should be above '0x0f'.

IRQ0 - default priority  (low prio)
IRQ1 - 0x0   (highest prio)

Signed-off-by: Sandeep Tripathy <sandeep.tripathy@broadcom.com>
2020-07-01 08:02:57 -04:00
Sandeep Tripathy ca6f04f554 tests: kernel: interrupt: Add gicv3 support
Generate SGI to self using own MPIDR.

Signed-off-by: Sandeep Tripathy <sandeep.tripathy@broadcom.com>
2020-07-01 08:02:57 -04:00
Daniel Leung 2a706d9f20 benchmarks: latency_measure: set number of CPU to 1
The latency measurement are not designed to run on multiple CPUs,
so limit it to just 1 CPU.

Fixes #26264

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-07-01 10:13:33 +03:00
Paul Sokolovsky 1ca1193a9d tests: socket: getaddrinfo: Explicitly ignore return of sys_mutex_lock
This is a test, and the function is called with K_FOREVER, so it's not
supposed to fail.

Fixes: #25735
CID: 210582

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-06-30 10:02:46 -04:00
Andries Kruithof ed85577a22 Bluetooth: controller: Increase timeout for babblesim
The timeout for testing advertisement extensions in babblesim
was set to 30 seconds. Depending on the hardware used for
testing this may be too low. Increased to 120 seconds

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2020-06-29 09:27:09 +02:00
Nicolas Pitre 1e52b1123e tests/lib/heap_align: improve test
Many issues:

- heapmem[] is of type uint64_t meaning that it contains HEAP_SZ * 16
  bytes but the heap is initialized with only 1/16 of that, making
  this test's memory footprint way too large.

- The test to ensure the heap is empty uses an allocation size of
  (heap_end - heap_start - 8) which is wrong as heap_end and heap_start
  are uint64_t pointer types and therefore their difference will be 8x
  smaller than intended. Furthermore, the 8 here is unnessary as the
  chunk header size is already included in the location of heap_start.

- The heap start address misalignment bare no purpose as the misaligned
  start of the free heap is already controlled by the variable prefix
  allocation size.

- Alignment and sizes should rather be expressed in terms of size_t
  rather than uintptr_t.

Fix those issues, and add a few more test angles:

- Make the prefix allocation itterate across the entire alignment range
  to exercize all possible misalignments.

- Vary the aligned allocation size to better exercize the pre-alignment
  allocation and suffix handling.

- Double the aligned allocation to add more variability in the heap
  structure.

- Test the testing of emptiness by making sure that no more allocations
  are possible when we think we allocated it all.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2020-06-28 23:43:42 -04:00
Andy Ross 472b67e124 tests/kernel/smp: Don't wait so long at startup
Sleeping for a full second at startup is needless.  The currently
enabled subsystems on platforms that run this test don't even have any
other threads running at startup, so we're guaranteed the other core
is in idle before we even reach main().  Just a few ms is plenty.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-06-27 08:14:58 -04:00
Nicolas Pitre ae597c07b6 printk: print %p properly on 32-bit targets
The width for %p on 32-bit targets should be 8 regardless of
CONFIG_PRINTK64. Adjust the test accordingly.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2020-06-27 00:03:58 -04:00
Tobias Svehagen 0171bd9578 tests: fs: nvs: Add two test cases for testing nvs_gc
Add tests for checking that nvs_gc can handle corrupt ate's.

Tests #26407

Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
2020-06-26 12:07:13 -05:00
Anas Nashif 1200222ff8 test: posix: fix identifier
Follow convention for identifying tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-25 22:36:17 -05:00
Anas Nashif 98c75038c8 tests: net: remove duplicate test
remove duplicate, no need to specify test twice (one for userspace,
another for default).

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-25 22:36:17 -05:00
Anas Nashif 2c5d40437b kernel: logging: convert K_DEBUG to LOG_DBG
Move K_DEBUG to use LOG_DBG instead of plain printk.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-25 16:12:36 -05:00
Enjia Mai d678d7a65f tests: adding test cases for device abstraction
Add three test cases of device abstraction for improving test coverage.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2020-06-25 17:02:27 -04:00
Carles Cufi 22be0d8fd5 tests: nvs: Disable running the 0x00 test suite
There is an issue when running the 0x00 erase value test suite, so
disable it temporarily.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-06-25 13:24:07 -05:00
Andrzej Głąbek 4f1156d186 boards: nrf9160dk_nrf9160: Add "spi" as supported feature
Plus corresponding configuration file for the spi_loopback test that
will be activated for that board by this added capability.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-06-25 19:33:41 +02:00
Anas Nashif 3791ec1491 tests: jwt: increase timeout for test
Some platforms need some more time here.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-25 11:05:29 -04:00
Marcin Niestroj 398f22b34a tests: eventfd: drop POSIX_API ifdeffery
Test is configured with CONFIG_POSIX_API=y, so there is no reason to
check for it being enabled in C. Additionally when CONFIG_POSIX_API=n a
much "bigger" posix/sys/socket.h was included instead of net/socket.h,
which should be rather opposite.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-25 12:14:40 +02:00
Anas Nashif 7c85f4b2f5 samples: remove board_shell
This sample is not working on all boards anymore. Adding every single
shell we have to the prj.conf does not work on every board, due to
missing features.

Instead, we now change how shell modules are enabled and make it
possible to enable shell command and modules for any application when
CONFIG_SHELL is enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-24 21:37:12 -04:00
Ioannis Glaropoulos 422ba1f11b tests: kernel: timer_api: add timer label for this test
Add timer label for this test suite, so it is included
in sanity check runs with -t timer.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-06-24 18:04:17 -07:00
Ioannis Glaropoulos 6209610820 tests: kernel: timer_api: enabling test-suite for Qemu Cortex-M0
After the Qemu Cortex-M0 timer driver rework, we may
enable the test-suite that had been (always) excluded
from running on this platform.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-06-24 18:04:17 -07:00
Ioannis Glaropoulos cfda90d32f tests: kernel: tickless: re-enabled test-suite for Qemu Cortex-M0
After the Qemu Cortex-M0 timer driver rework, we may
re-enable the test-suite that had been excluded for this
platform.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-06-24 18:04:17 -07:00
Ioannis Glaropoulos 6a3d460916 tests: kernel: common: re-enabled test-cases for Qemu Cortex-M0
After the Qemu Cortex-M0 timer driver rework, we may
re-enable the test-cases that had been skipped for this
platform.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-06-24 18:04:17 -07:00
Andrew Boie eec6b2673d tests: benchmarks: sched: remove icount notes
icount is on by default for all QEMU targets where it works
properly.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-06-24 20:28:36 -04:00
Andy Ross 973487fdad lib/os: Rework/shrink printk conversions, add 64 bit support
Add support for 64 bit conversions in a uniformly expressable way by
printing values backwards into a buffer on the stack first.  This
allows all operations to work on the low bits of the value and so the
code doesn't need to care (beyond the size of that buffer) about the
word size.  This trick also doesn't care about the specifics of the
base value, so in the process this unifies the decimal and hex printk
conversion code to a single function.

This comes at a mild cost in CPU cycles to the decimal converter and
somewhat higher cost to hex (because it's now doing a full div/mod
operation instead of shifting and masking).  And stack usage has grown
by a few words to hold the temporary.  But the benefits in code size
are substantial (e.g. ~250 bytes of .text on arm32).

Note that this also contains a change to tests/kernel/common to
address what appears to have been a bug in the original converters.
The printk test uses a format string that looks like "%-4x%-2p" and
feeds it the literal arguments "0xABCDEF" and "(char *)42".
Now... clearly both those results are going to overflow the 4 and
2-byte field sizes, so there shouldn't be any whitespace between these
fields.  But the test was written to expect two spaces, inexplicably
(yes, I checked: POSIX-compatible printf implementations don't have
those spaces either).

The new code is definitely doing the right thing, so fix the test
instead.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-06-24 13:43:40 -07:00
Jukka Rissanen 6ecea4b3dd net: conn: Handle multi interface AF_PACKET recv() properly
If we have multiple network interfaces and we are waiting incoming
network packets, make sure to honor the bind of the socket so that
correct socket will receive data in certain network interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-24 23:34:27 +03:00
Ningx Zhao d7d2cd5086 tests: queue modifying and adding test case
1.Add a new testcase to verify multiple queues can be defined
2.Add some code comments to describe function performance.

Signed-off-by: Ningx Zhao <ningx.zhao@intel.com>
2020-06-24 20:59:52 +02:00
Jian Kang 979e124e21 tests: lib: Add some new test cases for libc
Add some new test cases to verify lib API which not be test
in existing test cases

Signed-off-by: Jian Kang <jianx.kang@intel.com>
2020-06-23 22:42:25 -04:00
Ningx Zhao 2c92af5a80 tests: dlist to add a testcase and add some tags
Add a testcase to verify some operations running
in constant time.
Add new informative Doxygen tags

Signed-off-by: Ningx Zhao <ningx.zhao@intel.com>
2020-06-23 18:55:47 -04:00
Enjia Mai ce31b89e50 tests: adding test cases of spinlock
Add test case for testing achieve mutual exclusion using interrupt
masking, and initialize at runtime.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2020-06-23 16:14:55 -04:00
Krzysztof Chruscinski e20f08cd69 tests: portability: cmsis_rtos_v1: Increase clock tolerance
Increased accepted difference between system clock and
k_busy_wait clock. Some platforms (e.g. Nordic SoC) are using
different clocks for system clock (low frequency) and k_busy_wait
(high frequency). If those clocks are driven from low accuracy
source like RC oscillator then difference may be significant.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-23 19:21:10 +02:00
Maksim Masalski f221dfec2f tests: added new doxygen tags for memory protection tests
Added new doxygen tags for tests:
1. test_mem_domain_destroy
2. test_domain_add_part_drop_to_user

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-06-23 12:18:30 -04:00
Maksim Masalski f25406af99 tests: add new Doxygen tags to threads tests
Reason is that some threads tests have poor description Doxygen
tags. I decided to fix that situation in some tests which understand.

Update Doxygen tags for the next tests:
test_create_new_supervisor_thread_from_user()
test_user_mode_enter()
test_create_new_higher_prio_thread_from_user()
test_create_new_thread_from_user_huge_stacksize()

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-06-23 11:55:26 -04:00
Peter Bigot 219a3ca96d device: provide internal access to static device array
Device objects in Zephyr are currently placed into an array by linker
scripts, making it easy to iterate over all devices if the array
address and size can be obtained.  This has applications in device
power management, but the existing API for this was available only
when that feature was enabled.  It also uses a signed type to hold the
device count.

Provide a new API that is generally available, but marked as internal
since normally applications should not iterate over all devices.  Mark
the PM API approach deprecated.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-23 13:27:14 +02:00
Marcin Niestroj f08ef736a0 drivers: lora: sx1276: select PA output by dts property
PA selection mainly depends on board design. So it looks like
device-tree is a better mechanism than Kconfig in this case. Use string
property with two possible values: "rfo" and "pa-boost".

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-23 13:08:06 +02:00
Andy Ross af4ce4a166 tests/lib: Add heap_align test
Test of the sys_heap_aligned_alloc() API.  This is separate from the
existing heap test because aligned_alloc() requires a kconfig to
enable it that can change the heap block header format and will impact
code coverage of the "small" block variant.

It's a fairly simple whitebox test that instantiates a heap and then
enumerates all possible alignments within it, with and without
pre-allocated data, to verify that the resulting memory is correctly
aligned and the heap stays consistent.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-06-22 14:54:04 -04:00
Krzysztof Chruscinski 4baf24203d tests: unit: util: Add tests for new macros
Added tests for GET_ARG_N and GET_ARGS_LESS_N

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-22 15:18:07 +02:00
Håkon Øye Amundsen a4957be25b storage/stream: allow NULL data pointer
This is done to support the idiomatic way of performing flush
operations, where the caller might not have access to the proper data
pointer. Also, there is no reason why reading from address 0 should
not be allowed.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2020-06-22 14:36:05 +02:00
Dominik Ermel 076282a117 subsys/fs/nvs: Use flash_get_parameters() to get erase value
Use new flash API call to obtain erase value instead of relaying on
hardcoded literals.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-06-22 14:35:03 +02:00
Dominik Ermel 6ea6321586 drivers/flash: Add support for flash_get_parameters to drivers
With addition of flash_get_parameters API call, it is needed to provide
support for the API to flash drivers.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-06-22 14:35:03 +02:00
Stephanos Ioannidis 27d42f060d tests: kernel: lifo_usage: Exclude on qemu_arc_em
This test has a very high failure rate on `qemu_arc_em` and needs to be
disabled until a fix is available.

To be addressed in #26163.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-06-21 09:47:24 -04:00
Marek Porwisz 3c0124a0a0 tests: openthread: Test passing net_pkt to OpenThread thread
Passing TX messages from sockets was reworked for openthread
thus tests need to be created/updated in order to pass.

Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
2020-06-18 19:37:06 +02:00
Henrik Brix Andersen 0997265111 tests: drivers: sensor: add test case for getting a sensor attribute
Add test case for getting the value of a sensor attribute.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-06-17 17:13:14 +02:00
Roman Vaughan 0562d9fac6 tests: fs: Ensure file_path includes max file name length
A hardcoded path lenth of 80 will not be able to suppor the full length
of 255 when LFN is enabled. This does produce a compiler error,
thankfully, this is only applicable to the test cases.

Signed-off-by: Roman Vaughan <nzsmartie@gmail.com>
2020-06-17 17:07:45 +02:00
Roman Vaughan 70df7a87a1 tests: fs: Add test case for LFN with FATFS
Rerun the same test but with CONFIG_FS_FATFS_LFN=Y and
with a long filename.

Signed-off-by: Roman Vaughan <nzsmartie@gmail.com>
2020-06-17 17:07:45 +02:00
the BASTION 3f5a32a7d4 boards: arm: add ruuvi_ruuvitag
Adds ARM based Ruuvtag baord. This board is based on the nRF52832.

Signed-off-by: the BASTION <thebasti0ncode@gmail.com>
2020-06-17 12:29:41 +02:00
Maksim Masalski 6a805dff9f tests: fix text output in timing_info test
After reviewing that test I found output looks too messy.
1. Remove words starting from capital letter in the middle of the
sentence.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-06-17 11:17:27 +02:00
Lukasz Maciejonczyk 8acebb5cd0 tests: net: Add tests for IPv6 mesh addresses
This tests make sure that the right source address is chosen during
the mesh multicasting.

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2020-06-16 19:14:52 +02:00
Piotr Mienkowski 4b194eb4fc gpio: remove deprecated API functions/macros
This commit removes API functions and macros which were deprecated in
2.2 release. GPIO drivers are updated accordingly.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-06-16 19:13:05 +02:00
Krzysztof Chruscinski 34baec32ce tests: drivers: uart: Update uart_async read_abort test
Updated test to reflect API change.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-16 19:11:57 +02:00
Ningx Zhao c42297c2f1 tests: ringbuffer modify a tesecase
Update code comments in ringbuffer/src/main.c
modify a testcase to verify the address stored by ring buffer
is contiguous, and the size of every element is equal to the size of
pointer.

Signed-off-by: Ningx Zhao <ningx.zhao@intel.com>
2020-06-16 16:55:51 +02:00
Marcin Niestroj 3b0917bcbf tests: posix: eventfd_basic: add new test
Introduce new test for eventfd, which will test it in only basic
scope. The real reason why this is introduced is to have a test with
minimal set of configuration dependencies, such as disabled
pthreads (compared to full tests/posix/eventfd/ variant). This allows to
test eventfd mechanism with both POSIX_API=n and POSIX_API=y.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-15 16:52:29 +02:00
Maciej Perkowski bd14a9d493 tests: littlefs: Increase timeout to 180s
The test takes ~175s to end on nrf5284dk_nrf52840 and was failing
due to too short default timeout (60s).

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2020-06-15 16:45:38 +02:00
Marcin Niestroj f74bea04aa tests: net: poll: disable NET_IPV4
Unit test code uses IPv6 only, so disable IPv4.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-15 10:31:37 +03:00
Marcin Niestroj 0995246edb tests: net: poll: select NET_CONFIG_NEED_IPV6
Unit test code requires IPv6 to be ready. Select
CONFIG_NET_CONFIG_NEED_IPV6=y to ensure that.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-15 10:31:37 +03:00
Marcin Niestroj acd8b8d93e tests: net: select: disable NET_IPV4
Unit test code uses IPv6 only, so disable IPv4.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-15 10:31:37 +03:00
Marcin Niestroj ec57ebff66 tests: net: select: select NET_CONFIG_NEED_IPV6
Unit test code requires IPv6 to be ready. Select
CONFIG_NET_CONFIG_NEED_IPV6=y to ensure that.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-15 10:31:37 +03:00
Anas Nashif 6f4f5b1fe5 tests: exclude qemu_arc_hs in lifo_usage test
Fails very frequently in CI, disabling until a fix is available, see

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-12 23:22:57 -04:00
Hake Huang abce94bb98 dma: add EDMA test support for MCUX
for RT series CONFIG_NOCACHE_MEMORY need enabled
for Kinetis series CONFIG_DMA_TEST_SLOT_START for test
modify the target and dest alignment

frdmk64f need replace strlen to sizeof in irq callback
clean the unused receive buffer, so output is tidy

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2020-06-12 13:03:28 -05:00
Christopher Friedt 72e7debca5 tests: posix: tests for nanosleep(2)
This commit provides test-cases for nanosleep(2)

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-06-12 17:02:03 +02:00
Vinayak Kariappa Chettimada 372a2e2fd3 tests: Bluetooth: bsim_test: Include advx testing in CI
Update compile.sh and added test_script, so that
bsim_test_advx bsim_test application is built and run in
CI.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-12 15:50:34 +02:00
Vinayak Kariappa Chettimada 353bb6d5cf tests: Bluetooth: make ctrl_advx a BabbleSim test
Convert the ctrl_advx application into a Babblesim test.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-12 15:50:34 +02:00
Vinayak Kariappa Chettimada 0a18b7e2cb tests: Bluetooth: advx: disable periodic SYNC_IND packets
Added function call to test disable of the started periodic
SYNC_IND packets.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-12 15:50:34 +02:00
Vinayak Kariappa Chettimada b92abf8e6a tests: Bluetooth: advx: Use 2M PHY auxiliary PDUs.
Use 2M PHY auxiliary PDUs in test.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-12 15:50:34 +02:00
Vinayak Kariappa Chettimada 1bd7f26cb0 tests: Bluetooth: advx: Update data while periodic advertising
Update Aux PDU AD Data while periodic advertising.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-12 15:50:34 +02:00
Vinayak Kariappa Chettimada f0174527f9 tests: Bluetooth: advx: Added code to test periodic advertising
Added code to invoke starting of periodic advertising.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-12 15:50:34 +02:00
Vinayak Kariappa Chettimada dd0c46c371 tests: Bluetooth: advx: test application for adv. ext. development
Added a new advx test application to aid test driven
development.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-06-12 15:50:34 +02:00
Torsten Rasmussen e1c1d1daca cmake: make find_package(ZephyrUnittest...) REQUIRED
This commit is a followup to PR #25808 which updates the tests to
ensure the REQUIRED keyword is also used for the ZephyrUnitest package.

This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-06-12 11:10:23 +02:00
Ilya Tagunov 3dc6ee048d boards: nucleo_l073rz/l152re: use node labels in DAC samples and tests
Use node labels instead of aliases to select ADC and DAC instance
in samples and tests.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2020-06-12 11:06:44 +02:00
Ilya Tagunov 02d673c564 tests: drivers: dac: Add Nucleo-L152RE board
Enable DAC tests for Nucleo-L152RE board.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2020-06-12 11:06:44 +02:00
Jian Kang 445576c8a2 tests: kernel: Add a new test for providing time duration in milliseconds
Add a new test case to verify whether kernel allow proving time duration
in milliseconds.

Signed-off-by: Jian Kang <jianx.kang@intel.com>
2020-06-11 07:13:23 -04:00
Ying ming 1b1d728a18 tests: atomic operation: add new test cases
add new test cases to illustrate the zephyr OS
support an array of atomic variables, each bit
of which can be modified.

Signed-off-by: Ying ming <mingx.ying@intel.com>
2020-06-10 10:46:28 -04:00
Krzysztof Chruscinski 727f8e0889 tests: unit: util: Add test for nested FOR_EACH call
Added test for case were FOR_EACH call is nested.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-10 11:58:13 +02:00
Krzysztof Chruscinski 1b4b9386e5 sys: util: Added separator to FOR_EACH_ macros
Added separator (e.g. comma or semicolon) parameter to FOR_EACH_ family.
Separator is added between macro execution for each argument and not at
the end.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-10 11:58:13 +02:00
Krzysztof Chruscinski 77bc550746 tests: drivers: clock_control: nrf: increased LFCLK startup time
Fixed occasional test failures when clock was not ready after
specified time.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-10 11:57:04 +02:00
Anas Nashif 603c24dec9 tests: common: skip bootdelay test on qemu_cortex_m0
Test fails on this one platform, to unblock other changes, skip the test
while the issues is being looked at. This test never ran on this
platform before due to ram restrictions.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-09 23:36:16 -04:00
Anas Nashif ac7756d4b1 tests: kernel: common: rename test boot_delay
rename boot_delay function name for clarity and change doxygen group to
be more generic and part of the init group.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-09 23:36:16 -04:00
Anas Nashif c815b062c6 tests: kernel: remove ram restrictions
Remove all ram restrictions in kernel tests and revisit all tests and
try to make them pass on all platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-06-09 23:36:16 -04:00
Maksim Masalski 82855aa4e0 tests: update doxygen tags for syscalls tests
Reason is that some tests have poor description in Doxygen tags,
decided to fix that situation in some tests which I understand.
Also remove small misprints from some parts of code.

Update Doxygen tags for the next tests:
test_access_kobject_without_init_access
test_thread_without_kobject_permission
test_bad_syscall
test_syscall_invalid_kobject

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-06-09 17:46:23 -04:00
Peter Bigot 31d615eab5 tests: kernel: timer_api: remove extra adjustment to expected result
The converted target value for remaining ticks was increased by one to
match original code, which used a one-sided test.  The current test is
two-sided, so that increment is already present in the allowed 1 tick
error for boards with no slew, and incorporating it into the absolute
error can cause the test to fail.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-09 18:57:31 +02:00
Ningx Zhao 09310462fd tests: rbtree to add and modify some tastcases
Add two testcases,one of them verify rbtree node can be embedded
in any user struct.
And another verify some operations in logarithmic time.

Signed-off-by: Ningx Zhao <ningx.zhao@intel.com>
2020-06-09 10:21:33 -04:00
Reto Schneider 0b4b3ae4dd cmake, samples, tests: Use semi-accurate project names
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming multiple projects
"NONE" defeats this functionality.

This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names, small, manual adjustments
have been done.

See also 7eabab2f5d ("samples, tests: Use semi-accurate project names")

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2020-06-09 08:18:29 -04:00
Peter Bigot 9c2c12d10f tests: tickless: fix build error on qemu_cortex_m3
Code compiled only for this platform had an unconverted legacy
sleep delay.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-09 08:14:53 -04:00
YouhuaX Zhu 0b2fa63191 Tests: create new test cases to verify sensor APIs.
1. Create a dummy sensor driver and implement the sensor interfaces:
    .sample_fetch = &dummy_sensor_sample_fetch,
    .channel_get = &dummy_sensor_channel_get,
    .attr_set = dummy_sensor_attr_set,
    .trigger_set = dummy_sensor_trigger_set.

2. Create below two test cases to verify the sensor subsys APIs:
    test_sensor_get_channels() for verifying sensor channel APIs,
    test_sensor_handle_triggers for verifying sensor trigger APIs.

Signed-off-by: YouhuaX Zhu <youhuax.zhu@intel.com>
2020-06-09 08:14:17 -04:00
YouhuaX Zhu 79481837fe Tests: Adjust code and annotations for poll test cases.
1. Shorten the long function body for test_poll_wait() to
increase readability, split it into below two method:
    test_poll_wait(),
    check_results().

2. Adjust annotations for below poll test cases:
    test_poll_wait(),
    test_poll_cancel(),
    test_poll_threadstate().

Signed-off-by: YouhuaX Zhu <youhuax.zhu@intel.com>
2020-06-09 08:14:01 -04:00