Check bt_addr_matches_irk() against the sample data for the random
address hash function ah in the Core Specification, Vol 3, Part H,
Appendix D.7, which fixes the byte order of both arguments. Check that a
different IRK, the IRK in reverse byte order, a modified hash or prand,
and addresses with a valid hash but the non-resolvable, reserved or
static address bits do not match.
Add a bluetooth.addr.no_smp scenario, an observer without SMP or
privacy, to cover the function's availability without them. The RPA
resolution tests need both, so they are built only with
CONFIG_BT_PRIVACY and CONFIG_BT_SMP.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Aric Radzin <aric.radzin@gmail.com>
On qemu_cortex_m3 the addr, bluetooth, hci_prop_evt, l2cap, smp and
uuid suites pass and then fault in the idle thread, which twister
reports as a failure. BT_HOST_CRYPTO pulls in psa_crypto_init() through
the Mbed TLS SYS_INIT hook, and without an entropy driver it seeds the
software HMAC_DRBG on the main thread, peaking at 1344 bytes. The
default 1024-byte main stack overflows into the idle thread's stack,
which is first used once the suite is done.
Use the 2048 bytes that the gatt and bt_crypto tests already set.
Tested with twister -T tests/bluetooth -p qemu_cortex_m3.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Add ZTEST suites for the two conversion APIs that use the prefix-based
LE address string format:
bt_addr_le_to_str
- PUBLIC produces the 'P:' prefix, RANDOM produces 'R:'
- PUBLIC_ID and RANDOM_ID are formatted by their base type
- HCI-level extended types (resolved-RPA bit) are formatted by their
base type
- Byte order is preserved (display is most-significant first while
a.val is stored on-air, little-endian)
- BT_ADDR_LE_STR_LEN is large enough for the longest output
- The UNRESOLVED and ANONYMOUS sentinels are formatted as random
bt_addr_le_from_str
- 'P:..' / 'R:..' parse to the expected type, with the prefix and
the hexadecimal digits accepted in either case
- An unknown prefix, a missing prefix, a missing ':' separator,
malformed addresses and truncated strings are rejected with -EINVAL
- Roundtrip to_str -> from_str preserves the address
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Add a ZTEST suite for the two internal helpers that translate the
address types found in HCI LE events:
- bt_addr_le_is_resolved() is true for the two identity types only,
and false for public, random and the anonymous and unresolved
sentinels
- bt_addr_le_copy_resolved() maps an identity type to its base type
and keeps the address bytes
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Raise the minimum required CMake version from 3.20.0 (documented as
3.20.5) to 3.28.0, which is satisfied by the CMake 3.28.3 package
shipped in the Ubuntu 24.04 LTS repositories. Ubuntu 24.04 is the
current Ubuntu LTS release targeted by the Zephyr getting started
guide, and by the time of the next Zephyr release, Ubuntu 22.04 will be
within months of its end of standard support. Users of distributions
shipping an older CMake can use the Kitware APT repository or a
pip-installed CMake, as the documentation already suggests.
Raising the floor to 3.28 unlocks a range of modern CMake features for
the build system, among which the cmake_file_api() command (3.27),
file(COPY_FILE) (3.21), block()/endblock() (3.25), and allows removal
of several version-conditional workarounds.
The tree-wide cmake_minimum_required() occurrences in samples, tests
and boards are updated accordingly, together with the documentation
and the sysbuild CMake presets. The IAR C-STAT integration keeps its
own higher requirement (4.1.0).
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Rename the test metadata file(s) in this area from testcase.yaml to
tests.yaml so sample and test metadata share one consistent filename
across the tree. Pure rename, no content change.
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Deprecate BT_CTLR, and add a new HAS_BT_CTLR as a virtual option which
specific users (like BT_LL_SW_SPLIT) select. This also means that we can
remove all places that were forcefully enabling the BT_CTLR option, and
instead we now depend on devicetree to get some local LL HCI driver
enabled which in turn also enables the HAS_BT_CTLR option.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
native_posix is now deprecated.
Building these tests in both native_sim and native_posix does not
improve coverage for the tests or subsystem but doubles CI time.
As anyhow native_posix will be removed all together in
2 releases, let's remove it already for these.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Convert all Bluetooth tests that define dummy HCI driver instances to use
the new HCI driver API. This requires both a custom DTS binding as well
as an app-specific overlay file.
Signed-off-by: Johan Hedberg <johan.hedberg@gmail.com>
For the 64 bit targets, change identifiers to the new hwmv2 ones.
And remove redundant overlays (which were equal for the 32
and 64 bit versions)
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Enable all remaining bluetooth tests for native_sim
and switch from native_posix to native_sim as default
test platform
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
integration_platforms help us control what get built/executed in CI and
for each PR submitted. They do not filter out platforms, instead they
just minimize the amount of builds/testing for a particular
tests/sample.
Tests still run on all supported platforms when not in integration mode.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>