1#!/usr/bin/env bash
2# Copyright 2023-2024 Nordic Semiconductor ASA
3# SPDX-License-Identifier: Apache-2.0
4
5# Simple selfchecking test for the CAP samples for broadcast.
6# It relies on the bs_tests hooks to register a test timer callback, which after a deadline
7# will check how many broadcast audio packets have been tranferred, and if over a threshold
8# it considers the test passed
9
10simulation_id="cap_broadcast_test"
11verbosity_level=2
12EXECUTE_TIMEOUT=120
13
14source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
15
16cd ${BSIM_OUT_PATH}/bin
17
18Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_audio_samples_cap_initiator_broadcast_prj_conf \
19  -v=${verbosity_level} -s=${simulation_id} -d=0 -RealEncryption=1 -testid=cap_initiator
20
21Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_audio_samples_cap_acceptor_broadcast_prj_conf \
22  -v=${verbosity_level} -s=${simulation_id} -d=1 -RealEncryption=1 -testid=cap_acceptor
23
24Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
25  -D=2 -sim_length=20e6 $@ -argschannel -at=40
26
27wait_for_background_jobs #Wait for all programs in background and return != 0 if any fails
28