Skip to content

Commit ae706fb

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 <[email protected]>
1 parent 1596cc5 commit ae706fb

File tree

545 files changed

+5055
-1807
lines changed

Some content is hidden

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

545 files changed

+5055
-1807
lines changed

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

-22
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025 Nordic Semiconductor ASA
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
8+
9+
VERBOSITY_LEVEL=2
10+
EXECUTE_TIMEOUT=60
11+
BSIM_EXE=./bs_${BOARD_TS}_tests_bsim_bluetooth_audio_prj_conf
12+
13+
cd ${BSIM_OUT_PATH}/bin
14+
15+
function Execute_ac() {
16+
local profile=""
17+
local audio_config=""
18+
local sink_preset=""
19+
local source_preset=""
20+
local acceptor_count=""
21+
local initiator_test_id=""
22+
local acceptor_test_id=""
23+
24+
OPTIND=1 # Reset OPTIND at the start of the function
25+
26+
while getopts "p:c:t:r:n:i:a:q:h" option; do
27+
case "${option}" in
28+
p)
29+
profile=${OPTARG}
30+
;;
31+
c)
32+
audio_config=${OPTARG}
33+
;;
34+
t)
35+
sink_preset=${OPTARG} # TX preset
36+
;;
37+
r)
38+
source_preset=${OPTARG} # RX preset
39+
;;
40+
n)
41+
acceptor_count=${OPTARG}
42+
;;
43+
i)
44+
initiator_test_id=${OPTARG}
45+
;;
46+
a)
47+
acceptor_test_id=${OPTARG}
48+
;;
49+
q)
50+
sink_preset_arg_name=${OPTARG}
51+
;;
52+
h)
53+
echo "Usage: $0 [-p profile] [-c audio_configuration] [-t sink_preset] " \
54+
"[-r source_preset] [-n acceptor_count] [-i initiator_test_id] " \
55+
"[-a acceptor_test_id] [-q sink_preset_arg_name] [-h]"
56+
return 0
57+
;;
58+
*)
59+
echo "Invalid option. Use -h for help."
60+
return 1
61+
;;
62+
esac
63+
done
64+
65+
if [[ -n $sink_preset ]]; then
66+
sink_preset_arg="${sink_preset_arg_name} ${sink_preset}"
67+
else
68+
sink_preset_arg=""
69+
fi
70+
71+
if [[ -n $source_preset ]]; then
72+
source_preset_arg="source_preset ${source_preset}"
73+
else
74+
source_preset_arg=""
75+
fi
76+
77+
78+
sim_id="cap_unicast_ac_${audio_config}_${sink_preset}_${source_preset}"
79+
80+
printf "\n\n======== Running %s AC_%s with %s %s =========\n\n" \
81+
"${profile}" "${audio_config}" "${sink_preset_arg}" "${source_preset_arg}"
82+
83+
let device_count=1+${acceptor_count}
84+
initiator_test_id=${initiator_test_id}_${audio_config}
85+
86+
Execute ${BSIM_EXE} -v=${VERBOSITY_LEVEL} -s=${sim_id} -d=0 -testid=${initiator_test_id} \
87+
-RealEncryption=1 -rs=23 -D=${device_count} \
88+
-argstest ${sink_preset_arg} ${source_preset_arg}
89+
90+
for i in $(seq 1 $acceptor_count); do
91+
let rs=${i}*7 # ensure unique RS value per acceptor
92+
93+
Execute ${BSIM_EXE} -v=${VERBOSITY_LEVEL} -s=${sim_id} -d=${i} -testid=${acceptor_test_id} \
94+
-RealEncryption=1 -rs=${rs} -D=${device_count}
95+
done
96+
97+
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY_LEVEL} -s=${sim_id} -D=${device_count} -sim_length=60e6
98+
99+
wait_for_background_jobs
100+
}
101+
102+
function Execute_cap_unicast_ac() {
103+
Execute_ac -p "CAP" -i cap_initiator_ac -a cap_acceptor_unicast -q sink_preset "$@"
104+
}
105+
106+
function Execute_cap_broadcast_ac() {
107+
Execute_ac -p "CAP" -i cap_initiator_ac -a cap_acceptor_broadcast -q preset "$@"
108+
}
109+
110+
function Execute_gmap_unicast_ac() {
111+
Execute_ac -p "GMAP" -i gmap_ugg_ac -a gmap_ugt -q sink_preset "$@"
112+
}
113+
114+
function Execute_gmap_broadcast_ac() {
115+
Execute_ac -p "GMAP" -i gmap_ugg_ac -a gmap_ugt -q broadcast_preset "$@"
116+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025 Nordic Semiconductor ASA
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
dir_path=$(dirname "$0")
8+
9+
set -e # Exit on error
10+
11+
# Run all cap_ac_1* tests
12+
for file in "$dir_path"/_cap_ac_*.sh; do
13+
if [ -f "$file" ]; then
14+
echo "Running $file"
15+
$file
16+
fi
17+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025 Nordic Semiconductor ASA
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
dir_path=$(dirname "$0")
8+
9+
set -e # Exit on error
10+
11+
# Run all cap_ac_1* tests
12+
for file in "$dir_path"/cap_ac_1*.sh; do
13+
if [ -f "$file" ]; then
14+
echo "Running $file"
15+
$file
16+
fi
17+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025 Nordic Semiconductor ASA
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
dir_path=$(dirname "$0")
8+
9+
set -e # Exit on error
10+
11+
# Run all cap_ac_10* tests
12+
for file in "$dir_path"/cap_ac_10*.sh; do
13+
if [ -f "$file" ]; then
14+
echo "Running $file"
15+
$file
16+
fi
17+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025 Nordic Semiconductor ASA
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
dir_path=$(dirname "$0")
8+
9+
set -e # Exit on error
10+
11+
# Run all cap_ac_11* tests
12+
for file in "$dir_path"/cap_ac_11*.sh; do
13+
if [ -f "$file" ]; then
14+
echo "Running $file"
15+
$file
16+
fi
17+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025 Nordic Semiconductor ASA
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
dir_path=$(dirname "$0")
8+
9+
set -e # Exit on error
10+
11+
# Run all cap_ac_11_i* tests
12+
for file in "$dir_path"/cap_ac_11_i*.sh; do
13+
if [ -f "$file" ]; then
14+
echo "Running $file"
15+
$file
16+
fi
17+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025 Nordic Semiconductor ASA
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
dir_path=$(dirname "$0")
8+
9+
set -e # Exit on error
10+
11+
# Run all cap_ac_11_ii* tests
12+
for file in "$dir_path"/cap_ac_11_ii*.sh; do
13+
if [ -f "$file" ]; then
14+
echo "Running $file"
15+
$file
16+
fi
17+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025 Nordic Semiconductor ASA
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
dir_path=$(dirname "$0")
8+
9+
set -e # Exit on error
10+
11+
# Run all cap_ac_12* tests
12+
for file in "$dir_path"/cap_ac_12*.sh; do
13+
if [ -f "$file" ]; then
14+
echo "Running $file"
15+
$file
16+
fi
17+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025 Nordic Semiconductor ASA
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
dir_path=$(dirname "$0")
8+
9+
set -e # Exit on error
10+
11+
# Run all cap_ac_13* tests
12+
for file in "$dir_path"/cap_ac_13*.sh; do
13+
if [ -f "$file" ]; then
14+
echo "Running $file"
15+
$file
16+
fi
17+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025 Nordic Semiconductor ASA
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
dir_path=$(dirname "$0")
8+
9+
set -e # Exit on error
10+
11+
# Run all cap_ac_14* tests
12+
for file in "$dir_path"/cap_ac_14*.sh; do
13+
if [ -f "$file" ]; then
14+
echo "Running $file"
15+
$file
16+
fi
17+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025 Nordic Semiconductor ASA
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
dir_path=$(dirname "$0")
8+
9+
set -e # Exit on error
10+
11+
# Run all cap_ac_2* tests
12+
for file in "$dir_path"/cap_ac_2*.sh; do
13+
if [ -f "$file" ]; then
14+
echo "Running $file"
15+
$file
16+
fi
17+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025 Nordic Semiconductor ASA
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
dir_path=$(dirname "$0")
8+
9+
set -e # Exit on error
10+
11+
# Run all cap_ac_3* tests
12+
for file in "$dir_path"/cap_ac_3*.sh; do
13+
if [ -f "$file" ]; then
14+
echo "Running $file"
15+
$file
16+
fi
17+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025 Nordic Semiconductor ASA
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
dir_path=$(dirname "$0")
8+
9+
set -e # Exit on error
10+
11+
# Run all cap_ac_4* tests
12+
for file in "$dir_path"/cap_ac_4*.sh; do
13+
if [ -f "$file" ]; then
14+
echo "Running $file"
15+
$file
16+
fi
17+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025 Nordic Semiconductor ASA
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
dir_path=$(dirname "$0")
8+
9+
set -e # Exit on error
10+
11+
# Run all cap_ac_5* tests
12+
for file in "$dir_path"/cap_ac_5*.sh; do
13+
if [ -f "$file" ]; then
14+
echo "Running $file"
15+
$file
16+
fi
17+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025 Nordic Semiconductor ASA
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
dir_path=$(dirname "$0")
8+
9+
set -e # Exit on error
10+
11+
# Run all cap_ac_6* tests
12+
for file in "$dir_path"/cap_ac_6*.sh; do
13+
if [ -f "$file" ]; then
14+
echo "Running $file"
15+
$file
16+
fi
17+
done

0 commit comments

Comments
 (0)