Skip to content

Commit e9687c7

Browse files
valeriosettiaescolar
authored andcommitted
bsim: add tests for BT_USE_PSA_API
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 <[email protected]>
1 parent 035b4af commit e9687c7

File tree

7 files changed

+74
-2
lines changed

7 files changed

+74
-2
lines changed

tests/bsim/bluetooth/hci_uart/compile.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ source ${ZEPHYR_BASE}/tests/bsim/compile.source
1212

1313
app=tests/bsim/bluetooth/ll/conn conf_file=prj_split_hci_uart.conf \
1414
cmake_extra_args=-DEXTRA_DTC_OVERLAY_FILE=hci-uart.overlay compile
15+
app=tests/bsim/bluetooth/ll/conn conf_file=prj_split_hci_uart.conf conf_overlay=psa_overlay.conf \
16+
cmake_extra_args=-DEXTRA_DTC_OVERLAY_FILE=hci-uart.overlay compile
1517
app=samples/bluetooth/hci_uart compile
1618
app=samples/bluetooth/hci_uart_async compile
1719

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2024 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
6+
7+
# Basic connection test: a central connects to a peripheral and expects a
8+
# notification, using the split controller (ULL LLL)
9+
# Both central and peripheral hosts have their controllers in a separate device
10+
# connected over UART. The controller is the HCI UART sample.
11+
simulation_id="basic_conn_split_hci_uart_psa"
12+
verbosity_level=2
13+
14+
cd ${BSIM_OUT_PATH}/bin
15+
16+
UART_DIR=/tmp/bs_${USER}/${simulation_id}/
17+
UART_PER=${UART_DIR}/peripheral
18+
UART_CEN=${UART_DIR}/central
19+
20+
# Note the host+app devices are NOT connected to the phy, only the controllers are.
21+
22+
# Peripheral app + host :
23+
Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_conn_prj_split_hci_uart_conf_psa_overlay_conf \
24+
-v=${verbosity_level} -s=${simulation_id} -d=10 -nosim -RealEncryption=0 \
25+
-testid=peripheral -rs=23 -uart1_fifob_rxfile=${UART_PER}.rx -uart1_fifob_txfile=${UART_PER}.tx
26+
27+
# Peripheral controller:
28+
Execute ./bs_${BOARD_TS}_samples_bluetooth_hci_uart_prj_conf \
29+
-v=${verbosity_level} -s=${simulation_id} -d=0 -RealEncryption=0 \
30+
-rs=23 -uart1_fifob_rxfile=${UART_PER}.tx -uart1_fifob_txfile=${UART_PER}.rx \
31+
32+
# Central app + host
33+
Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_conn_prj_split_hci_uart_conf_psa_overlay_conf \
34+
-v=${verbosity_level} -s=${simulation_id} -d=11 -nosim -RealEncryption=0 \
35+
-testid=central -rs=6 -uart1_fifob_rxfile=${UART_CEN}.rx -uart1_fifob_txfile=${UART_CEN}.tx
36+
37+
# Central controller:
38+
Execute ./bs_${BOARD_TS}_samples_bluetooth_hci_uart_prj_conf \
39+
-v=${verbosity_level} -s=${simulation_id} -d=1 -RealEncryption=0 \
40+
-rs=23 -uart1_fifob_rxfile=${UART_CEN}.tx -uart1_fifob_txfile=${UART_CEN}.rx
41+
42+
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
43+
-D=2 -sim_length=20e6 $@
44+
45+
wait_for_background_jobs
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CONFIG_BT_USE_PSA_API=y
2+
CONFIG_MBEDTLS=y
3+
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
4+
CONFIG_PSA_CRYPTO_ENABLE_ALL=y
5+
6+
CONFIG_ENTROPY_GENERATOR=y
7+
CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG=y

tests/bsim/bluetooth/host/gatt/caching/test_scripts/_run_test.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
66

77
verbosity_level=2
88
EXECUTE_TIMEOUT=120
9+
BIN_SUFFIX=${bin_suffix:-}
910

1011
cd ${BSIM_OUT_PATH}/bin
1112

12-
Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_host_gatt_caching_prj_conf \
13+
Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_host_gatt_caching_prj_conf${BIN_SUFFIX} \
1314
-v=${verbosity_level} -s=${simulation_id} -d=0 -testid=${client_id}
1415

15-
Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_host_gatt_caching_prj_conf \
16+
Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_host_gatt_caching_prj_conf${BIN_SUFFIX} \
1617
-v=${verbosity_level} -s=${simulation_id} -d=1 -testid=${server_id}
1718

1819
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2024 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
simulation_id="gatt_caching_psa_db_hash_read_eatt_psa" \
6+
client_id="gatt_client_db_hash_read_eatt" \
7+
server_id="gatt_server_eatt" \
8+
bin_suffix="_psa_overlay_conf" \
9+
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh

tests/bsim/bluetooth/host/gatt/compile.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ source ${ZEPHYR_BASE}/tests/bsim/compile.source
1212

1313
app=tests/bsim/bluetooth/host/gatt/authorization compile
1414
app=tests/bsim/bluetooth/host/gatt/caching compile
15+
app=tests/bsim/bluetooth/host/gatt/caching conf_overlay=psa_overlay.conf compile
1516
app=tests/bsim/bluetooth/host/gatt/general compile
1617
app=tests/bsim/bluetooth/host/gatt/notify compile
1718
app=tests/bsim/bluetooth/host/gatt/notify_multiple compile
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CONFIG_BT_USE_PSA_API=y
2+
CONFIG_MBEDTLS=y
3+
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
4+
CONFIG_PSA_CRYPTO_ENABLE_ALL=y
5+
6+
CONFIG_ENTROPY_GENERATOR=y
7+
CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG=y

0 commit comments

Comments
 (0)