Right now the thread test case does not handle when the test fails, the
test will be aborted by ztest in one of the spawned threads, and cause
desynchronization which messes up the rest of the test. Fix by
synchronizing in the case of fails and return fail from main test thread
instead of the spawned ones.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
The test that checks latency also prints a measurement of the latency
which is just a visual information for the test output. However, this
print uses a subtraction which can have an overflow in the case where
the kernel timer is behind, so just clamp to 0 in that case where there
is an overflow. This change does not affect the test pass/fail logic.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Fixes tests/boot/with_mcumgr in case, when imgtool is
not installed. Added imgtool path to west sign wrapper.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
During testing and code inspection, there were various anti-patterns
on this (and U-Blox driver) codebase(s), including obfuscation, and
lack of data validation. This made it increasingly difficult to
introduce further variants of u-blox GNSS modems.
With this patch, both the UBX modem and the M8 driver have been
refactored to ease the reliability and maintainability of these
codebases. Here are some highlights:
WRT UBX modem:
- Helper macros to easily create UBX frames, (including checksum
calculation), at compile time; thus, making it easier to extend UBX
commands.
- Logic validation by the inclusion of the modem_ubx testsuite, used to
refactor the code through TDD.
- Ability to receive unsolicited messages, in order to enable U-Blox
drivers to rely on modem_ubx to transceive all commands, and avoid
hopping between modem_ubx and modem_chat.
WRT M8 driver:
- Remove GNSS specific protocol header files. Instead, unify them under
modem/ubx/protocol.h. Background: After a survey and looking at ubxlib
SDK I conclude the UBX protocol is by definition a GNSS protocol (there
are non-GNSS u-blox modems, but they're not interfaced through UBX
protocol).
- Establish pattern to create and send/receive commands using new
foundations on modem ubx.
- Remove dependency of Modem chat, and instead use UBX unsolicited
messages to get Navigation and Satellites data.
- Switch from the auto-baudrate detection pattern to a pattern of
transitioning between an initial known baudrate to a desired baudrate,
in order to improve initialization time.
- Add dts property to configure default fix-rate.
Signed-off-by: Luis Ubieda <luisf@croxel.com>
Reduce the number of config overrides needed for the various testcases
by only enabling the options if needed in the first place.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Add the ability to block and process a work queue by invoking
`k_work_queue_run` from an existing thread. This can be particularly useful
for using the main thread to process work items, in the same vein as the
system work queue, but from a lower priority/preemptible thread.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Co-authored-by: Peter Johanson <peter@peterjohanson.com>
Add new Kconfig options to enable platform-specific features in
OpenThread:
- CONFIG_OPENTHREAD_PLATFORM_PKT_TXTIME enables support for packet TX
time when CONFIG_NET_PKT_TXTIME is selected.
- CONFIG_OPENTHREAD_PLATFORM_CARRIER_FUNCTIONS enables modulated and
continuous carrier functions when CONFIG_OPENTHREAD_DIAG and
CONFIG_IEEE802154_CARRIER_FUNCTIONS are enabled.
Update preprocessor conditionals to use the new options instead of
relying directly on CONFIG_NET_PKT_TXTIME and
CONFIG_IEEE802154_CARRIER_FUNCTIONS.
This change improves configurability and allows to reuse the platform
implementation when not using Zephyr networking.
Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
Frame rate selected by the user may not be obtained due to
PCLK frequency and finite number of clock divider values.
In such case, driver shall select divider that results in
frame clock rate closest to the requested value.
There was a bug that was discarding perfect match divider.
Add test which confirms correct clock divider selection.
Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
IUT works as a Bluetooth GAP Client. The peer device (tester) is
configured to respond to inquiries and process connection requests.
Add tests to verify GAP client functionality for inquiry, connection,
and disconnection scenarios.
In the test suite, there are six test cases:
Case 1: General Inquiry followed by Connection and Active Disconnection.
Verifies that DUT can perform general inquiry, establish connection, and
actively disconnect from tester.
Case 2: General Inquiry followed by Connection and Passive
Disconnection. Verifies that DUT can perform general inquiry, establish
connection, and handle disconnection initiated by tester.
Case 3: General Inquiry followed by Rejected Connection Request.
Verifies that DUT can perform general inquiry and handle connection
rejection from tester.
Case 4: Limited Inquiry followed by Connection and Active Disconnection.
Verifies that DUT can perform limited inquiry, establish connection, and
actively disconnect from tester.
Case 5: Limited Inquiry followed by Connection and Passive
Disconnection. Verifies that DUT can perform limited inquiry, establish
connection, and handle disconnection initiated by tester.
Case 6: Limited Inquiry followed by Rejected Connection Request.
Verifies that DUT can perform limited inquiry and handle connection
rejection from tester.
Signed-off-by: Jiawei Yang <jiawei.yang_1@nxp.com>
IUT works as a GAP Server (Peripheral) in the Bluetooth system. The peer
device, GAP Client,
is a PC running Bumble as a test tool.
This test suite implements the following test cases:
Case 1, Non-connectable Mode Testing. Verifies DUT can operate in
non-connectable mode without allowing connections.
Case 2, Connectable Non-discoverable Mode with Active Disconnection.
Verifies DUT can accept connections and initiate disconnection.
Case 3, Connectable Non-discoverable Mode with Passive Disconnection.
Verifies DUT can accept connections and handle passive disconnection.
Case 4, Connectable Non-discoverable Mode with Connection Rejection.
Verifies DUT can reject connection requests.
Case 5, Limited Discoverable Mode with Active Disconnection. Verifies
DUT in limited discoverable mode can be discovered, accept connections
and initiate disconnection.
Case 6, Limited Discoverable Mode with Passive Disconnection. Verifies
DUT can be discovered, accept connections and handle passive
disconnection.
Case 7, Limited Discoverable Mode with Connection Rejection. Verifies
DUT can be discovered but reject connection requests.
Case 8, General Discoverable Mode with Active Disconnection. Verifies
DUT in general discoverable mode can be discovered, accept connections
and initiate disconnection.
Case 9, General Discoverable Mode with Passive Disconnection. Verifies
DUT can be discovered, accept connections and handle passive
disconnection.
Case 10, General Discoverable Mode with Connection Rejection. Verifies
DUT can be discovered but reject connection requests.
Signed-off-by: Jiawei Yang <jiawei.yang_1@nxp.com>
When CONFIG_ZTEST_ASSERT_VERBOS is 0, syst_headers_name[] is
not exactly being used by zassert_mem_equal(). Mark it as
__maybe_unused to avoid compiler warnings.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
When CONFIG_ZTEST_ASSERT_VERBOSE is 0, the array round_s is not
being used by zassert_true(). So mark it __maybe_unused to
avoid compiler warnings.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The commit modifies the Flash Map test, providing Kconfigs that
allow to opt out from testing disabled partitions and testing
DTS node access.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The combination of
323126924474c9e7afab
broke this test, when __SIZEOF_DOUBLE__ != 8.
In that case the test will fail to build,
as the variables the code uses are left ifdef'ed out.
Let's fix it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
some current sense amplifiers have a non zero offset voltage
that correlates to zero current. adding this offset voltage binding
allows the driver to be used with this type of circuitry.
Signed-off-by: Brandon Allen <brandon.allen@exacttechnology.com>
This commit enables power_mgmt_soc test for MAX32655 boards
- max32655evkit
- max32655fthr
RTC clocked in most low power modes so that this timer
is linked with idle timer. By this way device able to wakeup
from low power modes.
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
This commit enables power_mgmt_soc test for MAX32690 board
Low power timer is used as idle timer that will wakeup device
from sleep modes. Lowpower timer clocked with RTC clock which
always on.
RTC can be used as idle clock timer too, in that case below
line need to be added in overlay file
/ {
chosen {
zephyr,cortex-m-idle-timer = &rtc;
};
};
&rtc {
status = okay;
wakeup-source;
};
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
This commit adds a driver for the BH1790 Heart Rate Monitor IC.
Based on the approach used by the MAX30101 driver, an existing optical
heart rate sensor with a sample in Zephyr.
Signed-off-by: Magpie Embedded <magpieembedded@gmail.com>
Some ITS store module implementations may make use of them.
This is the case of the custom one in the
secure_storage.psa.its.secure_storage.custom.store test.
Instead of making transform.h conditionally available, move the definitions
to common.h and simply make them available whenever the ITS transform
module is enabled.
At the same time, remove unneeded/redundant includes/build asserts.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
The bt_csip_set_member_register kept a counter that was not
decreased when bt_csip_set_member_unregister was called.
This meant that we could register and unregister CSIS,
but we could not re-register once it had been unregistered.
This commit fixes this by removing the counter and instead
rely on the service instance state, which also requires restoring
the original service definition, as well as adding a test that would
have failed with the previous version.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Async now uses its own work queue, which means it consumes more
resources. Since not all applications need the async API, we can make
it optional without any penalty for those applications.
Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
Device runtime is using the system workqueue to do operations
that are mostly blockers (suspend a device). This should not happen.
This commit adds an option to use dedicated queue for the device runtime
async operations.
The test for this API was assuming that the system workqueue
priority (which is cooperative) so we need to change the test priority
to be lower than the device runtime workqueue priority.
Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
This commit splits the CAP and GMAP audio configuration (AC)
tests into separate scripts. The purpose of this is to reduce
the runtime of the individual scripts (some, like the cap_ac_11,
tests takes a long time to run all combinations).
This split also improves support for running them in parallel.
An additional, positive, side effect of this is that the logs will
also be smaller per run.
The new scripts can be run directly, or via the e.g. _cap_ac_X.sh
scripts that run entire audio configuration for all presets.
The design of how the parameters are passed around, are based
on variable instead of function arguments. Effectively they can
be used for the same thing, but variables have the advantage
that it is easier to deal with longer names,
and that any of the test scripts can be called with additional
arguments that can, when using variables, easily be forwarded
to the call to Execute for the PHY in the
_ac_common.sh.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix issues reported by string validation which was added to strings
used in zassert macros.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This test only works for 64-bit values. On targets which use 32 bits for
double, skip this version. The float test will check the 32-bit math for
that.
This is the 'nicer' version of this fix which uses sizeof rather than
relying on __SIZEOF_DOUBLE__.
Signed-off-by: Keith Packard <keithp@keithp.com>
The spi_loopback_transceive() helper currently only prints a
message if a configuration is invalid, continuing the test
case as if it succeeded. This results in the test case using the
helper trying to validate the result from a spi transaction that
was skipped.
Fix this by explicitly skipping the test using the ztest
framework's ztest_test_skip() function, which skips the entire
test case.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
With e337b7b65d, the test started to
fail with stack overflows in the no_optimizations scenario, so give
the ztest thread a little more space.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
As TinyCrypt gets deprecated, we need to remove all bsim tests that use
it. This commit switches all Bluetooth mesh bsim tests to PSA as a
default crypto backend.
This includes:
- removing `CONFIG_BT_MESH_USES_TINYCRYPT` as PSA is default crypto
backend for mesh. `CONFIG_BT_MESH_USES_MBEDTLS_PSA` is not required to
be enabled;
- merging `overlay_psa.conf` into `prj.conf` as this configuration
becomes default for all mesh bsim tests;
- merging `overlay_ss.conf` into `overlay_pst.conf` as secure storage is
required for running persistent storage bsim tests with PSA;
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This is a preparation commit for switching all bsim tests to PSA as
TinyCrypt will be removed soon.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Allow ESP32 devices to test the scenario where
when alarm should not be triggered after being cancelled.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
As part of counter API updates, RTC timer will be removed from
counter API driver and can be removed from the test list.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Enable support of SECURE LCS stage. In this stage, the protection
state is set to “secure”. A secured device will boot only when the
authentication of its flash boot and application code succeeds
Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
These two tests are validating that deprecated APIs still work
correctly. Which means they will definitely generate compile warnings.
To disable -Werror while letting it be enabled for other tests, create a
new Kconfig variable, DEPRECATION_TEST and make
COMPILER_WARNINGS_AS_ERRORS depend on that option being unselected. Add
this option to the two tests so that the resulting configuration
disables -Werror.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This test only works for 64-bit values. On targets which use 32 bits for
double, skip this version. The float test will check the 32-bit math for
that.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>