tests/bsim bt host/privacy/*: Tests scripts cleanup
Ensure we call the common source script before using the BOARD variable; Use the common scripts to perform common functions and do a cleanup. Do not set variables to their defaults, set things closer to were they are needed; Do not perform unnecesary checks; And in general avoid unnecessary complexity. And for the 2 parts of the peripheral rpa sharing test, use different sim_ids, so the traces for each part can be checked. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
parent
e9c6f37daf
commit
06326dc8c2
14 changed files with 48 additions and 116 deletions
|
@ -3,19 +3,11 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -eu
|
||||
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
|
||||
|
||||
source "${bash_source_dir}/_env.sh"
|
||||
|
||||
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
|
||||
: "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}"
|
||||
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be defined}"
|
||||
|
||||
WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}"
|
||||
BOARD="${BOARD:-nrf52_bsim}"
|
||||
BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}"
|
||||
INCR_BUILD=1
|
||||
mkdir -p ${WORK_DIR}
|
||||
source ${ZEPHYR_BASE}/tests/bsim/compile.source
|
||||
|
||||
west build -b nrf52_bsim
|
||||
cp build/zephyr/zephyr.exe $central_exe
|
||||
app="$(guess_test_relpath)" _compile
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
#!/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]}")")"
|
||||
|
||||
bsim_bin="${BSIM_OUT_PATH}/bin"
|
||||
BOARD="${BOARD:-nrf52_bsim}"
|
||||
central_exe="${bsim_bin}/bs_${BOARD}_tests_bsim_bluetooth_host_privacy_central_prj_conf"
|
||||
peripheral_exe="${central_exe}"
|
|
@ -3,14 +3,13 @@
|
|||
# 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
|
||||
|
||||
verbosity_level=2
|
||||
simulation_id="$(basename "$(realpath "$bash_source_dir/..")")"
|
||||
EXECUTE_TIMEOUT=30
|
||||
simulation_id="$(guess_test_long_name)"
|
||||
|
||||
central_exe="${BSIM_OUT_PATH}/bin/bs_${BOARD}_$(guess_test_long_name)_prj_conf"
|
||||
peripheral_exe="${central_exe}"
|
||||
|
||||
cd ${BSIM_OUT_PATH}/bin
|
||||
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
#!/bin/env bash
|
||||
#!/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]}")")"
|
||||
|
||||
source "${bash_source_dir}/_env.sh"
|
||||
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be defined}"
|
||||
|
||||
west build -b nrf52_bsim && \
|
||||
cp -v build/zephyr/zephyr.exe "${test_exe}"
|
||||
WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}"
|
||||
INCR_BUILD=1
|
||||
source ${ZEPHYR_BASE}/tests/bsim/compile.source
|
||||
|
||||
app="$(guess_test_relpath)" _compile
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/env bash
|
||||
# Copyright 2023 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -eu
|
||||
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
|
||||
|
||||
: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}"
|
||||
|
||||
bsim_bin="${BSIM_OUT_PATH}/bin"
|
||||
BOARD="${BOARD:-nrf52_bsim}"
|
||||
test_exe="${bsim_bin}/bs_${BOARD}_tests_bsim_bluetooth_host_privacy_device_prj_conf"
|
|
@ -3,14 +3,12 @@
|
|||
# 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
|
||||
|
||||
verbosity_level=2
|
||||
simulation_id="$(basename "$(realpath "$bash_source_dir/..")")"
|
||||
EXECUTE_TIMEOUT=30
|
||||
simulation_id="$(guess_test_long_name)"
|
||||
test_exe="${BSIM_OUT_PATH}/bin/bs_${BOARD}_$(guess_test_long_name)_prj_conf"
|
||||
|
||||
cd ${BSIM_OUT_PATH}/bin
|
||||
|
||||
|
|
|
@ -3,13 +3,11 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -eu
|
||||
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
|
||||
|
||||
# Read variable definitions output by _env.sh
|
||||
source "${bash_source_dir}/_env.sh"
|
||||
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be defined}"
|
||||
|
||||
# terminate running simulations (if any)
|
||||
${BSIM_COMPONENTS_PATH}/common/stop_bsim.sh
|
||||
WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}"
|
||||
INCR_BUILD=1
|
||||
source ${ZEPHYR_BASE}/tests/bsim/compile.source
|
||||
|
||||
west build -b nrf52_bsim && \
|
||||
cp build/zephyr/zephyr.exe $central_exe
|
||||
app="$(guess_test_relpath)" _compile
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
#!/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]}")")"
|
||||
|
||||
bsim_bin="${BSIM_OUT_PATH}/bin"
|
||||
BOARD="${BOARD:-nrf52_bsim}"
|
||||
central_exe="${bsim_bin}/bs_${BOARD}_tests_bsim_bluetooth_host_privacy_legacy_prj_conf"
|
||||
peripheral_exe="${central_exe}"
|
|
@ -3,14 +3,13 @@
|
|||
# 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
|
||||
|
||||
verbosity_level=2
|
||||
simulation_id="$(basename "$(realpath "$bash_source_dir/..")")"
|
||||
EXECUTE_TIMEOUT=30
|
||||
simulation_id="$(guess_test_long_name)"
|
||||
central_exe="${BSIM_OUT_PATH}/bin/bs_${BOARD}_$(guess_test_long_name)_prj_conf"
|
||||
peripheral_exe="${central_exe}"
|
||||
|
||||
cd ${BSIM_OUT_PATH}/bin
|
||||
|
||||
|
|
|
@ -3,10 +3,16 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -eu
|
||||
bash_source_dir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
|
||||
|
||||
# Read variable definitions output by _env.sh
|
||||
source "${bash_source_dir}/_env.sh"
|
||||
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be defined}"
|
||||
|
||||
west build -b nrf52_bsim && \
|
||||
cp build/zephyr/zephyr.exe $central_exe
|
||||
WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}"
|
||||
INCR_BUILD=1
|
||||
|
||||
source ${ZEPHYR_BASE}/tests/bsim/compile.source
|
||||
|
||||
app="$(guess_test_relpath)" compile
|
||||
app="$(guess_test_relpath)" conf_file=prj_rpa_expired.conf compile
|
||||
app="$(guess_test_relpath)" conf_file=prj_rpa_sharing.conf compile
|
||||
|
||||
wait_for_background_jobs
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
#!/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]}")")"
|
||||
|
||||
bsim_bin="${BSIM_OUT_PATH}/bin"
|
||||
BOARD="${BOARD:-nrf52_bsim}"
|
||||
central_exe="${bsim_bin}/bs_${BOARD}_tests_bsim_bluetooth_host_privacy_peripheral_prj_conf"
|
||||
peripheral_exe="${central_exe}"
|
||||
central_exe_rpa_sharing="\
|
||||
${bsim_bin}/bs_${BOARD}_tests_bsim_bluetooth_host_privacy_peripheral_prj_rpa_sharing_conf"
|
||||
peripheral_exe_rpa_sharing="${central_exe_rpa_sharing}"
|
|
@ -3,14 +3,13 @@
|
|||
# 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
|
||||
|
||||
verbosity_level=2
|
||||
simulation_id="host_privacy_peripheral"
|
||||
EXECUTE_TIMEOUT=30
|
||||
|
||||
central_exe="${BSIM_OUT_PATH}/bin/bs_${BOARD}_$(guess_test_long_name)_prj_conf"
|
||||
peripheral_exe="${central_exe}"
|
||||
|
||||
cd ${BSIM_OUT_PATH}/bin
|
||||
|
||||
|
@ -18,12 +17,10 @@ Execute "$central_exe" \
|
|||
-v=${verbosity_level} -s=${simulation_id} -d=0 -testid=central -RealEncryption=1 \
|
||||
-flash="${simulation_id}.central.log.bin" -flash_erase
|
||||
|
||||
|
||||
Execute "$peripheral_exe" \
|
||||
-v=${verbosity_level} -s=${simulation_id} -d=1 -testid=peripheral -RealEncryption=1 \
|
||||
-flash="${simulation_id}.peripheral.log.bin" -flash_erase
|
||||
|
||||
|
||||
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
|
||||
-D=2 -sim_length=70e6 $@
|
||||
|
||||
|
@ -33,12 +30,10 @@ Execute "$central_exe" \
|
|||
-v=${verbosity_level} -s=${simulation_id}.2 -d=0 -testid=central -RealEncryption=1 \
|
||||
-flash="${simulation_id}.central.log.bin" -flash_rm
|
||||
|
||||
|
||||
Execute "$peripheral_exe" \
|
||||
-v=${verbosity_level} -s=${simulation_id}.2 -d=1 -testid=peripheral -RealEncryption=1 \
|
||||
-flash="${simulation_id}.peripheral.log.bin" -flash_rm
|
||||
|
||||
|
||||
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id}.2 \
|
||||
-D=2 -sim_length=70e6 $@
|
||||
|
||||
|
|
|
@ -3,21 +3,17 @@
|
|||
# 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
|
||||
|
||||
verbosity_level=2
|
||||
simulation_id="rpa_expired"
|
||||
EXECUTE_TIMEOUT=30
|
||||
|
||||
cd ${BSIM_OUT_PATH}/bin
|
||||
|
||||
central_exe_rpa_expired="\
|
||||
${bsim_bin}/bs_${BOARD}_tests_bsim_bluetooth_host_privacy_peripheral_prj_rpa_expired_conf"
|
||||
${BSIM_OUT_PATH}/bin/bs_${BOARD}_$(guess_test_long_name)_prj_rpa_expired_conf"
|
||||
peripheral_exe_rpa_expired="${central_exe_rpa_expired}"
|
||||
|
||||
cd ${BSIM_OUT_PATH}/bin
|
||||
|
||||
Execute "$central_exe_rpa_expired" \
|
||||
-v=${verbosity_level} -s=${simulation_id} -d=0 -testid=central_rpa_check \
|
||||
-RealEncryption=1 -flash="${simulation_id}.central.log.bin" -flash_erase
|
||||
|
|
|
@ -3,15 +3,14 @@
|
|||
# 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
|
||||
|
||||
verbosity_level=2
|
||||
simulation_id="$(basename "$(realpath "$bash_source_dir/..")")"
|
||||
simulation_id="${simulation_id}_rpa_sharing"
|
||||
EXECUTE_TIMEOUT=30
|
||||
simulation_id="$(guess_test_long_name)_rpa_sharing"
|
||||
|
||||
central_exe_rpa_sharing="\
|
||||
${BSIM_OUT_PATH}/bin/bs_${BOARD}_$(guess_test_long_name)_prj_rpa_sharing_conf"
|
||||
peripheral_exe_rpa_sharing="${central_exe_rpa_sharing}"
|
||||
|
||||
cd ${BSIM_OUT_PATH}/bin
|
||||
|
||||
|
@ -19,28 +18,24 @@ Execute "$central_exe_rpa_sharing" \
|
|||
-v=${verbosity_level} -s=${simulation_id} -d=0 -testid=central -RealEncryption=1 \
|
||||
-flash="${simulation_id}.central.log.bin"
|
||||
|
||||
|
||||
Execute "$peripheral_exe_rpa_sharing" \
|
||||
-v=${verbosity_level} -s=${simulation_id} -d=1 -testid=peripheral -RealEncryption=1 \
|
||||
-flash="${simulation_id}.peripheral.log.bin"
|
||||
|
||||
|
||||
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
|
||||
-D=2 -sim_length=70e6 $@
|
||||
|
||||
wait_for_background_jobs
|
||||
|
||||
Execute "$central_exe_rpa_sharing" \
|
||||
-v=${verbosity_level} -s=${simulation_id} -d=0 -testid=central -RealEncryption=1 \
|
||||
-v=${verbosity_level} -s=${simulation_id}_2 -d=0 -testid=central -RealEncryption=1 \
|
||||
-flash="${simulation_id}.central.log.bin" -flash_rm
|
||||
|
||||
|
||||
Execute "$peripheral_exe_rpa_sharing" \
|
||||
-v=${verbosity_level} -s=${simulation_id} -d=1 -testid=peripheral -RealEncryption=1 \
|
||||
-v=${verbosity_level} -s=${simulation_id}_2 -d=1 -testid=peripheral -RealEncryption=1 \
|
||||
-flash="${simulation_id}.peripheral.log.bin" -flash_rm
|
||||
|
||||
|
||||
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
|
||||
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id}_2 \
|
||||
-D=2 -sim_length=70e6 $@
|
||||
|
||||
wait_for_background_jobs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue