Skip to content

Commit 4169b64

Browse files
committed
tests: Bluetooth: Split CAP and GMAP AC tests into separate scripts
This commit splits the CAP and GMAP audio configuration (AC) tests into separate scripts. The purpose of this is to reduce the runtime of the individual scripts (some, like the cap_ac_11, tests takes a long time to run all combinations). This split also improves support for running them in parallel. An additional, positive, side effect of this is that the logs will also be smaller per run. The new scripts can be run directly, or via the e.g. _cap_ac_X.sh scripts that run entire audio configuration for all presets. The design of how the parameters are passed around, are based on variable instead of function arguments. Effectively they can be used for the same thing, but variables have the advantage that it is easier to deal with longer names, and that any of the test scripts can be called with additional arguments that can, when using variables, easily be forwarded to the call to Execute for the PHY in the _ac_common.sh. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 1596cc5 commit 4169b64

File tree

567 files changed

+3880
-1817
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

567 files changed

+3880
-1817
lines changed

tests/bsim/bluetooth/audio/test_scripts/_cap_broadcast.sh

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env bash
2-
#
32
# Copyright (c) 2025 Nordic Semiconductor ASA
4-
#
53
# SPDX-License-Identifier: Apache-2.0
64

75
dir_path=$(dirname "$0")

tests/bsim/bluetooth/audio/test_scripts/_cap_unicast.sh

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env bash
2-
#
32
# Copyright (c) 2025 Nordic Semiconductor ASA
4-
#
53
# SPDX-License-Identifier: Apache-2.0
64

75
dir_path=$(dirname "$0")

tests/bsim/bluetooth/audio/test_scripts/_gmap.sh

-22
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
6+
7+
VERBOSITY_LEVEL=2
8+
EXECUTE_TIMEOUT=60
9+
BSIM_EXE=./bs_${BOARD_TS}_tests_bsim_bluetooth_audio_prj_conf
10+
11+
cd ${BSIM_OUT_PATH}/bin
12+
13+
function Execute_ac() {
14+
if [[ -n $ac_tx_preset ]]; then
15+
ac_tx_preset_arg="${ac_tx_preset_arg_name} ${ac_tx_preset}"
16+
else
17+
ac_tx_preset_arg=""
18+
fi
19+
20+
if [[ -n $ac_rx_preset ]]; then
21+
ac_rx_preset_arg="source_preset ${ac_rx_preset}"
22+
else
23+
ac_rx_preset_arg=""
24+
fi
25+
26+
27+
sim_id="${ac_profile}_ac_${ac_config}_${ac_tx_preset}_${ac_rx_preset}"
28+
29+
printf "\n\n======== Running %s AC_%s with %s %s =========\n\n" \
30+
"${ac_profile}" "${ac_config}" "${ac_tx_preset_arg}" "${ac_rx_preset_arg}"
31+
32+
let ac_device_count=1+${ac_acc_cnt}
33+
ac_ini_name=${ac_ini_name}_${ac_config}
34+
35+
Execute ${BSIM_EXE} -v=${VERBOSITY_LEVEL} -s=${sim_id} -d=0 -testid=${ac_ini_name} \
36+
-RealEncryption=1 -rs=23 -D=${ac_device_count} \
37+
-argstest ${ac_tx_preset_arg} ${ac_rx_preset_arg}
38+
39+
for i in $(seq 1 $ac_acc_cnt); do
40+
let rs=${i}*7 # ensure unique random seed value per acceptor
41+
42+
Execute ${BSIM_EXE} -v=${VERBOSITY_LEVEL} -s=${sim_id} -d=${i} -testid=${ac_acc_name} \
43+
-RealEncryption=1 -rs=${rs} -D=${ac_device_count}
44+
done
45+
46+
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${sim_id} -D=${ac_device_count} \
47+
-sim_length=60e6 $@
48+
49+
wait_for_background_jobs
50+
}
51+
52+
function Execute_cap_unicast_ac() {
53+
ac_profile="CAP" ac_ini_name=cap_initiator_ac ac_acc_name=cap_acceptor_unicast \
54+
ac_tx_preset_arg_name=sink_preset Execute_ac $@
55+
}
56+
57+
function Execute_cap_broadcast_ac() {
58+
ac_profile="CAP" ac_ini_name=cap_initiator_ac ac_acc_name=cap_acceptor_broadcast \
59+
ac_tx_preset_arg_name=preset Execute_ac $@
60+
}
61+
62+
function Execute_gmap_unicast_ac() {
63+
ac_profile="GMAP" ac_ini_name=gmap_ugg_ac ac_acc_name=gmap_ugt \
64+
ac_tx_preset_arg_name=sink_preset Execute_ac $@
65+
}
66+
67+
function Execute_gmap_broadcast_ac() {
68+
ac_profile="GMAP" ac_ini_name=gmap_ugg_ac ac_acc_name=cap_acceptor_broadcast \
69+
ac_tx_preset_arg_name=broadcast_preset Execute_ac $@
70+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
set -e # Exit on error
8+
9+
# Run all cap_ac_1* tests
10+
for file in "$dir_path"/_cap_ac_*.sh; do
11+
if [ -f "$file" ]; then
12+
echo "Running $file"
13+
$file
14+
fi
15+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_1_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_10_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_11_i_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_11_ii_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_12_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_13_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_14_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_2_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_3_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_4_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_5_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_6_i_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_6_ii_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_7_i_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_7_ii_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
set -e # Exit on error
8+
9+
SEARCH_PATH="${dir_path}"/cap_ac_8_i_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_8_ii_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_9_ii_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/cap_ac_9_i_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
set -e # Exit on error
8+
9+
# Run all cap_ac_1* tests
10+
for file in "$dir_path"/_gmap_ac_*.sh; do
11+
if [ -f "$file" ]; then
12+
echo "Running $file"
13+
$file
14+
fi
15+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/gmap_ac_1_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/gmap_ac_11_i_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/gmap_ac_11_ii_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/gmap_ac_12_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/gmap_ac_13_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/gmap_ac_14_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/gmap_ac_2_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/gmap_ac_3_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/gmap_ac_4_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/gmap_ac_5_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/gmap_ac_6_i_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/gmap_ac_6_ii_*.sh tests/bsim/run_parallel.sh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
dir_path=$(dirname "$0")
6+
7+
SEARCH_PATH="${dir_path}"/gmap_ac_7_ii_*.sh tests/bsim/run_parallel.sh

0 commit comments

Comments
 (0)