Adding support for remaining CCP test cases.
Also removing callback descriptions from btp files not to get confused
with header files.
Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
Adds FIFO support to the latency_measure benchmark. This covers
both k_fifo_put() and k_fifo_get() with and without context switches
as well as variations for userspace support.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Adds LIFO support to the latency_measure benchmark test. This covers
both k_lifo_put() and k_lifo_get() with and without context switches
as well as variations for userspace support.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Changes the summary lines used in the latency_measure benchmark
so that they follow a consistent pattern.
OBJECT action.<brief details about action>
This makes it easier to locate results belonging to a particular
object group. It also has the benefit to keep results colocated
should the output be sorted by an external tool.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Moves the inclusion of the app_memdomain header file into the
tests' utils.h so that any file that includes this can make
use of the BENCH_BMEM macro.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Add functions to do XOR on arrays of memory, with one that
takes arbitrary sizes and one for 32 bits and 128 bits as
those are common sizes for this functionality.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
If an instant based remote procedure 'overtakes' a local ditto
the local procedure will be 'completed' by remote rejection
but collision flag would not get set ensuring that a new local
conflicting procedure cannot be started before the remote is completed.
This can thus lead to invalid local initiation.
Added unittest to cover case
Fix by ensuring collision flag is set also in the above mentioned
scenario.
Signed-off-by: Erik Brockhoff <erbr@oticon.com>
One of the tests closed the underlying TCP connection right after
establishing one. This caused a certain race between incoming TLS
handshake data and entering FIN1 state (experienced on nrF52840), where
the TLS handshake data could be received after the FIN1 state was
entered, causing the server side to send RST packet. This disrupted the
test flow, as graceful TCP connection teardown was expected.
Fix this, by adding a small delay for such case to avoid the race.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Much of tests/posix/common still overspecifies pthread_attr_t
options.
Default thread attributes are perfectly fine for the vast
majority of spawned threads in this testsuite, so simply use
a NULL pthread_attr_t* argument.
This fixes piles of bugs because we have not properly used
pthread_attr_destroy() appropriately.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Much of tests/posix/common still overspecifies pthread_attr_t
options.
Default thread attributes are perfectly fine for the vast
majority of spawned threads in this testsuite, so simply use
a NULL pthread_attr_t* argument.
This fixes piles of bugs because we have not properly used
pthread_attr_destroy() appropriately.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Much of tests/posix/common still overspecifies pthread_attr_t
options.
Default thread attributes are perfectly fine for the vast
majority of spawned threads in this testsuite, so simply use
a NULL pthread_attr_t* argument.
This fixes piles of bugs because we have not properly used
pthread_attr_destroy() appropriately.
This is only a partial cleanup for pthread.c
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Much of tests/posix/common still overspecifies pthread_attr_t
options.
Default thread attributes are perfectly fine for the vast
majority of spawned threads in this testsuite, so simply use
a NULL pthread_attr_t* argument.
This fixes piles of bugs because we have not properly used
pthread_attr_destroy() appropriately.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Much of tests/posix/common still overspecifies pthread_attr_t
options.
Default thread attributes are perfectly fine for the vast
majority of spawned threads in this testsuite, so simply use
a NULL pthread_attr_t* argument.
This fixes piles of bugs because we have not properly used
pthread_attr_destroy() appropriately.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Much of tests/posix/common still overspecifies pthread_attr_t
options.
Default thread attributes are perfectly fine for the vast
majority of spawned threads in this testsuite, so simply use
a NULL pthread_attr_t* argument.
This fixes piles of bugs because we have not properly used
pthread_attr_destroy() appropriately.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Check the return code of sys_csrand_get when testing the function.
Ignoring it is bad practice and can also be a security issue if users
copy-paste this test code.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Previously posix_apis.test_realtime was failing (very)
frequently in CI, and in particular, when running on Qemu,
POSIX, or SMP targets.
We are using CLOCK_REALTIME for this test, which incurs an
additional syscall overhead above CLOCK_MONOTONIC. The act
of sleeping itself also incurs a syscall overhead.
The latency from one iteration to the next of the internal
loop is a bit of a random process due to scheduler or clock
noise (although the noise itself is still bounded).
In order to make this test robust against such noise, assert
only on the average time from one iteration to the next,
rather than the instantaneous time.
Rather than calculating a sample mean, use a running average
(aka Cumulative Moving Average) to save some bytes.
Report results, including low and high watermarks before
asserting that the average iteration time within expected
range.
==============================================================
START - test_realtime
I: n: 20, sleep: 100, margin: 10, lo: 110, avg: 110, hi: 110
PASS - test_realtime in 2.198 seconds
==============================================================
Expect to see the low and high watermarks change more on
Qemu and POSIX platforms when running several jobs in parallel
with twister (such as in CI).
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Add tests for the following two macros
* ARRAY_FOR_EACH(array, idx_var)
* ARRAY_FOR_EACH_PTR(array, ptr_var)
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
We would drop the received packet if the source address is our
address so tweak the test and make source address different.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
We would drop the received packet if the source address is our
address so tweak the test and make source address different.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add after() function for the test suite, which does cleanup on still
open sockets. Otherwise, an individual test case failure affects all
other test cases, blurring the test suite results.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
As code is moved from test.inc to main.c a compliance check is
run for the first time on that code. Fixing warnings.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Rework test structure to handle C++ test in a better way. Similar
approach already applied in other tests which are executed for C
and C++. Getting rid of test.inc which due to non-standard extension
was not covered by complience check.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Implement level based gpio interrupts, by using a worker queue to
repeatedly call the gpio callbacks until the gpio is no longer active.
Update unit test for new interrupts.
Bug #66401
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Add a unittest for 100% of the lines in gpio_ite_it8xxx2_v2. The test
fakes the registers by overriding the ECREG macro to call a function
provided by the test.
Does not test the code guarded by
CONFIG_SOC_IT8XXX2_GPIO_GROUP_K_L_DEFAULT_PULL_DOWN
Bug #66401
Signed-off-by: Jeremy Bettis <jbettis@google.com>
There was some discussion about whether it was suitable to have
an architecture-specific workaround in mqueue.c after that
workaround was copied to a different source file in a PR.
The original issue was that newlib and picolibc declare mode_t
to be unsigned short instead of unsigned long when __svr4__
is not defined along with __sparc__. This is specifically
impactful, because va_arg() deals (mainly) with 32-bit and
64-bit values that are all naturally aligned to 4 bytes.
#if defined(__sparc__) && !defined(__sparc_v9__)
#ifdef __svr4__
typedef unsigned long __mode_t;
#else
typedef unsigned short __mode_t;
#endif
A uint16_t is naturally aligned to 2 bytes, so not only would
a 16-bit mode_t be corrupted, it would also generate a warning
with recent gcc versions which is promoted to error (rightfully
so) when run through CI.
mqueue.c:61:35: error: 'mode_t' {aka 'short unsigned int'} is
promoted to 'int' when passed through '...' [-Werror]
61 | mode = va_arg(va, mode_t);
Instead of using an architecture-specific workaround, simply
add a build assert that the size of mode_t is less than or
equal to the size of an int, and use an int to retrieve it
via va_arg().
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date: Fri Dec 29 10:06:44 2023 -0500
#
# On branch posix-mqueue-always-use-int-for-mode-t-va-arg
# Changes to be committed:
# modified: lib/posix/mqueue.c
# modified: tests/posix/common/testcase.yaml
#
Add test case for converting statically generated package which
contains RO and RW indexes. Converting shall append RW string
and discard RO index.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Remove the previously deprecated and non-standard macros
* PTHREAD_MUTEX_DEFINE()
* PTHREAD_COND_DEFINE()
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Add an option to enable a input_kbd_matrix_actual_key_mask_set API to
enable or disable keys dynamically in the mask. This can be useful if
the exact key mask is determined in runtime and the device is using a
single firmware for multiple matrix configurations.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
On newer GCC version warnings were emitted because of a `memcpy`. The
size parameter was larger than the source's size because it was using
the size of the destination, which was a `bt_uuid_128` when the source
is a `bt_uuid_16`.
Fix the issue by creating a new variable for CCC UUID in both the
central and peripheral code. The variable need to be static because the
discover parameters must remain valid until the start of the discover
attribute callback.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
In some cases, users want to allocate (comparatively) massive
thread stacks.
Add a test to ensure we can allocate such a stack by default.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Move various utilities out of lib into own folder for better assignement
and management in the maintainer file. lib/os has become another dumping
ground for everything and it the Kconfig and contents in that folder
became difficult to manage, configure and test.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Deprecate lwm2m_set_u64() and lwm2m_get_u64 as only
LWM2M_RES_TYPE_S64 exist. Unsigned variant is not defined.
Technically these might have worked OK, but it is undefined
what happens to large unsigned values when those are
converted to various payload formats (like CBOR) that might
decode numbers differently depending of their signedness.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Config the sram0 to be non-cachable to PASS the DMA testcases
chan_blen_transfer and loop_transfer
on the stm32f746zg and stm32f767zi nucleo boards.
The CONFIG_NOCACHE_MEMORY is useless as the memory region
gets the NOCACHE ATTRibutes for stm32H7 or stm32F7 as well.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
tag nano libc tests with nano so we can exclude them if needed. Now they
cause issues when collecting coverage information from tests.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
If we receive a packet from non localhost interface, then
drop it if either source or destination address is a localhost
address.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
* Use PTHREAD_STACK_MIN as provided by the specification
instead of a hard-coded value of 1024
* add extra stack size to semaphore tests
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Allow engine to give hints about ongoing CoAP transmissions.
This information can be used to control various power saving
modes for network interfaces. For example cellular networks might
support release assist indicator.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Due to unresolved bug (see #61129 for details) building TLS tests fails
on vmu_rt1170 platform. Therefore disable this platform for this test
suite.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
A first batch of tests for TLS sockets, covering expected socket
behaviors:
* Verify that blocking/non-blocking tx/rx work as expected
* Verify that timeouts on tx/rx are calculated properly
* Verify proper behaviors when interacting with a socket from
different threads (close/shutodown/send).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Move the code responsible for TLS connection establishment to a helper
function, as it'll be needed as well in other test cases.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
SO_TYPE and SO_PROTOCOL test cases does not really establish connection,
so teardown delay at the end is not needed.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The recommendation to have 20ms is fair for two
consecutive messages over a single bearer. When mesh
sends two messages it can be interpreted as two
bearers working in parallel. No need to keep
an artificial 20ms delay for that. Delay was
removed and all related bsim tests were fixed.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Some beacon tests have strict time conditions and depend
on randomization interval that doesn't guarantee test pass.
This change fixes strict conditions.
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
Implement the CAP Commander discovery function.
Adds support for it in the shell.
This includes initial babblesim and unit testing as well.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Reworked and combined the multi-level interrupt bit masks tests
to work on any configuration of bits in every level.
Updated the bits configuration in the testcase to use
non-symetric numbers so that shifting a level with the wrong
number of bits will certainly cause the test to fail.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
With MMU enabled on Xtensa, user_buffer is not marked as
executable. Invalidating the i-cache by region will cause
an instruction fetch prohibited exception. So skip all
i-cache tests, instead of just the range ones to avoid
confusions of only running the test partially.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add a device driver to read events from a Linux evdev device node and
inject them back as Zephyr input events.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit adds a devicetree overlay file and an extra condition in the
CMakeLists.txt file to allow remote debugging for the qemu_cortex_a9
board.
Signed-off-by: Marek Vedral <marek.vedral@gmail.com>
Adds test that verifies correct Proxy advertisement behavior for
a device where the Proxy adv requirements changes over time,
both for single and multiple subnets.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Refactors proxy advertising implementation to allow fair sharing of
advertising resources between all subnets.
In the new implementation, each subnet is agnostic to any other subnet
that might have active proxy advertisement work. When proxy
advertisement is triggered, the implementation will first check how
many subnets that has active work. If there are more than one active
subnet, a maximum timeslot will be calculated to ensure that all active
subnets get access to the medium. The implementation will then poll
the next eligible subnet for a proxy advertising request. If the
duration of this request exceeds the maximum timeslot, the duration
for the next advertisement will be set to the maximum value.
If a proxy advertisement for a subnet is interrupted by other
advertising activity, the implementation will now ensure that the
interrupted proxy adv continues from the point where it was
interrupted so that the subnet gets to utilize the entire allocated
timeslot.
This PR also alters the priv_proxy_net_id_multi Bsim test to align
with the refactored proxy advertising scheme.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
The section 3.7.3.1 of the mesh specification recommends to delay
a message publication in certain cases:
- at power-up or upon state change for a time between 20 to 500 ms
- for periodic publications for a time between 20 to 50 ms
This change implements this recommendation by adding the
`CONFIG_BT_MESH_DELAYABLE_PUBLICATION` Kconfig option which enables
the randomization code and by adding the `bt_mesh_model_pub.delayable`
bit field which allows each model decide whether the publications
should be delayed for this model or not.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Updates the app_kernel benchmark so that its default configuration
does not enable timeslicing. As it is still valuable to know what
kind of performance overhead is incurred by enabling timeslicing,
new test configurations have been added.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Updates the latency_measure benchmark so that its default
configuration does not enable timeslicing. As it is still
valuable to know what kind of performance overhead is
incurred by enabling timeslicing, new test configurations
have been added.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
As the pointer to the data buffer passed to k_pipe_put() is now a
'const', that buffer must be initialized before calling k_pipe_put()
to avoid a compiler warning.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Why?
- metadata is easier to manage as an array + index
- less error-prone -> less memory-management bugs
- we can. because of the previous refactor
- PDU allocations are more predictable
- ATT buffer size can be optimized by app
- isolates ATT from the rest of the ACL users
- decouples ATT PDU size from e.g. SMP w/ LESC
Drawbacks:
- higher memory usage
- kconfig change
The higher memory use is only temporary, as this will be followed-up
with more refactors that should bring it back down.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Generic Connector for the apollo4p_evb
Ran tests/drivers/gpio/gpio_basic_api
Ambiq does not support DUAL Edged Interrupts.
Added Connector Usages as defined by the Ambiq BSP.
Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
Add macros to initialize full set of descriptors required for USB Audio
Class 2 instance. Descriptors start with Interface Association
Descriptor that binds together the AudioControl interface and all
AudioStreaming interfaces.
AudioStreaming interfaces have alternate setting 0 without any endpoints
and alternate setting 1 with isochronous endpoint with max packet size
calculated on maximum sample frequency, number of channels, subslot size
and clock synchronization (asynchronous endpoints require +1 sample).
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Compare devicetree generated class specific descriptors for headset
example against reference hex values.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Fix build for nrf5340dk_nrf5340_cpuapp_ns.
Test takes up almost all of the flash, leaving no room for the image
to be signed. Disable the bootloader to free up flash-usage.
Fixes: #66469
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Updates the non-blocking semaphore and mutex benchmark sub-tests in
the latency_measure benchmark to remove the timestamp bias adjustment.
As the timestamps are not sampled during each iteration of those
sub-tests, there is no need to correct for any bias from the sampling.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Replace function parameter 'retries' with pointer to structure
holding coap transmission parameters. This allows setting the
retransmission parameters individually for each pending request.
Add coap transmission parameters to coap_pending structure.
Update migration guide and release notes.
Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
This test does not define any syscall. It does not need to set
CONFIG_APPLICATION_DEFINE_SYSCALL.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Replace combination of printk() to LOG_DBG() to fix the order of the
test execution logs. The printk() is printed immediately, while logs are
buffered, thus the messages from test are printed out before the stack
logs.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Add tests that check if device is ready or not, and
then verify the functionality of net_if_up() in that case.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Improve documentation about pytest integration with Twister. Add
examples of usage, improve description of available options and
introduce automatic doc generation of two plugin classes (DeviceAdapter
and Shell) basing on their docstrings from source code.
Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Since pthread_once() is both the initializer and executor of
pthread_once_t, it can have maximally two states. Since the
implementation in Zephyr previously aimed to maximize libc
compatibility, we opted to use the definition of pthread_once_t
from newlib, which is a structure with two ints.
It does not make sense to use 64 bits to manage 2 possible
states. The control for that should effectively be a bool.
We maintain compatibility with newlib by asserting (at build
time), that newlib's pthread_once_t is larger than Zephyr's
new struct pthread_once (which just contains a bool).
This allows us to delete the non-standard pthread_key.h
header file (finally).
Reuse the pthread_pool_lock in order to synchronize the related
init function (so that it is only called maximally once from any
thread). The spinlock is only used to test the state and the
init function is not called with the spinlock held.
The alternative was to use an atomic inside of
struct pthread_once. But again, that could be up to 64-bits with
Zephyr's atomics implementation.
Ideally we would use C11 generics or something to support atomics
on 8, 16, 32, and 64-bit primitives.
Lastly, also update declarations for C11 threads as they mostly
mirror our pthread implementation.
This needed to be done as a single commit in order to ensure
continuity of build.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
The LIS2DU12 is a linear 3-axis accelerometer with advanced digital
functions whose MEMS and ASIC have been expressly designed to build
an outstanding ultralow-power architecture in which the anti-aliasing
filter operates with a current consumption among the lowest in the
market.
This driver is based on stmemsc HAL i/f v2.3
https://www.st.com/en/datasheet/lis2du12.pdf
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Eliminates dma tests' dependency on CONFIG_NOCACHE_MEMORY=y for
configuring dma data linker sections. This allows optionally relocating
dma source and destination data to sram or other custom linker section
on boards that don't support dma access to flash.
Signed-off-by: Maureen Helm <maureen.helm@analog.com>
Renames "prov device" references and options to
"provisionee" to align implementation with Mesh
Protocol specification v1.1, section 5.4.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Add support for enabling the clock security system, which can detect
failures of the HSE clock.
Includes tests for nucleo_h743zi and nucleo_g474re.
Signed-off-by: Kevin ORourke <kevin.orourke@ferroamp.se>
Add test case for all drivers that are supporting the die temperature
feature, and fix right away all the yet undiscovered issues.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
This follows the idea to remove any z_ prefix. Since MMU has
a large number of these, separate out these changes into one
commit to ease review effort.
Since these are no longer have z_, these need proper doxygen
doc. So add them too.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This is supposed to stress the host buffer and metadata handling.
It is not really testing any particular thing, ie. the pass criteria is
just that each peripheral can send and receive a fixed number of GATT
notifications without any device crashing or locking up.
Original version by Ahmed Moheib (from cloud2ground).
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
How cache test could be ran without CONFIG_CACHE_MANAGEMENT?
Adding qemu_x86/x86_64 as cache related API in x86 has proven to be
very brittle against changes recently: no test was at least verifying
it builds properly, not to mention running it.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This adds the expect_bt_bap_stream_ops_released_called function that
takes an array of streams to verify as an argument. It's more versatile
approach than having expect_bt_bap_stream_ops_released_called_twice
erc. functions, that scales bad.
The function ignores the arhument list order, so that the user does not
have to predict the exact order of function calls.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This limits the default number of ASEs available to 1.
The value can be overwritten in test case specific parameters
in testcase.yaml file.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This removes duplicated CONFIG_BT_ISO_MAX_CHAN config setting and leaves
the default value set to 1.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This adds missing tests for invalid operations initiated by
locally or by client on ASE in Releasing state.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This removes 2 tests related to ASCS handling ACL disconnection.
c3c83c7049 modified the ACL disconection
behavior, so that ASE goes directly to idle state, not waiting in
releasing state for CIS disconnection. Thus the tests where state
machine waits for CIS disconnection can be removed now.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Zephyr by default renews the characteristic value subscription on every
reconnection. If the ACL is disconnected in the middle of this
procedure, all the subscriptions waiting to be renewed are removed, even
if the device was successfully subscribed already.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This changes the way the GATT Client subscribes to the characteristic
value changes. The bt_gatt_write usage was replaced by dedicated
bt_gatt_subscribe API function call, so that the test verifies the GATT
Client API side as well.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Rename the native Linux SocketCAN driver to reflect that it can can now be
used in both native_posix and native_sim (with or without an embedded
C-library).
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Additional test to check if getting a device while there
is a pending async put does not trigger unnecessary device
state changes.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Add a delay parameter to asynchronous device runtim put. This allows
to delay the put operation what is useful to avoid multiple states
transitions.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Add new functions to the public CoAP API to configure CoAP packet
retransmission settings. Application may need to re-configure the
settings for example when cellular modem changes connection from
LTE-M to NB-IoT or vice versa.
Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
Add BSIM testing of GMAP, with all spec-specified audio
configuration combinations added and tested.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add the GMAP shell module with support for running the
various audio configurations in an easy way.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Verify that TCP keep alive options can be set properly and that TCP
connections time out correctly when keep-alive probes fail to get
replies.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
With TF-M enabled the storage_partition can be used as memory that is
known to be configured as non-secure flash region.
The slot1_ns_partition partition is only correct when TF-M is built
with BL2 enabled.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This fixes missing connection reference release.
The bt_conn_le_create returns the connection object reference that needs
to be released by API caller.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Added possibility for link 2 modem mock instance for
validating P2P communication without any data stubbing.
Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
Updated the tests to use info from the devicetree or Kconfig as
ground truth and compare that with the output from the
functions under test.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Assert that the `local_irq` of each levels should only ranges
from `0` to `CONFIG_MAX_IRQ_PER_AGGREGATOR`, so that it doesn't
overflow the other aggregators.
Also, assert that the output of `z_get_sw_isr_table_idx` shouldn't
overflow the ISR table.
Update the `sw_isr_table` tests to test the range of
`CONFIG_MAX_IRQ_PER_AGGREGATOR` instead of the entire range of
level bits.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Split the `sw_isr_irq_parent_table` test into one that tests
the IRQ table index function which is generic and should
always be tested, and one that tests multi-instance -related
functions which only work in interrupt controller drivers that
has multi-instance implementation.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Modify the VCP volume controller callbacks to support
multiple registers by making it into a linked list.
This allow for multiple applications to get the information
from procedures or notifications.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Enable code coverage for debug.coredump.drivers.api.* test suite
adding custom fatal error handler to dump code coverage data
when the test halts as expected.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Add const prefix for service uuid and char uuid.
Since Service UUID and Char UUID should not change in the service
definition, they are most reasonably defined as rodata, also for
save some ram footprint.
The field `attr->user_data` type is `void *`, as this PR change
all Service UUID to rodata, so there must add (void *) to avoid warning.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
The CAP Initiator and the CAP Commendar share quite a lot of
functionality in terms of discovery and performing set-based
procedures.
The code for handling most of this has been moved to
cap_common.c to avoid duplicating code.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Updates both the app_kernel and latency_measure testcase scripts
to include a scenario involving object core statistics. This can
then be used to estimate the performance cost of using this feature
post-execution by comparing its results to the scenario where it is
not enabled.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
The default ztest stack size was too small to run new UDP tests on
certain platforms (nrf52840 in this particular case), therefore increase
teh stack size in prj.conf.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Replace combination of printk() to LOG_DBG() to fix the order of the
test execution logs. The printk() is printed immediately, while logs are
buffered, thus the messages from test are printed out before the stack
logs.
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This adds the function that sets the available contexts value per
connection object so that API user can set different available contexts
per connection.
The lifetime of such overriden value is the same as connection lifetime,
so on reconnection or device reboot all devices return to having the
same available contexts value again.
Fixes: #64968
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This verifies the zephyr host can tolerate a spec violating peer sending
ATT requests without waiting for responses.
It also tests the opposite, that is that the Zephyr host does not
pipeline requests over the air.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Adding support for one missing MCP testcase - verifying characteristic
handles during service discovery.
Signed-off-by: Piotr Narajowski <piotr.narajowski@codecoup.pl>
When the test runs with code coverage, make sure the coverage dump
completes its output under pytest execution before the test debug
session ends in both cases: for Zephyr gdbstub feature and for
Qemu internal GDB stub.
Add few more test operations with breakpoints.
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
This removes the fixed size bt_bap_base, which provides
2 improvements:
1) The RAM usage of the broadcast sink has been reduced.
For the Broadcast Sink sample it is a reduction of 120
octets, but with much better scaling for supporting
more or larger BASEs.
2) The functions to parse BASEs now support arbitrary sized
BASEs, where they were previously restricted by our
local Kconfig options. This allow us to parse any BASE
from a remote device, without encounting memory issues.
We are still memory restricted on the devices we
actually want to sync to.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This option (CONFIG_HEAP_MEM_POOL_SIZE) is not used for the tests.
Moreover it overrides the option, specified in the board's Kconfigs.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add an optional actual-key-mask property to filter out key combinations
that are not implemented in the actual keyboard matrix.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Test claiming a device multiple times before releasing it, and validate
that the power domain returns to off.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
In fallback refactoring to the LwM2M engine, some changes
to the server object are visible in hard-coded test
values.
Also, add Endpoint wrapper class that ensures the registration
state of the returned endpoint.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
If server registration fails, allow fallback to secondary server,
or fallback to bootstrap.
Also allow fallback to different bootstrap server.
Add API to tell RD client when server have been disabled by
executable command.
Changes to RD state machine:
* All retry logic should be handled in NETWORK_ERROR state.
* New state SERVER_DISABLED.
* Internally disable servers that reject registration
* Temporary disable server on network error.
* Clean up all "disable timers" on start.
* Select server first, then find security object for it.
* State functions return void, error handling is done using states.
* DISCONNECT event will only come when client is requested to stop.
* NETWORK_ERROR will stop engine. This is generic error for all kinds
of registration or network failures.
* BOOTSTRAP_REG_FAILURE also stops engine. This is fatal, and we cannot
recover.
Refactoring:
* Server selection logic is inside server object.
* sm_handle_timeout_state() does not require msg parameter. Unused.
* When bootstrap fail, we should NOT back off to registration.
This is a fatal error, and it stops the engine and informs application.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Test consistently fails with timeout for board `hifive1`, so exclude
this board until fixed.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
This board have an NXP MPU with 8 configurable regions, of which five
of them are already used by the static MPU configuration. Many of
these tests are failing due to lack of MPU regions or free partition
slots available, even when HW stack protection is disabled when
building with userspace support.
Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
This enables the sqrt() and sqrtf() tests also in case of soft-float
configurations. It is expected that the tests will link, run and pass
also in such configuration.
Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
The lib was refactored, but CI didn't run the tests that used it for
some reason.
A parameter was forgotten.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
This patch just adds some comments and asserts to clarify the testlibs
att read code.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
This reformats some code on main branch that was not clang formated. The
syntax is changed from initializer list to multiple statements because
there is a conflict in formating requirements between clang format and
checkpatch.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
When testing k_busy_wait(100), don't require that at least 100µs of CPU
time be consumed by the thread itself; some of that time may be used
elsewhere in the system. Instead, just make sure that at least 80µs is
accounted to the thread and allow 20µs to get used elsewhere.
Signed-off-by: Keith Packard <keithp@keithp.com>
MIN() has been defined in sys/util.h for a long time. It doesn't
make sense to separately define a lowercase version.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
The driver has some non trivial macro setup, add another two test cases
so those gets build tested as well.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Implements sync established and sync lost BTP events.
This was affecting GAP/PADV/PASE/BV-01-C test case.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This allows for more tuning regarding Periodic Advertising Sync
behavior.
Required by GAP/PADV/PASE/BV-01-C qualification test case.
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Add a testsuite to demonstrate proper functionality of blocking
in the log processing thread.
This serves to demonstrate the previous bugfix, to provide
missing test coverage for the option, and also to document what
pitfalls to avoid when blocking in the log processing thread.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Make sure that statistics is properly update for dropped
packets when IPv4 TTL is 0 or IPv6 hop limit is 0.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Adapts the `pb_remote_timeout` test to the updated `bt_mesh_suspend`
API.
Suspension is scheduled with a small delay to allow publications to be
sent before suspending Mesh.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Adds two test-cases; one for suspending and resuming Mesh,
and one for suspending Mesh and disabling Bluetooth before
re-enabling Bluetooth and resuming Mesh.
Both tests checks that periodic publication is stopped during
suspension.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
- Removed preset initializations. Done in auto-pts client.
- Added one additional preset in overlay-le-audio.conf.
Signed-off-by: Henrik Eriksen <heri@demant.com>
A warning is printed in start of the test about this.
Increase CONFIG_NET_IF_MAX_IPV6_COUNT=2 and
CONFIG_NET_IF_MAX_IPV4_COUNT=2 so that the tests pass
in frdm_k64f and some other boards.
Fixes#66020
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add support for testing the `dma_emul` driver which simply uses
software emulation (i.e. asynchronous memcpy in a workqueue) for
performing DMA operations.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
These were first deprecated in v3.2. We have kept support for them
for as long as we can, but now their presence is causing CI failures
in some configurations. Specifically, using the deprecated 'label'
property is causing a warning which is promoted to an error in some
twister runs. This is blocking other forward progress in the
devicetree API.
I tried to rework the tests to avoid this, but it was too much effort
for the time I had to work on the task. Removing the APIs is therefore
unfortunately the best way forward to unblocking other work.
Re-work the test suite a bit to maintain coverage where we are using
the label property to test other macros.
Add a migration guide section to help with the transition.
Signed-off-by: Martí Bolívar <mbolivar@amperecomputing.com>
The LPS28DFW is an ultracompact, piezoresistive, absolute pressure sensor.
Compared to the LPS22DF, the LPS28DFW is waterproof and has a Dual FS
capability and does not have SPI. This commit extends the LPS22DF driver to
be compatible with the LPS28DFW device.
Signed-off-by: Jonas Remmert <j.remmert@phytec.de>
When using the LLEXT buffer loader we now avoid copying extensions
from storage to allocated memory by pointing directly into the stored
image. We then also perform linking and relocation in that memory,
which modifies its contents. However, this is impossible if that
storage is read-only. Add a Kconfig flag to distinguish between
writable and read-only storage types. Also use that flag to decide,
whether the extension image in test_llext_simple.c should be defined
as const or not.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Extensions should be able to selectively export their global symbols.
Add a LL_EXTENSION_SYMBOL() macro for that. Change the present
.sym_tab to be a temporary symbol table of all global symbols in an
extensions, used only during linking for internal purposes. Add a new
.exp_tab symbol table to store symbols, exported by an extension
permanently.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Extend the llext_load() / llext_unload() API to let it be called
repeatedly for the same extension to increment or decrement its
reference counter respectively. We use a mutex to protect the counter
and make both llext_load() and llext_unload() return the use-count to
let the caller identify when the first loading and the last unloading
took place.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Some applications can decide to link their loadable objects for
exactly the same addresses, where they will be loaded. In those cases
local relocations aren't needed any more and can in fact break the
object if applied while the object is in a temporary storage. Add a
parameter to skip such local relocations.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
A race condition for the test occurs as the service might have started
when booting.
Do not autostart the service to verify the port stays 0.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Add extra checks that make sure that msg_iov is set
as we cannot receive anything if receive buffers are
not set.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
SIG has changed Bluetooth mesh to Bluetooth Mesh
Updating zephyr docs accordingly
Leaving out old release notes
Signed-off-by: Mia Koen <mia.koen@nordicsemi.no>
Add a library to the Nanopb test to demonstrate building with a
dependency on the generated header files.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Even though the ASCS Sink ASE state machine does not enter the disabling
state according to ASCS spec, it still makes sense to do so.
the state transition unit tests are updated to verify calling or not
calling the disable callback, depending on the transition of the state
fixes#63230
Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
There is no need of repeating the same entries in a scope
that is supposed to extend another one.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Swith integration_platforms from native_posix(_64)
to native_sim(_64).
And replace it also in a comment.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>