tests/bsim/bluetooth: Tests scripts refactor

Move common parts to common scripts,
and clean up some unnecessary content.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2023-03-20 11:09:38 +01:00 committed by Alberto Escolar
commit add1397e4a
89 changed files with 277 additions and 1214 deletions

View file

@ -7,13 +7,14 @@
#set -x #uncomment this line for debugging #set -x #uncomment this line for debugging
set -ue set -ue
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
: "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}" : "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}"
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root\ : "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root\
directory}" directory}"
WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}" WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}"
BOARD="${BOARD:-nrf52_bsim}"
BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}" BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}"
mkdir -p ${WORK_DIR} mkdir -p ${WORK_DIR}

View file

@ -6,21 +6,9 @@
SIMULATION_ID="bass" SIMULATION_ID="bass"
VERBOSITY_LEVEL=2 VERBOSITY_LEVEL=2
PROCESS_IDS=""; EXIT_CODE=0 EXECUTE_TIMEOUT=20
function Execute(){ source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
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 20 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -41,8 +29,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -D=3 \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -D=3 \
-sim_length=60e6 $@ -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
exit $EXIT_CODE #the last exit code != 0

View file

@ -5,21 +5,9 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
VERBOSITY_LEVEL=2 VERBOSITY_LEVEL=2
PROCESS_IDS=""; EXIT_CODE=0 EXECUTE_TIMEOUT=20
function Execute(){ source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
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 20 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -38,9 +26,7 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
printf "\n\n======== Broadcaster sink disconnect test =========\n\n" printf "\n\n======== Broadcaster sink disconnect test =========\n\n"
@ -58,8 +44,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
exit $EXIT_CODE #the last exit code != 0

View file

@ -6,21 +6,9 @@
SIMULATION_ID="unicast_audio" SIMULATION_ID="unicast_audio"
VERBOSITY_LEVEL=2 VERBOSITY_LEVEL=2
PROCESS_IDS=""; EXIT_CODE=0 EXECUTE_TIMEOUT=20
function Execute(){ source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
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 20 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -29,7 +17,6 @@ printf "\n\n======== Unicast Audio test =========\n\n"
Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
-v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=0 -testid=unicast_client -rs=23 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=0 -testid=unicast_client -rs=23
Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
-v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=1 -testid=unicast_server -rs=27 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} -d=1 -testid=unicast_server -rs=27
@ -37,8 +24,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
exit $EXIT_CODE #the last exit code != 0

View file

@ -6,21 +6,9 @@
SIMULATION_ID="cap_broadcast" SIMULATION_ID="cap_broadcast"
VERBOSITY_LEVEL=2 VERBOSITY_LEVEL=2
PROCESS_IDS=""; EXIT_CODE=0 EXECUTE_TIMEOUT=20
function Execute(){ source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
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 20 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -36,8 +24,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
exit $EXIT_CODE #the last exit code != 0

View file

@ -6,21 +6,9 @@
SIMULATION_ID="cap_unicast" SIMULATION_ID="cap_unicast"
VERBOSITY_LEVEL=2 VERBOSITY_LEVEL=2
PROCESS_IDS=""; EXIT_CODE=0 EXECUTE_TIMEOUT=20
function Execute(){ source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
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 20 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -36,8 +24,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
exit $EXIT_CODE #the last exit code != 0

View file

@ -7,22 +7,10 @@
# Basic CSIP test. A set coordinator connects to multiple set members # Basic CSIP test. A set coordinator connects to multiple set members
# lock thems, unlocks them and disconnects. # lock thems, unlocks them and disconnects.
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
VERBOSITY_LEVEL=2 VERBOSITY_LEVEL=2
PROCESS_IDS=""; EXIT_CODE=0 EXECUTE_TIMEOUT=20
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 20 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -51,11 +39,7 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=4 -sim_length=60e6 $@ -D=4 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
PROCESS_IDS="";
# TEST WITH FORCE RELEASE # TEST WITH FORCE RELEASE
@ -82,9 +66,7 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=4 -sim_length=60e6 $@ -D=4 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
# TEST WITH SIRK ENC # TEST WITH SIRK ENC
@ -111,7 +93,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=4 -sim_length=60e6 $@ -D=4 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
exit $EXIT_CODE #the last exit code != 0

View file

@ -4,23 +4,11 @@
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
SIMULATION_ID="has" SIMULATION_ID="has"
VERBOSITY_LEVEL=2 VERBOSITY_LEVEL=2
PROCESS_IDS=""; EXIT_CODE=0 EXECUTE_TIMEOUT=20
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 20 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -35,8 +23,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
exit $EXIT_CODE #the last exit code != 0

View file

@ -4,23 +4,11 @@
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
SIMULATION_ID="ias" SIMULATION_ID="ias"
VERBOSITY_LEVEL=2 VERBOSITY_LEVEL=2
PROCESS_IDS=""; EXIT_CODE=0 EXECUTE_TIMEOUT=20
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 20 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -36,8 +24,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
exit $EXIT_CODE #the last exit code != 0

View file

@ -4,23 +4,11 @@
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
SIMULATION_ID="mcs_mcc" SIMULATION_ID="mcs_mcc"
VERBOSITY_LEVEL=2 VERBOSITY_LEVEL=2
PROCESS_IDS=""; EXIT_CODE=0 EXECUTE_TIMEOUT=20
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 20 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -36,8 +24,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
exit $EXIT_CODE #the last exit code != 0

View file

@ -4,23 +4,11 @@
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
SIMULATION_ID="media_controller" SIMULATION_ID="media_controller"
VERBOSITY_LEVEL=2 VERBOSITY_LEVEL=2
PROCESS_IDS=""; EXIT_CODE=0 EXECUTE_TIMEOUT=20
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 20 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -33,9 +21,7 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=1 -sim_length=60e6 $@ -D=1 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
printf "\n\n======== Running media controller remote_player test =========\n\n" printf "\n\n======== Running media controller remote_player test =========\n\n"
@ -49,8 +35,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
exit $EXIT_CODE #the last exit code != 0

View file

@ -4,23 +4,11 @@
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
SIMULATION_ID="micp" SIMULATION_ID="micp"
VERBOSITY_LEVEL=2 VERBOSITY_LEVEL=2
PROCESS_IDS=""; EXIT_CODE=0 EXECUTE_TIMEOUT=20
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 20 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -33,9 +21,7 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=1 -sim_length=60e6 $@ -D=1 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
printf "\n\n==== Running MICP Microphone Device and MICP Microphone Controller test ====n\n" printf "\n\n==== Running MICP Microphone Device and MICP Microphone Controller test ====n\n"
@ -49,8 +35,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
exit $EXIT_CODE #the last exit code != 0

View file

@ -7,21 +7,10 @@
SIMULATION_ID="tbs_ccp" SIMULATION_ID="tbs_ccp"
VERBOSITY_LEVEL=2 VERBOSITY_LEVEL=2
PROCESS_IDS=""; EXIT_CODE=0
function Execute(){ source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
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 20 $@ & PROCESS_IDS="$PROCESS_IDS $!"
}
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}" EXECUTE_TIMEOUT=20
#Give a default value to BOARD if it does not have one yet:
BOARD="${BOARD:-nrf52_bsim}"
cd ${BSIM_OUT_PATH}/bin cd ${BSIM_OUT_PATH}/bin
@ -35,7 +24,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
exit $EXIT_CODE #the last exit code != 0

View file

@ -4,23 +4,11 @@
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
SIMULATION_ID="vcp" SIMULATION_ID="vcp"
VERBOSITY_LEVEL=2 VERBOSITY_LEVEL=2
PROCESS_IDS=""; EXIT_CODE=0 EXECUTE_TIMEOUT=20
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 20 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -33,9 +21,7 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=1 -sim_length=60e6 $@ -D=1 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
printf "\n\n======== Running VCP Volume Renderer and VCP Volume Controller test =========\n\n" printf "\n\n======== Running VCP Volume Renderer and VCP Volume Controller test =========\n\n"
@ -49,8 +35,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_audio_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
exit $EXIT_CODE #the last exit code != 0

View file

@ -4,23 +4,11 @@
# Validate Extended Advertising AD Data fragment operation, PDU chaining and # Validate Extended Advertising AD Data fragment operation, PDU chaining and
# Extended Scanning of chain PDUs # Extended Scanning of chain PDUs
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="adv_chain" simulation_id="adv_chain"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=10
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 10 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -33,7 +21,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_adv_chain_prj_conf\
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=10e6 $@ -D=2 -sim_length=10e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -4,23 +4,12 @@
# Basic periodic advertising sync test: an advertiser advertises with periodic # Basic periodic advertising sync test: an advertiser advertises with periodic
# advertising, and a scanner scans for and syncs to the periodic advertising. # advertising, and a scanner scans for and syncs to the periodic advertising.
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="per_adv" simulation_id="per_adv"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=10
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 10 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -35,7 +24,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_adv_periodic_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=20e6 $@ -D=2 -sim_length=20e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -4,23 +4,12 @@
# Basic periodic advertising sync test: an advertiser advertises with periodic # Basic periodic advertising sync test: an advertiser advertises with periodic
# advertising, and a scanner scans for and syncs to the periodic advertising. # advertising, and a scanner scans for and syncs to the periodic advertising.
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="per_adv_conn" simulation_id="per_adv_conn"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=10
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 10 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -35,7 +24,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_adv_periodic_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=20e6 $@ -D=2 -sim_length=20e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -4,23 +4,12 @@
# Basic periodic advertising sync test: an advertiser advertises with periodic # Basic periodic advertising sync test: an advertiser advertises with periodic
# advertising, and a scanner scans for and syncs to the periodic advertising. # advertising, and a scanner scans for and syncs to the periodic advertising.
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="per_adv_conn_privacy" simulation_id="per_adv_conn_privacy"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=10
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 10 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -35,7 +24,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_adv_periodic_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=20e6 $@ -D=2 -sim_length=20e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -4,23 +4,12 @@
# Basic periodic advertising sync test: an advertiser advertises with periodic # Basic periodic advertising sync test: an advertiser advertises with periodic
# advertising, and a scanner scans for and syncs to the periodic advertising. # advertising, and a scanner scans for and syncs to the periodic advertising.
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="per_adv_long_data" simulation_id="per_adv_long_data"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=10
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 10 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -35,7 +24,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_adv_periodic_prj_long_data_conf
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=20e6 $@ -D=2 -sim_length=20e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -4,8 +4,6 @@
set -eu set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
test_name="$(basename "$(realpath "$bash_source_dir/..")")" test_name="$(basename "$(realpath "$bash_source_dir/..")")"
bsim_bin="${BSIM_OUT_PATH}/bin" bsim_bin="${BSIM_OUT_PATH}/bin"
BOARD="${BOARD:-nrf52_bsim}" BOARD="${BOARD:-nrf52_bsim}"

View file

@ -5,25 +5,12 @@
set -eu set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
# Read variable definitions output by _env.sh
source "${bash_source_dir}/_env.sh" source "${bash_source_dir}/_env.sh"
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="${test_name}" simulation_id="${test_name}"
verbosity_level=2 verbosity_level=2
process_ids="" EXECUTE_TIMEOUT=30
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 30 $@ &
process_ids="$process_ids $!"
}
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
cd ${BSIM_OUT_PATH}/bin cd ${BSIM_OUT_PATH}/bin
@ -43,7 +30,4 @@ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
# gdb --args "$test_exe" \ # gdb --args "$test_exe" \
# -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=peripheral -RealEncryption=1 # -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=peripheral -RealEncryption=1
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -5,25 +5,12 @@
set -eu set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
# Read variable definitions output by _env.sh
source "${bash_source_dir}/_env.sh" source "${bash_source_dir}/_env.sh"
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="${test_name}_2" simulation_id="${test_name}_2"
verbosity_level=2 verbosity_level=2
process_ids="" EXECUTE_TIMEOUT=30
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 30 $@ &
process_ids="$process_ids $!"
}
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
cd ${BSIM_OUT_PATH}/bin cd ${BSIM_OUT_PATH}/bin
@ -36,7 +23,4 @@ Execute "$test_2_exe" \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s="${simulation_id}" \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s="${simulation_id}" \
-D=2 -sim_length=10e6 $@ -D=2 -sim_length=10e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -2,23 +2,11 @@
# Copyright (c) 2022 Nordic Semiconductor # Copyright (c) 2022 Nordic Semiconductor
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="connection" simulation_id="connection"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=120
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 cd ${BSIM_OUT_PATH}/bin
@ -31,7 +19,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_att_eatt_prj_autoconnect_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=200e6 $@ -D=2 -sim_length=200e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -2,23 +2,11 @@
# Copyright (c) 2022 Nordic Semiconductor # Copyright (c) 2022 Nordic Semiconductor
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="collision" simulation_id="collision"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=120
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 cd ${BSIM_OUT_PATH}/bin
@ -31,7 +19,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_att_eatt_prj_collision_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=200e6 $@ -D=2 -sim_length=200e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -2,23 +2,11 @@
# Copyright (c) 2022 Nordic Semiconductor # Copyright (c) 2022 Nordic Semiconductor
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="multiple_conn" simulation_id="multiple_conn"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=120
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 cd ${BSIM_OUT_PATH}/bin
@ -31,7 +19,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_att_eatt_prj_multiple_conn_conf
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=200e6 $@ -D=2 -sim_length=200e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -2,23 +2,11 @@
# Copyright (c) 2022 Nordic Semiconductor # Copyright (c) 2022 Nordic Semiconductor
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="reconfigure" simulation_id="reconfigure"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=120
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 cd ${BSIM_OUT_PATH}/bin
@ -31,7 +19,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_att_eatt_prj_autoconnect_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -4,23 +4,11 @@
# EATT notification reliability test # EATT notification reliability test
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="eatt_notif" simulation_id="eatt_notif"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=120
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 cd ${BSIM_OUT_PATH}/bin
@ -33,7 +21,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_att_eatt_notif_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -6,10 +6,7 @@ set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
# Read variable definitions output by _env.sh # Read variable definitions output by _env.sh
source <("${bash_source_dir}/_env.sh") source "${bash_source_dir}/_env.sh"
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
: "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}" : "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}"
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be defined}" : "${ZEPHYR_BASE:?ZEPHYR_BASE must be defined}"

View file

@ -13,18 +13,3 @@ BOARD="${BOARD:-nrf52_bsim}"
simulation_id="$test_name" simulation_id="$test_name"
central_exe="${bsim_bin}/bs_${BOARD}_tests_bsim_bluetooth_host_att_mtu_update_prj_conf" central_exe="${bsim_bin}/bs_${BOARD}_tests_bsim_bluetooth_host_att_mtu_update_prj_conf"
peripheral_exe="${central_exe}" peripheral_exe="${central_exe}"
function print_var {
# Print a shell-sourceable variable definition.
local var_name="$1"
local var_repr="${!var_name@Q}"
echo "$var_name=$var_repr"
}
print_var test_name
print_var bsim_bin
print_var verbosity_level
print_var BOARD
print_var simulation_id
print_var central_exe
print_var peripheral_exe

View file

@ -5,23 +5,12 @@
set -eu set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
# Read variable definitions output by _env.sh source "${bash_source_dir}/_env.sh"
source <("${bash_source_dir}/_env.sh") source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
process_ids="" simulation_id="$test_name"
exit_code=0 verbosity_level=2
EXECUTE_TIMEOUT=30
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 30 $@ &
process_ids="$process_ids $!"
}
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
cd ${BSIM_OUT_PATH}/bin cd ${BSIM_OUT_PATH}/bin
@ -34,7 +23,4 @@ Execute "$peripheral_exe" \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -7,13 +7,12 @@
#set -x #uncomment this line for debugging #set -x #uncomment this line for debugging
set -ue set -ue
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
: "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}" : "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}"
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root\ : "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root\
directory}" directory}"
WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}" WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}"
BOARD="${BOARD:-nrf52_bsim}"
BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}" BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}"
mkdir -p ${WORK_DIR} mkdir -p ${WORK_DIR}

View file

@ -2,24 +2,10 @@
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
verbosity_level=2 verbosity_level=2
process_ids="" EXECUTE_TIMEOUT=120
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 cd ${BSIM_OUT_PATH}/bin
@ -32,7 +18,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_gatt_caching_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -5,23 +5,12 @@
# Basic GATT test: A central acting as a GATT client scans for and connects # Basic GATT test: A central acting as a GATT client scans for and connects
# to a peripheral acting as a GATT server. The GATT client will then attempt # to a peripheral acting as a GATT server. The GATT client will then attempt
# to write and read to and from a few GATT characteristics. # to write and read to and from a few GATT characteristics.
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="gatt" simulation_id="gatt"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=120
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 cd ${BSIM_OUT_PATH}/bin
@ -34,7 +23,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_gatt_general_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -1,25 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
set -eu
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
verbosity_level=2 verbosity_level=2
process_ids="" EXECUTE_TIMEOUT=30
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 30 $@ &
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 cd ${BSIM_OUT_PATH}/bin
@ -32,7 +19,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_gatt_notify_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -1,4 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -7,4 +6,3 @@ simulation_id="gatt_notify_enhanced_enhanced" \
server_id="gatt_server_enhanced" \ server_id="gatt_server_enhanced" \
client_id="gatt_client_enhanced" \ client_id="gatt_client_enhanced" \
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh $(dirname "${BASH_SOURCE[0]}")/_run_test.sh

View file

@ -1,4 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -7,4 +6,3 @@ simulation_id="gatt_notify_enhanced_mixed" \
server_id="gatt_server_enhanced" \ server_id="gatt_server_enhanced" \
client_id="gatt_client_mixed" \ client_id="gatt_client_mixed" \
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh $(dirname "${BASH_SOURCE[0]}")/_run_test.sh

View file

@ -1,4 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -7,4 +6,3 @@ simulation_id="gatt_notify_enhanced_none" \
server_id="gatt_server_enhanced" \ server_id="gatt_server_enhanced" \
client_id="gatt_client_none" \ client_id="gatt_client_none" \
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh $(dirname "${BASH_SOURCE[0]}")/_run_test.sh

View file

@ -1,4 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -7,4 +6,3 @@ simulation_id="gatt_notify_enhanced_unenhanced" \
server_id="gatt_server_enhanced" \ server_id="gatt_server_enhanced" \
client_id="gatt_client_unenhanced" \ client_id="gatt_client_unenhanced" \
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh $(dirname "${BASH_SOURCE[0]}")/_run_test.sh

View file

@ -1,4 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -7,4 +6,3 @@ simulation_id="gatt_notify_mixed_enhanced" \
server_id="gatt_server_mixed" \ server_id="gatt_server_mixed" \
client_id="gatt_client_enhanced" \ client_id="gatt_client_enhanced" \
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh $(dirname "${BASH_SOURCE[0]}")/_run_test.sh

View file

@ -1,4 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -7,4 +6,3 @@ simulation_id="gatt_notify_mixed_mixed" \
server_id="gatt_server_mixed" \ server_id="gatt_server_mixed" \
client_id="gatt_client_mixed" \ client_id="gatt_client_mixed" \
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh $(dirname "${BASH_SOURCE[0]}")/_run_test.sh

View file

@ -1,4 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -7,4 +6,3 @@ simulation_id="gatt_notify_mixed_none" \
server_id="gatt_server_mixed" \ server_id="gatt_server_mixed" \
client_id="gatt_client_none" \ client_id="gatt_client_none" \
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh $(dirname "${BASH_SOURCE[0]}")/_run_test.sh

View file

@ -1,4 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -7,4 +6,3 @@ simulation_id="gatt_notify_mixed_unenhanced" \
server_id="gatt_server_mixed" \ server_id="gatt_server_mixed" \
client_id="gatt_client_unenhanced" \ client_id="gatt_client_unenhanced" \
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh $(dirname "${BASH_SOURCE[0]}")/_run_test.sh

View file

@ -1,4 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -7,4 +6,3 @@ simulation_id="gatt_notify_none_enhanced" \
server_id="gatt_server_none" \ server_id="gatt_server_none" \
client_id="gatt_client_enhanced" \ client_id="gatt_client_enhanced" \
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh $(dirname "${BASH_SOURCE[0]}")/_run_test.sh

View file

@ -1,4 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -7,4 +6,3 @@ simulation_id="gatt_notify_none_mixed" \
server_id="gatt_server_none" \ server_id="gatt_server_none" \
client_id="gatt_client_mixed" \ client_id="gatt_client_mixed" \
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh $(dirname "${BASH_SOURCE[0]}")/_run_test.sh

View file

@ -1,4 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -7,4 +6,3 @@ simulation_id="gatt_notify_none_none" \
server_id="gatt_server_none" \ server_id="gatt_server_none" \
client_id="gatt_client_none" \ client_id="gatt_client_none" \
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh $(dirname "${BASH_SOURCE[0]}")/_run_test.sh

View file

@ -1,4 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -7,4 +6,3 @@ simulation_id="gatt_notify_none_unenhanced" \
server_id="gatt_server_none" \ server_id="gatt_server_none" \
client_id="gatt_client_unenhanced" \ client_id="gatt_client_unenhanced" \
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh $(dirname "${BASH_SOURCE[0]}")/_run_test.sh

View file

@ -1,4 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -7,4 +6,3 @@ simulation_id="gatt_notify_unenhanced_enhanced" \
server_id="gatt_server_unenhanced" \ server_id="gatt_server_unenhanced" \
client_id="gatt_client_enhanced" \ client_id="gatt_client_enhanced" \
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh $(dirname "${BASH_SOURCE[0]}")/_run_test.sh

View file

@ -1,4 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -7,4 +6,3 @@ simulation_id="gatt_notify_unenhanced_mixed" \
server_id="gatt_server_unenhanced" \ server_id="gatt_server_unenhanced" \
client_id="gatt_client_mixed" \ client_id="gatt_client_mixed" \
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh $(dirname "${BASH_SOURCE[0]}")/_run_test.sh

View file

@ -1,4 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -7,4 +6,3 @@ simulation_id="gatt_notify_unenhanced_none" \
server_id="gatt_server_unenhanced" \ server_id="gatt_server_unenhanced" \
client_id="gatt_client_none" \ client_id="gatt_client_none" \
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh $(dirname "${BASH_SOURCE[0]}")/_run_test.sh

View file

@ -1,4 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
@ -7,4 +6,3 @@ simulation_id="gatt_notify_unenhanced_unenhanced" \
server_id="gatt_server_unenhanced" \ server_id="gatt_server_unenhanced" \
client_id="gatt_client_unenhanced" \ client_id="gatt_client_unenhanced" \
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh $(dirname "${BASH_SOURCE[0]}")/_run_test.sh

View file

@ -11,10 +11,8 @@
# GDB can be run on the two devices at the same time without issues, just append # GDB can be run on the two devices at the same time without issues, just append
# `debug` when running the script. # `debug` when running the script.
simulation_id="notify_multiple" simulation_id="notify_multiple"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}" : "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"

View file

@ -1,24 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
set -eu
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="notify_multiple" simulation_id="notify_multiple"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=120
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 cd ${BSIM_OUT_PATH}/bin
@ -31,7 +20,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_gatt_notify_multiple_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2023 Nordic Semiconductor ASA # Copyright 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
set -eu set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
# Read variable definitions output by _env.sh # Read variable definitions output by _env.sh

View file

@ -4,8 +4,6 @@
set -eu set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
test_name="$(basename "$(realpath "$bash_source_dir/..")")" test_name="$(basename "$(realpath "$bash_source_dir/..")")"
bsim_bin="${BSIM_OUT_PATH}/bin" bsim_bin="${BSIM_OUT_PATH}/bin"
BOARD="${BOARD:-nrf52_bsim}" BOARD="${BOARD:-nrf52_bsim}"

View file

@ -1,27 +1,16 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
set -eu set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
source "${bash_source_dir}/_env.sh" source "${bash_source_dir}/_env.sh"
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="${test_name}" simulation_id="${test_name}"
verbosity_level=2 verbosity_level=2
process_ids="" EXECUTE_TIMEOUT=30
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
$@ &
process_ids="$process_ids $!"
}
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
cd ${BSIM_OUT_PATH}/bin cd ${BSIM_OUT_PATH}/bin
@ -57,7 +46,4 @@ Execute "$test_exe" -v=${verbosity_level} \
Execute "$test_exe" -v=${verbosity_level} \ Execute "$test_exe" -v=${verbosity_level} \
-s="${simulation_id}" -d=7 -testid=client -RealEncryption=1 -argstest 0 0 "client" -s="${simulation_id}" -d=7 -testid=client -RealEncryption=1 -argstest 0 0 "client"
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -1,27 +1,16 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
set -eu set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
source "${bash_source_dir}/_env.sh" source "${bash_source_dir}/_env.sh"
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="${test_name}_2" simulation_id="${test_name}_2"
verbosity_level=2 verbosity_level=2
process_ids="" EXECUTE_TIMEOUT=120
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
$@ &
process_ids="$process_ids $!"
}
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
cd ${BSIM_OUT_PATH}/bin cd ${BSIM_OUT_PATH}/bin
@ -57,7 +46,4 @@ Execute "$test_2_exe" -v=${verbosity_level} \
Execute "$test_2_exe" -v=${verbosity_level} \ Execute "$test_2_exe" -v=${verbosity_level} \
-s="${simulation_id}" -d=7 -testid=client -RealEncryption=1 -argstest 0 0 "client_2" -s="${simulation_id}" -d=7 -testid=client -RealEncryption=1 -argstest 0 0 "client_2"
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -2,24 +2,12 @@
# Copyright 2018 Oticon A/S # Copyright 2018 Oticon A/S
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
# Multiple connection between two devices with multiple peripheral identity # Multiple connection between two devices with multiple peripheral identity
simulation_id="gatt_write" simulation_id="gatt_write"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=60
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 60 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -32,7 +20,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_gatt_write_prj_conf\
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -2,24 +2,12 @@
# Copyright (c) 2022 Nordic Semiconductor # Copyright (c) 2022 Nordic Semiconductor
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
# EATT test # EATT test
simulation_id="l2cap_ecred" simulation_id="l2cap_ecred"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=120
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 cd ${BSIM_OUT_PATH}/bin
@ -32,7 +20,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_l2cap_general_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -2,25 +2,12 @@
# Copyright (c) 2022 Nordic Semiconductor # Copyright (c) 2022 Nordic Semiconductor
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
# EATT test # EATT test
simulation_id="l2cap_stress" simulation_id="l2cap_stress"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=120
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 30 $@ & process_ids="$process_ids $!"
$@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -37,7 +24,4 @@ Execute "${bsim_exe}" -v=${verbosity_level} -s=${simulation_id} -d=6 -testid=per
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} -D=7 -sim_length=270e6 $@ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} -D=7 -sim_length=270e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -2,25 +2,11 @@
# Copyright (c) 2022 Nordic Semiconductor # Copyright (c) 2022 Nordic Semiconductor
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
simulation_id="l2cap_ecred_userdata" simulation_id="l2cap_ecred_userdata"
verbosity_level=2 verbosity_level=2
process_ids="" EXECUTE_TIMEOUT=120
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 cd ${BSIM_OUT_PATH}/bin
@ -33,7 +19,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_l2cap_userdata_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=30e6 $@ -D=2 -sim_length=30e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -2,24 +2,12 @@
# Copyright (c) 2022 Nordic Semiconductor # Copyright (c) 2022 Nordic Semiconductor
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
# Disable test: bt_enable and bt_disable are called in a loop. # Disable test: bt_enable and bt_disable are called in a loop.
simulation_id="disable_test" simulation_id="disable_test"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=120
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 cd ${BSIM_OUT_PATH}/bin
@ -29,7 +17,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_misc_disable_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=1 -sim_length=60e6 $@ -D=1 -sim_length=60e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -2,27 +2,15 @@
# Copyright 2022 Nordic Semiconductor ASA # Copyright 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
# Disable with GATT test: A central acting as a GATT client scans for and connects # Disable with GATT test: A central acting as a GATT client scans for and connects
# to a peripheral acting as a GATT server. The GATT client will then attempt # to a peripheral acting as a GATT server. The GATT client will then attempt
# to write and read to and from a few GATT characteristics. Both the central and # to write and read to and from a few GATT characteristics. Both the central and
# peripheral then disable bluetooth and the test repeats. # peripheral then disable bluetooth and the test repeats.
simulation_id="disable_with_gatt" simulation_id="disable_with_gatt"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=120
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 cd ${BSIM_OUT_PATH}/bin
@ -35,7 +23,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_misc_disable_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=600e6 $@ -D=2 -sim_length=600e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -2,24 +2,12 @@
# Copyright 2018 Oticon A/S # Copyright 2018 Oticon A/S
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
# Multiple connection between two devices with multiple peripheral identity # Multiple connection between two devices with multiple peripheral identity
simulation_id="multiple" simulation_id="multiple"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=1800
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 1800 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -32,7 +20,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_host_misc_multiple_id_prj_conf\
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=4500e6 $@ -D=2 -sim_length=4500e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -5,15 +5,12 @@
set -eu set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
# Read variable definitions output by _env.sh source "${bash_source_dir}/_env.sh"
source <("${bash_source_dir}/_env.sh")
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}" : "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
: "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}" : "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}"
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be defined}" : "${ZEPHYR_BASE:?ZEPHYR_BASE must be defined}"
WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_bt_out}" WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_bt_out}"
BOARD="${BOARD:-nrf52_bsim}" BOARD="${BOARD:-nrf52_bsim}"
BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}" BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}"

View file

@ -5,8 +5,6 @@
set -eu set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
test_name="$(basename "$(realpath "$bash_source_dir/..")")" test_name="$(basename "$(realpath "$bash_source_dir/..")")"
bsim_bin="${BSIM_OUT_PATH}/bin" bsim_bin="${BSIM_OUT_PATH}/bin"
verbosity_level=2 verbosity_level=2
@ -14,18 +12,3 @@ BOARD="${BOARD:-nrf52_bsim}"
simulation_id="$test_name" simulation_id="$test_name"
central_exe="${bsim_bin}/bs_${BOARD}_tests_bsim_bluetooth_host_privacy_central_prj_conf" central_exe="${bsim_bin}/bs_${BOARD}_tests_bsim_bluetooth_host_privacy_central_prj_conf"
peripheral_exe="${central_exe}" peripheral_exe="${central_exe}"
function print_var {
# Print a shell-sourceable variable definition.
local var_name="$1"
local var_repr="${!var_name@Q}"
echo "$var_name=$var_repr"
}
print_var test_name
print_var bsim_bin
print_var verbosity_level
print_var BOARD
print_var simulation_id
print_var central_exe
print_var peripheral_exe

View file

@ -1,27 +1,14 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Copyright 2023 Nordic Semiconductor ASA # Copyright 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
set -eu set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
# Read variable definitions output by _env.sh source "${bash_source_dir}/_env.sh"
source <("${bash_source_dir}/_env.sh") source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
process_ids="" EXECUTE_TIMEOUT=30
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 30 $@ &
process_ids="$process_ids $!"
}
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
cd ${BSIM_OUT_PATH}/bin cd ${BSIM_OUT_PATH}/bin
@ -34,8 +21,4 @@ Execute "$peripheral_exe" \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -5,23 +5,10 @@
set -eu set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
# Read variable definitions output by _env.sh
source "${bash_source_dir}/_env.sh" source "${bash_source_dir}/_env.sh"
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
process_ids="" EXECUTE_TIMEOUT=30
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 30 $@ &
process_ids="$process_ids $!"
}
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
cd ${BSIM_OUT_PATH}/bin cd ${BSIM_OUT_PATH}/bin
@ -75,11 +62,4 @@ for args in ${TEST_ARGS[@]}; do
done done
done done
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
if [ ${exit_code} -ne 0 ]; then
exit_code=1
fi
done
exit $exit_code # the last exit code != 0

View file

@ -6,7 +6,7 @@ set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
# Read variable definitions output by _env.sh # Read variable definitions output by _env.sh
source <("${bash_source_dir}/_env.sh") source "${bash_source_dir}/_env.sh"
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}" : "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"

View file

@ -5,8 +5,6 @@
set -eu set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
test_name="$(basename "$(realpath "$bash_source_dir/..")")" test_name="$(basename "$(realpath "$bash_source_dir/..")")"
bsim_bin="${BSIM_OUT_PATH}/bin" bsim_bin="${BSIM_OUT_PATH}/bin"
verbosity_level=2 verbosity_level=2
@ -14,18 +12,3 @@ BOARD="${BOARD:-nrf52_bsim}"
simulation_id="$test_name" simulation_id="$test_name"
central_exe="${bsim_bin}/bs_${BOARD}_tests_bsim_bluetooth_host_privacy_peripheral_prj_conf" central_exe="${bsim_bin}/bs_${BOARD}_tests_bsim_bluetooth_host_privacy_peripheral_prj_conf"
peripheral_exe="${central_exe}" peripheral_exe="${central_exe}"
function print_var {
# Print a shell-sourceable variable definition.
local var_name="$1"
local var_repr="${!var_name@Q}"
echo "$var_name=$var_repr"
}
print_var test_name
print_var bsim_bin
print_var verbosity_level
print_var BOARD
print_var simulation_id
print_var central_exe
print_var peripheral_exe

View file

@ -5,23 +5,10 @@
set -eu set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
# Read variable definitions output by _env.sh source "${bash_source_dir}/_env.sh"
source <("${bash_source_dir}/_env.sh") source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
process_ids="" EXECUTE_TIMEOUT=30
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 30 $@ &
process_ids="$process_ids $!"
}
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
cd ${BSIM_OUT_PATH}/bin cd ${BSIM_OUT_PATH}/bin
@ -34,8 +21,4 @@ Execute "$peripheral_exe" \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=120e6 $@ -D=2 -sim_length=120e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -6,10 +6,8 @@ set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
# Read variable definitions output by _env.sh # Read variable definitions output by _env.sh
source <("${bash_source_dir}/_env.sh") source "${bash_source_dir}/_env.sh"
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
: "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}" : "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}"
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be defined}" : "${ZEPHYR_BASE:?ZEPHYR_BASE must be defined}"

View file

@ -13,18 +13,3 @@ BOARD="${BOARD:-nrf52_bsim}"
simulation_id="$test_name" simulation_id="$test_name"
central_exe="${bsim_bin}/bs_${BOARD}_tests_bsim_bluetooth_host_${test_name}_prj_conf" central_exe="${bsim_bin}/bs_${BOARD}_tests_bsim_bluetooth_host_${test_name}_prj_conf"
peripheral_exe="${central_exe}" peripheral_exe="${central_exe}"
function print_var {
# Print a shell-sourceable variable definition.
local var_name="$1"
local var_repr="${!var_name@Q}"
echo "$var_name=$var_repr"
}
print_var test_name
print_var bsim_bin
print_var verbosity_level
print_var BOARD
print_var simulation_id
print_var central_exe
print_var peripheral_exe

View file

@ -5,23 +5,10 @@
set -eu set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
# Read variable definitions output by _env.sh source "${bash_source_dir}/_env.sh"
source <("${bash_source_dir}/_env.sh") source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
process_ids="" EXECUTE_TIMEOUT=30
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 30 $@ &
process_ids="$process_ids $!"
}
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
cd ${BSIM_OUT_PATH}/bin cd ${BSIM_OUT_PATH}/bin
@ -34,7 +21,4 @@ Execute "$peripheral_exe" \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -6,10 +6,8 @@ set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
# Read variable definitions output by _env.sh # Read variable definitions output by _env.sh
source <("${bash_source_dir}/_env.sh") source "${bash_source_dir}/_env.sh"
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
: "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}" : "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}"
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be defined}" : "${ZEPHYR_BASE:?ZEPHYR_BASE must be defined}"

View file

@ -6,22 +6,10 @@ set -eu
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
# Read variable definitions output by _env.sh # Read variable definitions output by _env.sh
source <("${bash_source_dir}/_env.sh") source "${bash_source_dir}/_env.sh"
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
process_ids="" EXECUTE_TIMEOUT=30
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 30 $@ &
process_ids="$process_ids $!"
}
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
cd ${BSIM_OUT_PATH}/bin cd ${BSIM_OUT_PATH}/bin
@ -34,7 +22,4 @@ Execute "$peripheral_exe" \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -2,25 +2,13 @@
# Copyright 2018 Oticon A/S # Copyright 2018 Oticon A/S
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
# Basic connection test: a central connects to a peripheral and expects a # Basic connection test: a central connects to a peripheral and expects a
# notification, using the split controller (ULL LLL) # notification, using the split controller (ULL LLL)
simulation_id="basic_advx" simulation_id="basic_advx"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=120
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 cd ${BSIM_OUT_PATH}/bin
@ -33,7 +21,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_ll_advx_prj_conf\
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=60e6 $@ -D=2 -sim_length=60e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -6,14 +6,12 @@
#set -x #uncomment this line for debugging #set -x #uncomment this line for debugging
set -ue set -ue
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
: "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}" : "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}"
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root\ : "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root\
directory}" directory}"
WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}" WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}"
BOARD="${BOARD:-nrf52_bsim}"
BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}" BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}"
mkdir -p ${WORK_DIR} mkdir -p ${WORK_DIR}

View file

@ -2,25 +2,13 @@
# Copyright 2018 Oticon A/S # Copyright 2018 Oticon A/S
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
# Basic connection test: a central connects to a peripheral and expects a # Basic connection test: a central connects to a peripheral and expects a
# notification # notification
simulation_id="basic_conn_encr_split" simulation_id="basic_conn_encr_split"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=5
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 5 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -35,7 +23,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_ll_conn_prj_split_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=20e6 $@ -D=2 -sim_length=20e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -2,25 +2,13 @@
# Copyright 2018 Oticon A/S # Copyright 2018 Oticon A/S
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
# Basic connection test: a central connects to a peripheral and expects a # Basic connection test: a central connects to a peripheral and expects a
# notification # notification
simulation_id="basic_conn_encr_split_privacy" simulation_id="basic_conn_encr_split_privacy"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=5
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 5 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -37,7 +25,4 @@ Execute \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=20e6 $@ -D=2 -sim_length=20e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -2,25 +2,13 @@
# Copyright 2018 Oticon A/S # Copyright 2018 Oticon A/S
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
# Basic connection test: a central connects to a peripheral and expects a # Basic connection test: a central connects to a peripheral and expects a
# notification, using the split controller (ULL LLL) # notification, using the split controller (ULL LLL)
simulation_id="basic_conn_split" simulation_id="basic_conn_split"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=5
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 5 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -35,7 +23,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_ll_conn_prj_split_conf\
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=20e6 $@ -D=2 -sim_length=20e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -2,25 +2,13 @@
# Copyright 2018 Oticon A/S # Copyright 2018 Oticon A/S
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
# Basic connection test: a central connects to a peripheral and expects a # Basic connection test: a central connects to a peripheral and expects a
# notification, using the split controller (ULL LLL) in Low Latency Variant # notification, using the split controller (ULL LLL) in Low Latency Variant
simulation_id="basic_conn_split_low_lat" simulation_id="basic_conn_split_low_lat"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=5
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 5 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -37,7 +25,4 @@ Execute \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=20e6 $@ -D=2 -sim_length=20e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -44,9 +44,10 @@ VERBOSITY_LEVEL_DEVS=${VERBOSITY_LEVEL_DEVS:-${VERBOSITY_LEVEL}}
VERBOSITY_LEVEL_DEV1=${VERBOSITY_LEVEL_1:-${VERBOSITY_LEVEL_DEVS}} VERBOSITY_LEVEL_DEV1=${VERBOSITY_LEVEL_1:-${VERBOSITY_LEVEL_DEVS}}
VERBOSITY_LEVEL_DEV2=${VERBOSITY_LEVEL_2:-${VERBOSITY_LEVEL_DEVS}} VERBOSITY_LEVEL_DEV2=${VERBOSITY_LEVEL_2:-${VERBOSITY_LEVEL_DEVS}}
PROCESS_IDS=""; EXIT_CODE=0
function Execute(){ source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
function _Execute(){
local rr= local rr=
if [ "rr" = "$1" ]; then if [ "rr" = "$1" ]; then
local devno=$2 local devno=$2
@ -56,19 +57,12 @@ function Execute(){
rm -rf ${out} rm -rf ${out}
rr="rr record -o ${out}" rr="rr record -o ${out}"
fi fi
if [ ! -f $1 ]; then check_program_exists $1
echo -e " \e[91m`pwd`/`basename $1` cannot be found (did you forget to\ run_in_background timeout 300 ${rr} $@
compile it?)\e[39m"
exit 1
fi
timeout 300 ${rr} $@ & PROCESS_IDS="$PROCESS_IDS $!"
} }
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
: "${EDTT_PATH:?EDTT_PATH must be defined}"
#Give a default value to BOARD if it does not have one yet: : "${EDTT_PATH:?EDTT_PATH must be defined}"
BOARD="${BOARD:-nrf52_bsim}"
#Give a default value to PRJ_CONF_x if it does not have one yet: #Give a default value to PRJ_CONF_x if it does not have one yet:
PRJ_CONF="${PRJ_CONF:-prj_dut_conf}" PRJ_CONF="${PRJ_CONF:-prj_dut_conf}"
@ -94,24 +88,21 @@ fi
cd ${EDTT_PATH} cd ${EDTT_PATH}
Execute ./src/edttool.py -s=${SIMULATION_ID} -d=2 --transport bsim \ _Execute ./src/edttool.py -s=${SIMULATION_ID} -d=2 --transport bsim \
-T $TEST_MODULE -C $TEST_FILE -v=${VERBOSITY_LEVEL_EDTT} -S -l --low-level-device-nbr=3 \ -T $TEST_MODULE -C $TEST_FILE -v=${VERBOSITY_LEVEL_EDTT} -S -l --low-level-device-nbr=3 \
-D=2 -devs 0 1 -RxWait=2.5e3 -D=2 -devs 0 1 -RxWait=2.5e3
cd ${BSIM_OUT_PATH}/bin cd ${BSIM_OUT_PATH}/bin
Execute \ _Execute \
${RR_ARGS_1} ./bs_${BOARD}_tests_bsim_bluetooth_ll_edtt_hci_test_app_${PRJ_CONF_1}\ ${RR_ARGS_1} ./bs_${BOARD}_tests_bsim_bluetooth_ll_edtt_hci_test_app_${PRJ_CONF_1}\
-s=${SIMULATION_ID} -d=0 -v=${VERBOSITY_LEVEL_DEV1} -RealEncryption=1 -s=${SIMULATION_ID} -d=0 -v=${VERBOSITY_LEVEL_DEV1} -RealEncryption=1
Execute \ _Execute \
${RR_ARGS_2} ./bs_${BOARD}_tests_bsim_bluetooth_ll_edtt_hci_test_app_${PRJ_CONF_2}\ ${RR_ARGS_2} ./bs_${BOARD}_tests_bsim_bluetooth_ll_edtt_hci_test_app_${PRJ_CONF_2}\
-s=${SIMULATION_ID} -d=1 -v=${VERBOSITY_LEVEL_DEV2} -RealEncryption=1 -s=${SIMULATION_ID} -d=1 -v=${VERBOSITY_LEVEL_DEV2} -RealEncryption=1
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL_PHY} -s=${SIMULATION_ID} \ _Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL_PHY} -s=${SIMULATION_ID} \
-D=4 -sim_length=3600e6 -dump_imm $@ -D=4 -sim_length=3600e6 -dump_imm $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
exit $EXIT_CODE #the last exit code != 0

View file

@ -2,27 +2,17 @@
# Copyright 2019 Oticon A/S # Copyright 2019 Oticon A/S
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
# GATT regression tests based on the EDTTool # GATT regression tests based on the EDTTool
SIMULATION_ID="edtt_gatt_llcp" SIMULATION_ID="edtt_gatt_llcp"
VERBOSITY_LEVEL=2 VERBOSITY_LEVEL=2
PROCESS_IDS=""; EXIT_CODE=0 EXECUTE_TIMEOUT=300
CWD="$(cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P)" CWD="$(cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P)"
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 300 $@ & PROCESS_IDS="$PROCESS_IDS $!"
}
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
: "${EDTT_PATH:?EDTT_PATH must be defined}" : "${EDTT_PATH:?EDTT_PATH must be defined}"
#Give a default value to BOARD if it does not have one yet:
BOARD="${BOARD:-nrf52_bsim}"
cd ${EDTT_PATH} cd ${EDTT_PATH}
Execute ./src/edttool.py -s=${SIMULATION_ID} -d=0 --transport bsim \ Execute ./src/edttool.py -s=${SIMULATION_ID} -d=0 --transport bsim \
@ -42,7 +32,4 @@ Execute \
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \ Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${SIMULATION_ID} \
-D=3 -sim_length=3600e6 $@ -D=3 -sim_length=3600e6 $@
for PROCESS_ID in $PROCESS_IDS; do wait_for_background_jobs
wait $PROCESS_ID || let "EXIT_CODE=$?"
done
exit $EXIT_CODE #the last exit code != 0

View file

@ -2,25 +2,13 @@
# Copyright 2020 Nordic Semiconductor ASA # Copyright 2020 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
# Basic ISO broadcast test: a broadcaster transmits a BIS and a receiver listens # Basic ISO broadcast test: a broadcaster transmits a BIS and a receiver listens
# to the BIS. # to the BIS.
simulation_id="broadcast_iso" simulation_id="broadcast_iso"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=30
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 30 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -33,7 +21,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_ll_iso_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=30e6 $@ -D=2 -sim_length=30e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -2,25 +2,13 @@
# Copyright 2020 Nordic Semiconductor ASA # Copyright 2020 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
# Basic ISO broadcast test: a broadcaster transmits a BIS and a receiver listens # Basic ISO broadcast test: a broadcaster transmits a BIS and a receiver listens
# to the BIS, and recevied SDUs are emitted via vendor data path implementation. # to the BIS, and recevied SDUs are emitted via vendor data path implementation.
simulation_id="broadcast_iso_vs_dp" simulation_id="broadcast_iso_vs_dp"
verbosity_level=2 verbosity_level=2
process_ids=""; exit_code=0 EXECUTE_TIMEOUT=30
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 30 $@ & 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 cd ${BSIM_OUT_PATH}/bin
@ -33,7 +21,4 @@ Execute ./bs_${BOARD}_tests_bsim_bluetooth_ll_iso_prj_conf \
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
-D=2 -sim_length=30e6 $@ -D=2 -sim_length=30e6 $@
for process_id in $process_ids; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
exit $exit_code #the last exit code != 0

View file

@ -1,27 +1,9 @@
# Copyright 2021 Nordic Semiconductor # Copyright 2021 Nordic Semiconductor
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
process_ids=(); exit_code=0 source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
trap ctrl_c INT EXECUTE_TIMEOUT=300
function ctrl_c() {
echo "Aborted by CTRL-C"
conf=${conf:-prj_conf}
for process_id in ${process_ids[@]}; do
kill -15 $process_id
done
}
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 300 $@ & process_ids+=( $! )
}
function Skip(){ function Skip(){
for i in "${SKIP[@]}" ; do for i in "${SKIP[@]}" ; do
@ -86,16 +68,5 @@ function RunTest(){
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=$s_id -D=$count -argschannel -at=35 Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=$s_id -D=$count -argschannel -at=35
for process_id in ${process_ids[@]}; do wait_for_background_jobs
wait $process_id || let "exit_code=$?"
done
if [ "$exit_code" != "0" ] ; then
exit $exit_code #the last exit code != 0
fi
} }
: "${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}"

View file

@ -6,14 +6,11 @@
#set -x #uncomment this line for debugging #set -x #uncomment this line for debugging
set -ue set -ue
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
: "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}" : "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}"
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root\ : "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root\
directory}" directory}"
WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}" WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}"
BOARD="${BOARD:-nrf52_bsim}"
BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}" BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}"
mkdir -p ${WORK_DIR} mkdir -p ${WORK_DIR}

View file

@ -6,14 +6,12 @@
#set -x #uncomment this line for debugging #set -x #uncomment this line for debugging
set -ue set -ue
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
: "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}" : "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}"
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root\ : "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root\
directory}" directory}"
WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}" WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}"
BOARD="${BOARD:-nrf52_bsim}"
BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}" BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}"
mkdir -p ${WORK_DIR} mkdir -p ${WORK_DIR}

View file

@ -3,6 +3,12 @@
_process_ids=""; _process_ids="";
#All user scripts require these variable, let's check for them here already
: "${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}"
function run_in_background(){ function run_in_background(){
$@ & _process_ids="$_process_ids $!" $@ & _process_ids="$_process_ids $!"
} }
@ -12,5 +18,31 @@ function wait_for_background_jobs(){
for process_id in $_process_ids; do for process_id in $_process_ids; do
wait $process_id || let "exit_code=$?" wait $process_id || let "exit_code=$?"
done done
exit $exit_code #the last exit code != 0 [ $exit_code -eq 0 ] || exit $exit_code
} }
trap ctrl_c INT
function ctrl_c() {
echo "Aborted by CTRL-C"
for process_id in $_process_ids; do
kill -15 $process_id
done
}
function check_program_exists() {
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
}
function Execute() {
EXECUTE_TIMEOUT="${EXECUTE_TIMEOUT:-30}"
check_program_exists $1
run_in_background timeout ${EXECUTE_TIMEOUT} $@
}