CONFIG_BT_USE_PSA_API was used in BT crypto/host modules to select
PSA crypto API over TinyCrypt (which was the default until now).
Since TinyCrypt is being deprecated and PSA crypto API is the new
standard library for crypto operations, CONFIG_BT_USE_PSA_API is
no more needed.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
The main problem of MBEDTLS_PSA_CRYPTO_LEGACY_RNG is that it
brings in some legacy modules (entropy + ctr_drbg/hmac_drbg)
which means extra ROM/RAM footprint.
MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG instead simply calls to the
CSPRNG which makes it definitely smaller.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Increase the EXECUTION_TIMEOUT (real time timeout at which the test
will be killed), so we have more margin for CI.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The host-based adv auto-resume function has both a problematic
implementation and disagreement in the community around how it should
behave. See the issue linked resolved below for details.
This patch makes the deprecation visible to the user. The user will be
better served by a auto-resume tailored their applications use case,
based on more primitive host API like `conn_cb.recycled`, which has
obvious behavior that is unlikely to change.
Resolves: https://github.com/zephyrproject-rtos/zephyr/issues/72567
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Let's run tests with security/privacy with the HW models acutually
running the encryption, so in case of missaligned keys
tests fail.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Some tests have a compile script for that test alone, named
`_compile.sh` or `_build.sh`. These scripts are useful for developers to
avoid compiling the world. But these scripts were not run in the CI.
These scripts were previously not suitable for running in the CI because
would put the artefact in the source directory, but this is no longer
the case, and the CI could run these scripts now.
This commit renames any `<test>/test_scripts/_compile.sh` and
`<test>/test_scripts/_build.sh` to `<test>/compile.sh`. The test runner
in CI will ignores any file named `compile.sh`, so there is no need for
a underscore prefix.
This fits into and extends the hierarchical structure of `compile.sh`
chain that starts at `:/test/bsim/compile.sh`, the CI build script tree.
The newly moved scripts now become a part of the build script tree,
called from a `compile.sh` where a duplicate set of build commands was
before. The sub scripts use `run_in_background` to preserve the
parallelism as it was before this change.
This removes an error-prone duplication and makes the CI test all the
build scripts.
Tests that did not have any compile script are not given one for now.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
find_package() already deals with finding ZEPHYR_BASE, so do not rely on
it being set in ENV, use the variable directly adter find_package() was
called.
Fixes#75387
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add a couple PSA overlay configs for the BT tests in order to evaluate
PSA API support introduced by CONFIG_BT_USE_PSA_API. These test are
performed on nrf52840dk platform.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
When using the post_init_f to initialize the `bst_result`,
it is not possible to mark the test as
passed immediately as the `bst_result` will be
initialized after the test completes.
This change should overcome this limitation.
Bluetooth mesh tests are kept as is as we are not
sure if this will change the behavior.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
This was the source of assert failures.
If only they were enabled in the first place...
The issue is that in order to save on build time, these two tests build
only one image, from which two devices are
instantiated (`gatt_client_test.c` and `gatt_server_test.c`).
The double-registration happens as `BT_CONN_CB_DEFINE()` is build-time, and
is included in two files of the same image. Then _both_ images will end up
with both `connected()` `disconnected()` etc callbacks, which have logic
specific to their respective images/devices.
The patch uses runtime registration instead so each device only ever
registers its own callbacks and not the other device's too.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
This patch removes all uses of the adv auto-resume feature in the host
bsim tests, except for the test of that feature itself, and instead
makes all adv starts explicit.
The auto-resume feature is planned for deprecation. And, explicit
starting of adv makes what happens in the test more explicit as well.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
The advertiser options to automatically add the name in the scan
response and the advertising data will be deprecated.
Update the tests that were relying on those options. A lot of test were
actually not using the name, for those the name have simply been
removed. For the others that were using the name, add it in the
advertising data or the scan response data.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
The commit adds dependency on Kconfig FLASH_PAGE_LAYOUT to subsystems
that really require it:
FCB, NVS, LittleFS
and removes direct selection from '*.conf' files where no longer
needed.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Remove explicit timeouts which are either the same as the
default one or smaller.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Remove the boilerplate which is not necessary beacuse
it is already provided by the common scripts
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
In all scripts, where we were using the BOARD variable
let's use BOARD_TS which is the full BOARD target string
with "/" replaced with "_"
This is neccessary to support hwmv2 board names
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Ensure we call the common source script before using
the BOARD variable, and let's not set things
which are already set to the same by default
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
There are quite many BT host test images being built.
Today these are all built in parallel, causing a quite
high load.
Let's split them in their separate sub-scripts,
so we don't parallelize too many builds,
and users have more granularity if they only
want to build a subset.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add tests for the GATT permissions to read and write for
characteristics that require encryption and LESC encryption.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The test where it was supposed to read the long characteristic,
only read the "small" characteristic, due to setting the wrong handle.
With the right handle, the test failed and the test had to be
updated to store the data across multiple reads, and then do
the proper comparison.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Removed the "operation" infix from the bt_gatt_authorization_cb
callback structure in the Bluetooth GATT header.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Improved the connection reference handling in the BabbleSim test
project in the Bluetooth Host category.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Added a new BabbleSim test that validates the authorization callback API
from the Bluetooth GATT header.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
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>
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>
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>
Test that SC Indication is correctly sent when the client reconnect and
the server updated the GATT database since last connection. Test that
the indication is sent even if the bond is not restored.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Remove unused code in `host/gatt/settings` test. The conditional block
could never be reached because the type of the discovery parameter is
`BT_GATT_DISCOVER_CHARACTERISTIC`.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Since 3a197934fc
main() should be int main(void) instead of void main(void)
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
In order to have clean, self-contained HCI headers that do not have any
dependencies towards the Host or any other part of the system (except
types), reorganize the headers in the following way:
- Split out the macros and structs from hci.h to a new hci_types.h
- Merge the existing hci_err.h into the new hci_types.h
Fixes#58214.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Remove usage of Kconfig symbol `CONFIG_BT_DEBUG_LOG` from tests. It has
been deprecated since this PR:
https://github.com/zephyrproject-rtos/zephyr/pull/56183
The Kconfig symbols has been replaced by `CONFIG_LOG=y` on most of the
cases. Or it has been removed when not needed anymore.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
Update `ccc_store` bsim test to remove the 'expected failure'. The issue
being fixed in the following commit.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
The first test check that if a bonded peer subscribe to a CCC, this
change is correctly stored to flash.
The second test, which is currently failing, is included to reproduce a
bug that occur when CCC or CF store on write is disabled and the other
one is enabled, leading to the delayed store being enabled. Causing the
value of the corresponding `n` selected option to not be stored at all.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
These variables are now provided by the FindBabbleSim
cmake module, which finds them in the environment or thru
west.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Let the board check for it instead, as it now does it
smarter and can try to find it using west if it was
fetched with the Zephyr manifest.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
These changes were automated using coccinelle with the following
script:
@@
@@
- void
+ int
main(...) {
...
- return;
+ return 0;
...
}
Signed-off-by: Keith Packard <keithp@keithp.com>
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.
Most of these changes were automated using coccinelle with the following
script:
@@
@@
- void
+ int
main(...) {
...
- return;
+ return 0;
...
}
Approximately 40 files had to be edited by hand as coccinelle was unable to
fix them.
Signed-off-by: Keith Packard <keithp@keithp.com>
Move common parts to common scripts,
and clean up some unnecessary content.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Bsim won't be limited anymore to BT tests.
In preparation for adding more tests in network areas
swap the tests/bluetooth/bsim with tests/bsim/bluetooth
There is no other changes in this commit beyond that.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>