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:
parent
d4d0907ede
commit
add1397e4a
89 changed files with 277 additions and 1214 deletions
|
@ -2,24 +2,10 @@
|
|||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
|
||||
|
||||
verbosity_level=2
|
||||
process_ids=""
|
||||
exit_code=0
|
||||
|
||||
function Execute() {
|
||||
if [ ! -f $1 ]; then
|
||||
echo -e " \e[91m$(pwd)/$(basename $1) cannot be found (did you forget to\
|
||||
compile it?)\e[39m"
|
||||
exit 1
|
||||
fi
|
||||
timeout 120 $@ &
|
||||
process_ids="$process_ids $!"
|
||||
}
|
||||
|
||||
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
|
||||
|
||||
#Give a default value to BOARD if it does not have one yet:
|
||||
BOARD="${BOARD:-nrf52_bsim}"
|
||||
EXECUTE_TIMEOUT=120
|
||||
|
||||
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} \
|
||||
-D=2 -sim_length=60e6 $@
|
||||
|
||||
for process_id in $process_ids; do
|
||||
wait $process_id || let "exit_code=$?"
|
||||
done
|
||||
exit $exit_code #the last exit code != 0
|
||||
wait_for_background_jobs
|
||||
|
|
|
@ -5,23 +5,12 @@
|
|||
# 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 write and read to and from a few GATT characteristics.
|
||||
|
||||
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
|
||||
|
||||
simulation_id="gatt"
|
||||
verbosity_level=2
|
||||
process_ids=""; exit_code=0
|
||||
|
||||
function Execute(){
|
||||
if [ ! -f $1 ]; then
|
||||
echo -e " \e[91m`pwd`/`basename $1` cannot be found (did you forget to\
|
||||
compile it?)\e[39m"
|
||||
exit 1
|
||||
fi
|
||||
timeout 120 $@ & process_ids="$process_ids $!"
|
||||
}
|
||||
|
||||
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
|
||||
|
||||
#Give a default value to BOARD if it does not have one yet:
|
||||
BOARD="${BOARD:-nrf52_bsim}"
|
||||
EXECUTE_TIMEOUT=120
|
||||
|
||||
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} \
|
||||
-D=2 -sim_length=60e6 $@
|
||||
|
||||
for process_id in $process_ids; do
|
||||
wait $process_id || let "exit_code=$?"
|
||||
done
|
||||
exit $exit_code #the last exit code != 0
|
||||
wait_for_background_jobs
|
||||
|
|
|
@ -1,25 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
set -eu
|
||||
|
||||
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
|
||||
|
||||
verbosity_level=2
|
||||
process_ids=""
|
||||
exit_code=0
|
||||
|
||||
function Execute() {
|
||||
if [ ! -f $1 ]; then
|
||||
echo -e " \e[91m$(pwd)/$(basename $1) cannot be found (did you forget to\
|
||||
compile it?)\e[39m"
|
||||
exit 1
|
||||
fi
|
||||
timeout 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}"
|
||||
EXECUTE_TIMEOUT=30
|
||||
|
||||
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} \
|
||||
-D=2 -sim_length=60e6 $@
|
||||
|
||||
for process_id in $process_ids; do
|
||||
wait $process_id || let "exit_code=$?"
|
||||
done
|
||||
exit $exit_code #the last exit code != 0
|
||||
wait_for_background_jobs
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -7,4 +6,3 @@ simulation_id="gatt_notify_enhanced_enhanced" \
|
|||
server_id="gatt_server_enhanced" \
|
||||
client_id="gatt_client_enhanced" \
|
||||
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -7,4 +6,3 @@ simulation_id="gatt_notify_enhanced_mixed" \
|
|||
server_id="gatt_server_enhanced" \
|
||||
client_id="gatt_client_mixed" \
|
||||
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -7,4 +6,3 @@ simulation_id="gatt_notify_enhanced_none" \
|
|||
server_id="gatt_server_enhanced" \
|
||||
client_id="gatt_client_none" \
|
||||
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -7,4 +6,3 @@ simulation_id="gatt_notify_enhanced_unenhanced" \
|
|||
server_id="gatt_server_enhanced" \
|
||||
client_id="gatt_client_unenhanced" \
|
||||
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -7,4 +6,3 @@ simulation_id="gatt_notify_mixed_enhanced" \
|
|||
server_id="gatt_server_mixed" \
|
||||
client_id="gatt_client_enhanced" \
|
||||
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -7,4 +6,3 @@ simulation_id="gatt_notify_mixed_mixed" \
|
|||
server_id="gatt_server_mixed" \
|
||||
client_id="gatt_client_mixed" \
|
||||
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -7,4 +6,3 @@ simulation_id="gatt_notify_mixed_none" \
|
|||
server_id="gatt_server_mixed" \
|
||||
client_id="gatt_client_none" \
|
||||
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -7,4 +6,3 @@ simulation_id="gatt_notify_mixed_unenhanced" \
|
|||
server_id="gatt_server_mixed" \
|
||||
client_id="gatt_client_unenhanced" \
|
||||
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -7,4 +6,3 @@ simulation_id="gatt_notify_none_enhanced" \
|
|||
server_id="gatt_server_none" \
|
||||
client_id="gatt_client_enhanced" \
|
||||
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -7,4 +6,3 @@ simulation_id="gatt_notify_none_mixed" \
|
|||
server_id="gatt_server_none" \
|
||||
client_id="gatt_client_mixed" \
|
||||
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -7,4 +6,3 @@ simulation_id="gatt_notify_none_none" \
|
|||
server_id="gatt_server_none" \
|
||||
client_id="gatt_client_none" \
|
||||
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -7,4 +6,3 @@ simulation_id="gatt_notify_none_unenhanced" \
|
|||
server_id="gatt_server_none" \
|
||||
client_id="gatt_client_unenhanced" \
|
||||
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -7,4 +6,3 @@ simulation_id="gatt_notify_unenhanced_enhanced" \
|
|||
server_id="gatt_server_unenhanced" \
|
||||
client_id="gatt_client_enhanced" \
|
||||
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -7,4 +6,3 @@ simulation_id="gatt_notify_unenhanced_mixed" \
|
|||
server_id="gatt_server_unenhanced" \
|
||||
client_id="gatt_client_mixed" \
|
||||
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -7,4 +6,3 @@ simulation_id="gatt_notify_unenhanced_none" \
|
|||
server_id="gatt_server_unenhanced" \
|
||||
client_id="gatt_client_none" \
|
||||
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
@ -7,4 +6,3 @@ simulation_id="gatt_notify_unenhanced_unenhanced" \
|
|||
server_id="gatt_server_unenhanced" \
|
||||
client_id="gatt_client_unenhanced" \
|
||||
$(dirname "${BASH_SOURCE[0]}")/_run_test.sh
|
||||
|
||||
|
|
|
@ -11,10 +11,8 @@
|
|||
# GDB can be run on the two devices at the same time without issues, just append
|
||||
# `debug` when running the script.
|
||||
|
||||
|
||||
simulation_id="notify_multiple"
|
||||
verbosity_level=2
|
||||
process_ids=""; exit_code=0
|
||||
|
||||
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
|
||||
|
||||
|
|
|
@ -1,24 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
set -eu
|
||||
|
||||
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
|
||||
|
||||
simulation_id="notify_multiple"
|
||||
verbosity_level=2
|
||||
process_ids=""; exit_code=0
|
||||
|
||||
function Execute(){
|
||||
if [ ! -f $1 ]; then
|
||||
echo -e " \e[91m`pwd`/`basename $1` cannot be found (did you forget to\
|
||||
compile it?)\e[39m"
|
||||
exit 1
|
||||
fi
|
||||
timeout 120 $@ & process_ids="$process_ids $!"
|
||||
}
|
||||
|
||||
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
|
||||
|
||||
#Give a default value to BOARD if it does not have one yet:
|
||||
BOARD="${BOARD:-nrf52_bsim}"
|
||||
EXECUTE_TIMEOUT=120
|
||||
|
||||
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} \
|
||||
-D=2 -sim_length=60e6 $@
|
||||
|
||||
for process_id in $process_ids; do
|
||||
wait $process_id || let "exit_code=$?"
|
||||
done
|
||||
exit $exit_code #the last exit code != 0
|
||||
wait_for_background_jobs
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2023 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -eu
|
||||
|
||||
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
|
||||
|
||||
# Read variable definitions output by _env.sh
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
set -eu
|
||||
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
|
||||
|
||||
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
|
||||
|
||||
test_name="$(basename "$(realpath "$bash_source_dir/..")")"
|
||||
bsim_bin="${BSIM_OUT_PATH}/bin"
|
||||
BOARD="${BOARD:-nrf52_bsim}"
|
||||
|
|
|
@ -1,27 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -eu
|
||||
|
||||
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
|
||||
|
||||
source "${bash_source_dir}/_env.sh"
|
||||
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
|
||||
|
||||
simulation_id="${test_name}"
|
||||
verbosity_level=2
|
||||
process_ids=""
|
||||
exit_code=0
|
||||
|
||||
function Execute() {
|
||||
if [ ! -f $1 ]; then
|
||||
echo -e " \e[91m$(pwd)/$(basename $1) cannot be found (did you forget to\
|
||||
compile it?)\e[39m"
|
||||
exit 1
|
||||
fi
|
||||
$@ &
|
||||
process_ids="$process_ids $!"
|
||||
}
|
||||
|
||||
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
|
||||
EXECUTE_TIMEOUT=30
|
||||
|
||||
cd ${BSIM_OUT_PATH}/bin
|
||||
|
||||
|
@ -57,7 +46,4 @@ 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"
|
||||
|
||||
for process_id in $process_ids; do
|
||||
wait $process_id || let "exit_code=$?"
|
||||
done
|
||||
exit $exit_code #the last exit code != 0
|
||||
wait_for_background_jobs
|
||||
|
|
|
@ -1,27 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -eu
|
||||
|
||||
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
|
||||
|
||||
source "${bash_source_dir}/_env.sh"
|
||||
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
|
||||
|
||||
simulation_id="${test_name}_2"
|
||||
verbosity_level=2
|
||||
process_ids=""
|
||||
exit_code=0
|
||||
|
||||
function Execute() {
|
||||
if [ ! -f $1 ]; then
|
||||
echo -e " \e[91m$(pwd)/$(basename $1) cannot be found (did you forget to\
|
||||
compile it?)\e[39m"
|
||||
exit 1
|
||||
fi
|
||||
$@ &
|
||||
process_ids="$process_ids $!"
|
||||
}
|
||||
|
||||
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
|
||||
EXECUTE_TIMEOUT=120
|
||||
|
||||
cd ${BSIM_OUT_PATH}/bin
|
||||
|
||||
|
@ -57,7 +46,4 @@ 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"
|
||||
|
||||
for process_id in $process_ids; do
|
||||
wait $process_id || let "exit_code=$?"
|
||||
done
|
||||
exit $exit_code #the last exit code != 0
|
||||
wait_for_background_jobs
|
||||
|
|
|
@ -2,24 +2,12 @@
|
|||
# Copyright 2018 Oticon A/S
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
|
||||
|
||||
# Multiple connection between two devices with multiple peripheral identity
|
||||
simulation_id="gatt_write"
|
||||
verbosity_level=2
|
||||
process_ids=""; exit_code=0
|
||||
|
||||
function Execute(){
|
||||
if [ ! -f $1 ]; then
|
||||
echo -e " \e[91m`pwd`/`basename $1` cannot be found (did you forget to\
|
||||
compile it?)\e[39m"
|
||||
exit 1
|
||||
fi
|
||||
timeout 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}"
|
||||
EXECUTE_TIMEOUT=60
|
||||
|
||||
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} \
|
||||
-D=2 -sim_length=60e6 $@
|
||||
|
||||
for process_id in $process_ids; do
|
||||
wait $process_id || let "exit_code=$?"
|
||||
done
|
||||
exit $exit_code #the last exit code != 0
|
||||
wait_for_background_jobs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue