tests: bsim: Bluetooth: Single multilink central to multiple peripheral
Test covering single multilink central device connecting to multiple single link peripheral devices. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
6794b5ebf2
commit
1aa68de993
2 changed files with 88 additions and 0 deletions
|
|
@ -84,6 +84,48 @@ exit:
|
|||
bs_trace_silent_exit(0);
|
||||
}
|
||||
|
||||
static void test_central_multiple_main(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = init_central(20U, ITERATIONS);
|
||||
if (err) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* Wait a little so that peripheral side completes the last
|
||||
* connection establishment.
|
||||
*/
|
||||
k_sleep(K_SECONDS(1));
|
||||
|
||||
PASS("Central tests passed\n");
|
||||
bs_trace_silent_exit(0);
|
||||
|
||||
return;
|
||||
|
||||
exit:
|
||||
FAIL("Central tests failed (%d)\n", err);
|
||||
bs_trace_silent_exit(0);
|
||||
}
|
||||
|
||||
static void test_peripheral_single_main(void)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = init_peripheral(1U, ITERATIONS);
|
||||
if (err) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
PASS("Peripheral tests passed\n");
|
||||
|
||||
return;
|
||||
|
||||
exit:
|
||||
FAIL("Peripheral tests failed (%d)\n", err);
|
||||
bs_trace_silent_exit(0);
|
||||
}
|
||||
|
||||
static void test_multiple_init(void)
|
||||
{
|
||||
bst_ticker_set_next_tick_absolute(1500e6);
|
||||
|
|
@ -111,6 +153,20 @@ static const struct bst_test_instance test_def[] = {
|
|||
.test_tick_f = test_multiple_tick,
|
||||
.test_main_f = test_peripheral_main
|
||||
},
|
||||
{
|
||||
.test_id = "central_multiple",
|
||||
.test_descr = "Single Central Multilink device",
|
||||
.test_pre_init_f = test_multiple_init,
|
||||
.test_tick_f = test_multiple_tick,
|
||||
.test_main_f = test_central_multiple_main
|
||||
},
|
||||
{
|
||||
.test_id = "peripheral_single",
|
||||
.test_descr = "Many Peripheral single link device",
|
||||
.test_pre_init_f = test_multiple_init,
|
||||
.test_tick_f = test_multiple_tick,
|
||||
.test_main_f = test_peripheral_single_main
|
||||
},
|
||||
BSTEST_END_MARKER
|
||||
};
|
||||
|
||||
|
|
|
|||
32
tests/bsim/bluetooth/ll/multiple_id/tests_scripts/multiple_peripheral.sh
Executable file
32
tests/bsim/bluetooth/ll/multiple_id/tests_scripts/multiple_peripheral.sh
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright 2018 Oticon A/S
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
|
||||
|
||||
# Multiple connection between two devices with multiple peripheral identity
|
||||
simulation_id="central_multiple_peripheral_single"
|
||||
verbosity_level=2
|
||||
EXECUTE_TIMEOUT=1600
|
||||
|
||||
cd ${BSIM_OUT_PATH}/bin
|
||||
|
||||
Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_multiple_id_prj_conf \
|
||||
-v=${verbosity_level} -s=${simulation_id} -d=0 -testid=central_multiple
|
||||
|
||||
peripheral_count=20
|
||||
|
||||
for device in `seq 1 $peripheral_count`; do
|
||||
let rs=$device*7
|
||||
|
||||
Execute ./bs_${BOARD_TS}_tests_bsim_bluetooth_ll_multiple_id_prj_conf \
|
||||
-v=${verbosity_level} -s=${simulation_id} -d=$device -rs=$rs \
|
||||
-testid=peripheral_single
|
||||
done
|
||||
|
||||
let device_count=$peripheral_count+1
|
||||
|
||||
Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \
|
||||
-D=$device_count -sim_length=1800e6 $@ -argschannel -at=40
|
||||
|
||||
wait_for_background_jobs
|
||||
Loading…
Reference in a new issue