Skip to content

Commit 825e65e

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. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
1 parent 1596cc5 commit 825e65e

File tree

550 files changed

+4035
-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.

550 files changed

+4035
-1817
lines changed

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

Lines changed: 0 additions & 2 deletions
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

Lines changed: 0 additions & 2 deletions
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

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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+
local profile=""
15+
local audio_config=""
16+
local sink_preset=""
17+
local source_preset=""
18+
local acceptor_count=""
19+
local initiator_test_id=""
20+
local acceptor_test_id=""
21+
22+
OPTIND=1 # Reset OPTIND at the start of the function
23+
24+
while getopts "p:c:t:r:n:i:a:q:h" option; do
25+
case "${option}" in
26+
p)
27+
profile=${OPTARG}
28+
;;
29+
c)
30+
audio_config=${OPTARG}
31+
;;
32+
t)
33+
sink_preset=${OPTARG} # TX preset
34+
;;
35+
r)
36+
source_preset=${OPTARG} # RX preset
37+
;;
38+
n)
39+
acceptor_count=${OPTARG}
40+
;;
41+
i)
42+
initiator_test_id=${OPTARG}
43+
;;
44+
a)
45+
acceptor_test_id=${OPTARG}
46+
;;
47+
q)
48+
sink_preset_arg_name=${OPTARG}
49+
;;
50+
h)
51+
echo "Usage: $0 [-p profile] [-c audio_configuration] [-t sink_preset] " \
52+
"[-r source_preset] [-n acceptor_count] [-i initiator_test_id] " \
53+
"[-a acceptor_test_id] [-q sink_preset_arg_name] [-h]"
54+
return 0
55+
;;
56+
*)
57+
echo "Invalid option. Use -h for help."
58+
return 1
59+
;;
60+
esac
61+
done
62+
63+
if [[ -n $sink_preset ]]; then
64+
sink_preset_arg="${sink_preset_arg_name} ${sink_preset}"
65+
else
66+
sink_preset_arg=""
67+
fi
68+
69+
if [[ -n $source_preset ]]; then
70+
source_preset_arg="source_preset ${source_preset}"
71+
else
72+
source_preset_arg=""
73+
fi
74+
75+
76+
sim_id="cap_unicast_ac_${audio_config}_${sink_preset}_${source_preset}"
77+
78+
printf "\n\n======== Running %s AC_%s with %s %s =========\n\n" \
79+
"${profile}" "${audio_config}" "${sink_preset_arg}" "${source_preset_arg}"
80+
81+
let device_count=1+${acceptor_count}
82+
initiator_test_id=${initiator_test_id}_${audio_config}
83+
84+
Execute ${BSIM_EXE} -v=${VERBOSITY_LEVEL} -s=${sim_id} -d=0 -testid=${initiator_test_id} \
85+
-RealEncryption=1 -rs=23 -D=${device_count} \
86+
-argstest ${sink_preset_arg} ${source_preset_arg}
87+
88+
for i in $(seq 1 $acceptor_count); do
89+
let rs=${i}*7 # ensure unique random seed value per acceptor
90+
91+
Execute ${BSIM_EXE} -v=${VERBOSITY_LEVEL} -s=${sim_id} -d=${i} -testid=${acceptor_test_id} \
92+
-RealEncryption=1 -rs=${rs} -D=${device_count}
93+
done
94+
95+
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${sim_id} -D=${device_count} -sim_length=60e6
96+
97+
wait_for_background_jobs
98+
}
99+
100+
function Execute_cap_unicast_ac() {
101+
Execute_ac -p "CAP" -i cap_initiator_ac -a cap_acceptor_unicast -q sink_preset "$@"
102+
}
103+
104+
function Execute_cap_broadcast_ac() {
105+
Execute_ac -p "CAP" -i cap_initiator_ac -a cap_acceptor_broadcast -q preset "$@"
106+
}
107+
108+
function Execute_gmap_unicast_ac() {
109+
Execute_ac -p "GMAP" -i gmap_ugg_ac -a gmap_ugt -q sink_preset "$@"
110+
}
111+
112+
function Execute_gmap_broadcast_ac() {
113+
Execute_ac -p "GMAP" -i gmap_ugg_ac -a gmap_ugt -q broadcast_preset "$@"
114+
}
Lines changed: 15 additions & 0 deletions
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
Lines changed: 15 additions & 0 deletions
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_1*.sh; do
11+
if [ -f "$file" ]; then
12+
echo "Running $file"
13+
$file
14+
fi
15+
done
Lines changed: 15 additions & 0 deletions
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_10* tests
10+
for file in "$dir_path"/cap_ac_10*.sh; do
11+
if [ -f "$file" ]; then
12+
echo "Running $file"
13+
$file
14+
fi
15+
done
Lines changed: 15 additions & 0 deletions
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_11* tests
10+
for file in "$dir_path"/cap_ac_11*.sh; do
11+
if [ -f "$file" ]; then
12+
echo "Running $file"
13+
$file
14+
fi
15+
done
Lines changed: 15 additions & 0 deletions
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_11_i* tests
10+
for file in "$dir_path"/cap_ac_11_i*.sh; do
11+
if [ -f "$file" ]; then
12+
echo "Running $file"
13+
$file
14+
fi
15+
done
Lines changed: 15 additions & 0 deletions
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_11_ii* tests
10+
for file in "$dir_path"/cap_ac_11_ii*.sh; do
11+
if [ -f "$file" ]; then
12+
echo "Running $file"
13+
$file
14+
fi
15+
done

0 commit comments

Comments
 (0)