Skip to content

Commit 2a89430

Browse files
committed
tests: bluetooth: mesh: remove tinycrypt support from bsim mesh
Commit removes Tinycrypt support from bsim mesh tests as well as optimizes test suite number and features. Several tests were added only for Tinycrypt library and were never run with PSA Crypto. Especially these are tests related to advertiser or suspending functionality. Mesh has two advertiser implementations. Some legacy advertiser functionality was NEVER run in combination with PSA. Furthermore, the low latency feature of the legacy advertiser has been added a long time ago to suitable test suites like transport and friendship data transmission. Later when another tests were added those required legacy advertiser checking the low latency overlay has been used instead of adding pure legacy advertiser. That caused a situation where actually the low latency advertiser has never been tested without the low latency feature. And even worse case, we started adapting the mesh tests to the low latency feature. These 2 maintenance mistakes: Running some tests only with Tinycrypt Using the legacy advertiser always wtih the low latency feature caused the situation where it started multiplying misbehavior. Some tests became fully not functional after removing Tinycrypt library. I'm talking about these two: gatt_suspend_resume.sh gatt_suspend_disable_resume.sh The legacy advertiser does not send data after switching from gatt to adv with low latency feature. The low latency overlay was changed to the legacy overlay everywhere where the low latency feature is not tested. If we want to test behavior of the legacy advertiser, then the only legacy advertiser should be added. Nothing more. Signed-off-by: Aleksandr Khromykh <[email protected]>
1 parent e48c907 commit 2a89430

File tree

166 files changed

+32
-927
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+32
-927
lines changed

tests/bsim/bluetooth/mesh/compile.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,15 @@ app=tests/bsim/bluetooth/mesh conf_overlay=overlay_pst.conf compile
1515
app=tests/bsim/bluetooth/mesh conf_overlay=overlay_gatt.conf compile
1616
app=tests/bsim/bluetooth/mesh conf_overlay=overlay_gatt_separate.conf compile
1717
app=tests/bsim/bluetooth/mesh conf_overlay=overlay_low_lat.conf compile
18-
app=tests/bsim/bluetooth/mesh conf_overlay=overlay_psa.conf compile
18+
app=tests/bsim/bluetooth/mesh conf_overlay=overlay_legacy.conf compile
1919
app=tests/bsim/bluetooth/mesh conf_overlay=overlay_workq_sys.conf compile
2020
app=tests/bsim/bluetooth/mesh conf_overlay=overlay_multi_adv_sets.conf compile
2121
app=tests/bsim/bluetooth/mesh conf_overlay=overlay_lpn_scan_on.conf compile
22-
app=tests/bsim/bluetooth/mesh \
23-
conf_overlay="overlay_pst.conf;overlay_ss.conf;overlay_psa.conf" compile
24-
app=tests/bsim/bluetooth/mesh conf_overlay="overlay_gatt.conf;overlay_psa.conf" compile
2522
app=tests/bsim/bluetooth/mesh conf_overlay="overlay_gatt.conf;overlay_workq_sys.conf" compile
26-
app=tests/bsim/bluetooth/mesh conf_overlay="overlay_low_lat.conf;overlay_psa.conf" compile
27-
app=tests/bsim/bluetooth/mesh conf_overlay="overlay_gatt.conf;overlay_low_lat.conf" compile
23+
app=tests/bsim/bluetooth/mesh conf_overlay="overlay_gatt.conf;overlay_legacy.conf" compile
2824
app=tests/bsim/bluetooth/mesh conf_overlay="overlay_pst.conf;overlay_gatt.conf" compile
2925
app=tests/bsim/bluetooth/mesh \
3026
conf_overlay="overlay_gatt.conf;overlay_multi_adv_sets.conf" compile
31-
app=tests/bsim/bluetooth/mesh \
32-
conf_overlay="overlay_pst.conf;overlay_ss.conf;overlay_gatt.conf;overlay_psa.conf" compile
3327
app=tests/bsim/bluetooth/mesh \
3428
conf_overlay="overlay_pst.conf;overlay_gatt.conf;overlay_workq_sys.conf" compile
3529
wait_for_background_jobs
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_BT_EXT_ADV=n

tests/bsim/bluetooth/mesh/overlay_psa.conf

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/bsim/bluetooth/mesh/overlay_pst.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ CONFIG_FLASH=y
44
CONFIG_FLASH_MAP=y
55
CONFIG_NVS=y
66

7+
CONFIG_SECURE_STORAGE=y
8+
79
CONFIG_BT_PERIPHERAL=y
810
CONFIG_BT_MESH_GATT_PROXY=y
911
CONFIG_BT_MESH_PB_GATT=y

tests/bsim/bluetooth/mesh/overlay_ss.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/bsim/bluetooth/mesh/prj.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ CONFIG_BT_TESTING=y
7474
# Needed for RPR tests due to huge amount of retransmitted messages
7575
CONFIG_BT_MESH_MSG_CACHE_SIZE=64
7676

77-
# Enable tinycrypt as a crypto backend
78-
CONFIG_BT_MESH_USES_TINYCRYPT=y
77+
# Increase the number of key slots in PSA Crypto core
78+
CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT=64

tests/bsim/bluetooth/mesh/src/test_provision.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,7 @@
1313
#include <bs_pc_backchannel.h>
1414
#include <time_machine.h>
1515

16-
#if defined CONFIG_BT_MESH_USES_MBEDTLS_PSA
1716
#include <psa/crypto.h>
18-
#elif defined CONFIG_BT_MESH_USES_TINYCRYPT
19-
#include <tinycrypt/constants.h>
20-
#include <tinycrypt/ecc.h>
21-
#include <tinycrypt/ecc_dh.h>
22-
#else
23-
#error "Unknown crypto library has been chosen"
24-
#endif
2517

2618
#include <zephyr/sys/byteorder.h>
2719

@@ -527,7 +519,6 @@ static void oob_auth_set(int test_step)
527519
prov.input_actions = oob_auth_test_vector[test_step].input_actions;
528520
}
529521

530-
#if defined CONFIG_BT_MESH_USES_MBEDTLS_PSA
531522
static void generate_oob_key_pair(void)
532523
{
533524
psa_key_attributes_t key_attributes = PSA_KEY_ATTRIBUTES_INIT;
@@ -562,12 +553,6 @@ static void generate_oob_key_pair(void)
562553

563554
memcpy(public_key_be, public_key_repr + 1, 64);
564555
}
565-
#elif defined CONFIG_BT_MESH_USES_TINYCRYPT
566-
static void generate_oob_key_pair(void)
567-
{
568-
ASSERT_TRUE(uECC_make_key(public_key_be, private_key_be, uECC_secp256r1()));
569-
}
570-
#endif
571556

572557
static void oob_device(bool use_oob_pk)
573558
{

tests/bsim/bluetooth/mesh/src/test_suspend.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,9 @@ extern const struct bt_mesh_comp comp;
194194
* with a 100ms interval.
195195
*/
196196
static struct bt_mesh_test_gatt gatt_param = {
197-
#if defined(CONFIG_BT_EXT_ADV)
198197
/* (total transmit duration) / (transmit interval) */
199198
.transmits = 1500 / 100,
200199
.interval = 100,
201-
#else
202-
.transmits = 2000 / 1000,
203-
.interval = 1000,
204-
#endif
205200
.service = MESH_SERVICE_PROVISIONING,
206201
};
207202

tests/bsim/bluetooth/mesh/tests_scripts/access/access_cancel.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,3 @@ source $(dirname "${BASH_SOURCE[0]}")/../../_mesh_test.sh
66

77
RunTest mesh_access_publication_cancel \
88
access_tx_cancel access_rx_cancel
9-
10-
overlay=overlay_psa_conf
11-
RunTest mesh_access_publication_cancel_psa \
12-
access_tx_cancel access_rx_cancel

tests/bsim/bluetooth/mesh/tests_scripts/access/access_ext_sub.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,3 @@ source $(dirname "${BASH_SOURCE[0]}")/../../_mesh_test.sh
66

77
RunTest mesh_access_extended_model_subs \
88
access_tx_ext_model access_sub_ext_model
9-
10-
overlay=overlay_psa_conf
11-
RunTest mesh_access_extended_model_subs_psa \
12-
access_tx_ext_model access_sub_ext_model

0 commit comments

Comments
 (0)