Commit graph

16700 commits

Author SHA1 Message Date
Jukka Rissanen
1e15949fe0 tests: net: socket: tls: Increase the mbedtls heap size
native_posix_64 needs more heap for the test to pass so
increase it by 2kb.

Fixes #64670

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-11-02 13:20:40 +01:00
Henrik Brix Andersen
043e6ecbf6 drivers: can: add accessor for the CAN bit error counter
Add accessor function for the CAN bit error counter.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-11-02 09:48:05 +01:00
Jeff Welder
9c51a26844 tests: build_all: modem: Add Telit ME910G1 Test Coverage
Added bindings to build_all test for new Telit ME910G1 Modem.

Signed-off-by: Jeff Welder <Jeff.Welder@ellenbytech.com>
2023-11-02 08:34:50 +00:00
Carles Cufi
9cf07bbdb5 bluetooth: Rename rpmsg HCI driver and sample to ipc
The existing driver and sample:

- drivers/bluetooth/hci/rpmsg
- samples/bluetooth/hci_rpmsg

are no longer correctly named, since they now use the IPC subsystem to
send and receive data. The IPC subsystem can use RPMsg as a transport,
but that is one of several selectable backends.

I initially wanted to deprecated both the BT_RPMSG Kconfig option as
well as the zephyr,bt-hci-rpmsg-ipc chosen node in Devicetree. However,
this proved to be undoable in the case of the Kconfig option. This is
because it's a choice option, and those have special behavior. In
particular, the only practical way to deprecate would've been to keep
the old Kconfig option outside the choice (much like it's done in this
commit) but then also add a 'depends on !BT_RPMSG' on each of the
remaining choice symbols *except* on the new BT_HCI_IPC one. This, however,
only works correctly for .conf files. If a board instead sets the
default BT_HCI_BUS_TYPE in the Kconfig.defconfig file then the Kconfig
tree parsing would fail, because it'd try to set it to a value
(BT_RPMSG) that is no longer part of the choice.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-11-02 08:32:20 +02:00
Henrik Brix Andersen
5d5249d85b drivers: can: unify spelling of CAN Flexible Data-rate abbreviation
Unify spelling of CAN Flexible Data-rate abbreviation to "CAN FD" instead
of "CAN-FD". The former aligns with the CAN in Automation (CiA)
recommendation.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-11-01 11:17:17 +00:00
Francois Ramu
b432293a9a tests: drivers: flash stm32l4 RDP on internal flash partition
Define the storage_partition in the internal flash
instead of the external NOR qspi flash,
so the testcase can PASS on the disco_l4754_iot1 board.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-11-01 11:16:48 +00:00
TOKITA Hiroshi
a17d49511f tests: arch: arm: arm_irq_vector_table: exclude arduino_uno_r4_minima
Renesas RA always uses interrupt handlers dynamically.
But this test requires static vector tables.
So, it needs to exclude platforms that use Renesas RA.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2023-11-01 10:56:46 +00:00
Alberto Escolar Piedras
482416db01 tests/bsim bis: Reduce the test verbosity
The test was printing one line for each packet it was sending
by default. That creates a huge log and slows things down.
Instead, let's only print those with verbosity set at 4 or higher.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-31 09:31:42 -05:00
Alberto Escolar Piedras
464435e22b CI bsim workflow: Also run some split BT stack tests
Also run some split BT stack tests on the nrf5340 platform
to test this configuration.

Move the selection of which BT tests are built and run
in each platform to files in the tests/bsim/ folder.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-31 09:31:42 -05:00
Alberto Escolar Piedras
21f755d651 tests/bsim run_parallel: Allow TESTS_FILE with search paths
With TESTS_FILE the user could provide a file with a list of
tests to run.
Now we also support that file containing a mix of
tests and paths in which to search for tests.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-31 09:31:42 -05:00
Alberto Escolar Piedras
10d7b1908e tests/bsim run_parallel: Ignore any script with compile in its name
Note just those called exactly compile.sh

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-31 09:31:42 -05:00
Alberto Escolar Piedras
c6f2cca515 tests/bsim/bt bis: Add support for split build with sysbuild
Add sysbuild build files, which allows building this test
both for the targets we could already before
(nrf52_bsim & nrf5340bsim_nrf5340_cpunet)
and also adds support for the a split build with the
nrf5340bsim_nrf5340_cpuapp.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-31 09:31:42 -05:00
Alberto Escolar Piedras
a84349280b tests/bsim/bt conn: Add support for split build with sysbuild
Add sysbuild build files, which allows building this test
both for the targets we could already before
(nrf52_bsim & nrf5340bsim_nrf5340_cpunet)
and also adds support for the a split build with the
nrf5340bsim_nrf5340_cpuapp.

Note that when doing a split build the controller is
taken from the hci_rpmsg BT sample, and therefore the
controller configuration in this folder is not used.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-31 09:31:42 -05:00
Alberto Escolar Piedras
c5d6ef1487 tests/bsim compile: Add support for sysbuild
Add support for sysbuild builds, which can be selected
by settings the variable sysbuild.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-31 09:31:42 -05:00
Peter Mitsis
7e8243b6af tests: app_kernel: Update README
Updates the README.txt to add some notes about user thread
configurations.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis
1bc0b1bc46 tests: app_kernel: Add user case to testcase.yaml
Updates the testcase.yaml to support a version that employs
user threads.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis
4e426fbfa1 tests: app_kernel: extend msgq test
Extends the msgq benchmark test to obtain data for larger message
queues (messages of size 192 bytes). This allows for a better
indication of what the impact of data size is on message queue
performance.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis
fa33147bf9 tests: app_kernel: Add user support
Add user thread support to message queue, semaphore, mutex and
pipe tests. Mailbox and memory map tests are restricted from
executing from user threads.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis
f9cf48313b tests: app_kernel: Add custom syscalls
Adds two custom syscalls. The first allows a user thread to
change its priority to a higher priority level. The second
is used to obtain a timestamp from a user thread.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis
bf2ab9be60 tests: app_kernel: Add bench_mem_partition
Adds macros for placing variables into bench_mem_partition.
This partition will be used to place global data in the test
that will need to be accessed from user threads.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis
5479090c91 tests: app_kernel: Use dynamic threads
Use dynamic threads instead of statically defined threads. This will
make it easier to add support for user threads to this test.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis
3234145669 tests: app_kernel: Rename fifo to msgq
Changed references of fifo to msgq as the fifo name was a remnant
of the old microkernel.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis
77cedbf630 tests: app_kernel: Simplify benchmark control loop
Eliminates the loop surrounding the execution of the benchmark
components as it was not doing anything.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis
8d663558d6 tests: app_kernel: Remove FP configurations
As nothing in the app_kernel uses floating point, there is no
reason to enable it.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis
56011222a4 tests: app_kernel: Remove unused symbols
Begin cleaning the the app_kernel benchmark project by removing
unused symbols.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:45 +01:00
Peter Mitsis
6899c0d73a tests: latency_measure: Misc updates
Adds userspace configuration to testcase.yaml.

Updates the README.rst with output from runs on a frdm_k64f board
as not only have the descriptions changed, but there is now
additional output for userspace configurations.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis
1a7e5c6c8d tests: latency_measure: Use syscall to get timestamp
Many architectures and platforms can not directly read a timestamp
from userspace as the relevant MMIO registers are inaccessible.
This necessitates that the timestamp be obtained by a system call.

The additional overhead from these system calls can be taken into
account and the recorded times adjusted depending upon whether
the test occurred entirely within kernel space, entirely within
user space, or a mix between the two.

It is worth noting that when the test requires a mix of both user
and kernel space threads, the overhead is estimated as the mean
average of purely kernel threads and purely user threads overhead
times. This might not be technically correct, but it ought to
provide a reasonable enough approximation.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis
9b38aec366 tests: latency_measure: Update mutexes
Updates the mutex benchmark tests to support user threads.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis
4c4453d697 tests: latency_measure: Update semaphores
Updates the semaphore benchmarking in the latency_benchmark code
to support user threads.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis
13ac14f2bb tests: latency_measure: Update thread ops
Update the thread ops (create/start/suspend/resume/abort) to include
support for userspace.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis
4e7bb482b1 tests: latency_measure: Update interrupt latency
Updates the interrupt to thread benchmark tests to address
a number of items.
  1. Updates descriptions to correctly indicate that it is not
     interrupt latency being measured, but the time to leave
     the interrupt and return to a thread.
  2. Repeats the test numerous times instead of just once to
     get an average.
  3. Overhead from obtaining timestamps is now accounted for.
  4. Adds support for returning to a user thread.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Peter Mitsis
8c80bbb96e tests: latency_measure: Update context switch
Updates both the preemptive and cooperative thread context switch
benchmark tests so that not only will they share the same
infrastructure, but they can both get the context switch times
when switching from ...
  1. Kernel thread to kernel thread
  2. Kernel thread to user thread
  3. User thread to kernel thread
  4. User thread to user thread

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-31 08:58:31 +01:00
Arkadiusz Cholewinski
6304e9a302 PM: add device_on_power_domian testcase.
Add test case to increase code coverage of device.c file.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2023-10-31 08:58:21 +01:00
Benedikt Schmidt
d28262905e tests: kernel: fix thread function signatures
Fix thread function signatures to avoid stack corruption on exit.
Fixes #64578

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-10-30 17:45:59 +00:00
Franciszek Zdobylak
0249f15767 tests: drivers: Fix adc labels in sensors test
Fix the labels used in io-channels to be consistent in whole
tests/drivers/build_all/sensor/adc.dtsi file.

Signed-off-by: Franciszek Zdobylak <fzdobylak@antmicro.com>
2023-10-30 12:51:20 -04:00
Yong Cong Sin
1782011d2c tests: devicetree: api: add tests for new DT APIs
Add tests for new DT APIs added in the previous commit:
- `DT_IRQN_BY_IDX`
- `DT_INST_IRQN_BY_IDX`

Added additional tests for the following existing DT APIs when
`CONFIG_MULTI_LEVEL_INTERRUPTS` is enabled:
- `DT_IRQN`
- `DT_INST_IRQN`

Added `qemu_riscv32` for the multi-level interrupt tests.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-10-30 11:43:39 -04:00
Yong Cong Sin
d7302f417e irq: relocate multi-level irq out of irq.h
Relocate multi-level interrupts APIs out of `irq.h` into
a new file named `irq_multilevel.h` to provide cleaner
separation between typical irq & multilevel ones.

Added preprocessor versions of `irq_to_level_x` as `IRQ_TO_Lx`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-10-30 11:43:39 -04:00
Bjarki Arge Andreasen
d8bb7c87cf drivers: gnss: Add parsing utils for NMEA0183
This commit adds utilites to parse the RMC and GGA
NMEA0183 messages, which contain all data which shall be
published using the struct gnss_data.

It also adds a test suite for the added utilities.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-10-30 11:43:19 -04:00
Bjarki Arge Andreasen
4cfea4a520 drivers: gnss: Add GNSS parsing utilities
This commit adds parsing utilites for common string
representations of values contained in GNSS messages.

These utilites both parse and validate the integrity of
the data.

Unit tests are also added to validate the parsing
utilities.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-10-30 11:43:19 -04:00
Krzysztof Chruściński
a33fff38ae tests: logging: log_benchmark: Fix integration platform
Userspace test was using native_posix which does not support
userspace. Change to qemu_x86.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-10-30 10:15:49 -04:00
Andrei Emeltchenko
c243991000 tests: work_queue: Change TC_PRINT to LOG_DBG
There are many TC_PRINT()'s in the work_queue test and it make sense
to change them to LOG_DBG() which are disabled by default. Other issue
is that some of TC_PRINT() are inside works for which execution time
is measured.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-10-30 09:29:25 -04:00
Benedikt Schmidt
aa25e212d1 tests: fix thread function signatures
Fix thread function signatures to avoid stack corruption on thread exit.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-10-30 12:24:34 +01:00
Alberto Escolar Piedras
e934e49aa9 tests bsim cis: Fix sim_id collision
This test was reusing the sim_id from an l2cap test,
which was colliding with the corresponding l2cap test
when they were run in parallel.
Fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-30 11:35:45 +01:00
Robert Lubos
08d1bb2c92 tests: net: checksum_offload: Cleanup and fixes for the test suite
When working on new test cases for checksum_offload test suite it turned
out that some existing test cases were already broken and not testing
what expected. This commit fixes the broken functionality:
  * Despite having two separate interfaces for offloaded and
    non-offloaded checksum scenario, all packets ended up in a single
    interface anyway due to src address matching. Therefore use
    different destination address, depending on tests.
  * Add separate semaphores for offloaded and non-offloaded case, to
    ensure that the packet ended up on the correct interface.
  * The packet loopback in RX cases was broken, the LL address, IP
    address and UDP port swap written data in wrong places.
  * The receive path was not tested in the offloaded case.

Additionally, do a small cleanup before adding more tests:
  * Fix net_context leak.
  * Configure IPv6 neighbor once, during setup.
  * Add before function to cleanup the flags before tests execute.
  * Split tests into separate test cases, as they're not really
    dependent on each other.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-10-30 09:26:19 +01:00
Alberto Escolar Piedras
b12785f86d tests/bsim/bt bis: Do not call into controller in split builds
Use the HCI layer to update the channel map instead of calling directly
into the controller.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/64441

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-30 09:26:06 +01:00
Andriy Gelman
d0961756a6 drivers: watchdog: Add xmc4xxx support
Adds watchdog support for Infineon xmc4xxx MCUs.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2023-10-27 12:58:07 -05:00
Tomasz Bursztyka
7b2cb95cd5 tests/x86: Reverting back to old logic
It was simpler, and it worked: it counted the cpu number correctly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2023-10-27 17:36:44 +01:00
Adam Mitchell
2f43b0b696 drivers: flash: Add RDP (readout protection) support for STM32G4x flash
Add support (and tests) for flash readout protection on the STM32G4x series
Signed-off-by: Adam Mitchell <adam.mitchell@brillpower.com>
2023-10-27 12:31:41 +02:00
Bjarki Arge Andreasen
a0b9d018b4 tests: rtc_api: Update y2k test to allow unknown values
Some RTCs don't support the tm_yday and/or tm_wday fields
of the struct rtc_time structure. These RTCs must set the
values of the fields to -1 if they are not supported, and
the test must be able to handle this correctly. This commit
adds an exception to the tm_yday and tm_wday fields allowing
them to be set to -1.

Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
2023-10-27 10:53:19 +02:00
Hake Huang
d05e274735 test: test_mcuboot: enable test on NXP MCUX platforms
NXP MCUX has no issue with #58080, so enable tests for NXP

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2023-10-27 10:51:05 +02:00