Skip to content

Commit

Permalink
Bluetooth: Host: Add test for issue zephyrproject-rtos#42306
Browse files Browse the repository at this point in the history
Checks that only CONFIG_BT_EATT_MAX EATT bearers get connected.

Signed-off-by: Herman Berget <[email protected]>
  • Loading branch information
hermabe authored and carlescufi committed Mar 10, 2022
1 parent 6a23439 commit 0e5d438
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/bluetooth/bsim_bt/bsim_test_eatt/prj_multiple_conn.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CONFIG_BT=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_SMP=y
CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
CONFIG_BT_DEVICE_NAME="EATT test"
CONFIG_BT_EATT=y
CONFIG_BT_L2CAP_ECRED=y
CONFIG_BT_EATT_MAX=5
CONFIG_BT_MAX_CONN=2

CONFIG_BT_TESTING=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_ASSERT=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Copyright (c) 2022 Nordic Semiconductor
# SPDX-License-Identifier: Apache-2.0

simulation_id="multiple_conn"
verbosity_level=2
process_ids=""; exit_code=0

function Execute(){
if [ ! -f $1 ]; then
echo -e " \e[91m`pwd`/`basename $1` cannot be found (did you forget to\
compile it?)\e[39m"
exit 1
fi
timeout 120 $@ & process_ids="$process_ids $!"
}

: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"

#Give a default value to BOARD if it does not have one yet:
BOARD="${BOARD:-nrf52_bsim}"

cd ${BSIM_OUT_PATH}/bin

Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_eatt_prj_multiple_conn_conf \
-v=${verbosity_level} -s=${simulation_id} -d=0 -testid=central

Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_eatt_prj_multiple_conn_conf \
-v=${verbosity_level} -s=${simulation_id} -d=1 -testid=peripheral

Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=200e6 $@

for process_id in $process_ids; do
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0
1 change: 1 addition & 0 deletions tests/bluetooth/bsim_bt/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ source ${ZEPHYR_BASE}/tests/bluetooth/bsim_bt/compile.source

app=tests/bluetooth/bsim_bt/bsim_test_eatt conf_file=prj_encryption.conf compile
app=tests/bluetooth/bsim_bt/bsim_test_eatt conf_file=prj_collision.conf compile
app=tests/bluetooth/bsim_bt/bsim_test_eatt conf_file=prj_multiple_conn.conf compile
app=tests/bluetooth/bsim_bt/bsim_test_app conf_file=prj_split.conf \
compile
app=tests/bluetooth/bsim_bt/bsim_test_app conf_file=prj_split_privacy.conf \
Expand Down

0 comments on commit 0e5d438

Please sign in to comment.