From 372a2e2fd3341f98be8e0f8ed1676ff69aeed5f8 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Thu, 14 May 2020 11:48:17 +0530 Subject: [PATCH] tests: Bluetooth: bsim_test: Include advx testing in CI Update compile.sh and added test_script, so that bsim_test_advx bsim_test application is built and run in CI. Signed-off-by: Vinayak Kariappa Chettimada --- .../bsim_test_advx}/CMakeLists.txt | 0 .../bsim_test_advx}/prj.conf | 3 -- .../bsim_test_advx}/src/main.c | 0 .../tests_scripts/basic_advx.sh | 39 +++++++++++++++++++ tests/bluetooth/bsim_bt/compile.sh | 1 + 5 files changed, 40 insertions(+), 3 deletions(-) rename tests/bluetooth/{ctrl_advx => bsim_bt/bsim_test_advx}/CMakeLists.txt (100%) rename tests/bluetooth/{ctrl_advx => bsim_bt/bsim_test_advx}/prj.conf (75%) rename tests/bluetooth/{ctrl_advx => bsim_bt/bsim_test_advx}/src/main.c (100%) create mode 100755 tests/bluetooth/bsim_bt/bsim_test_advx/tests_scripts/basic_advx.sh diff --git a/tests/bluetooth/ctrl_advx/CMakeLists.txt b/tests/bluetooth/bsim_bt/bsim_test_advx/CMakeLists.txt similarity index 100% rename from tests/bluetooth/ctrl_advx/CMakeLists.txt rename to tests/bluetooth/bsim_bt/bsim_test_advx/CMakeLists.txt diff --git a/tests/bluetooth/ctrl_advx/prj.conf b/tests/bluetooth/bsim_bt/bsim_test_advx/prj.conf similarity index 75% rename from tests/bluetooth/ctrl_advx/prj.conf rename to tests/bluetooth/bsim_bt/bsim_test_advx/prj.conf index 0c035ec524f..ef630acac46 100644 --- a/tests/bluetooth/ctrl_advx/prj.conf +++ b/tests/bluetooth/bsim_bt/bsim_test_advx/prj.conf @@ -6,6 +6,3 @@ CONFIG_BT_EXT_ADV=y CONFIG_BT_CTLR_ADV_EXT=y CONFIG_BT_CTLR_ADV_PERIODIC=y - -# CONFIG_BT_DEBUG_LOG=y -# CONFIG_BT_DEBUG_HCI_CORE=y diff --git a/tests/bluetooth/ctrl_advx/src/main.c b/tests/bluetooth/bsim_bt/bsim_test_advx/src/main.c similarity index 100% rename from tests/bluetooth/ctrl_advx/src/main.c rename to tests/bluetooth/bsim_bt/bsim_test_advx/src/main.c diff --git a/tests/bluetooth/bsim_bt/bsim_test_advx/tests_scripts/basic_advx.sh b/tests/bluetooth/bsim_bt/bsim_test_advx/tests_scripts/basic_advx.sh new file mode 100755 index 00000000000..557f9111989 --- /dev/null +++ b/tests/bluetooth/bsim_bt/bsim_test_advx/tests_scripts/basic_advx.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Copyright 2018 Oticon A/S +# SPDX-License-Identifier: Apache-2.0 + +# Basic connection test: a central connects to a peripheral and expects a +# notification, using the split controller (ULL LLL) +simulation_id="basic_advx" +verbosity_level=2 +process_ids=""; exit_code=0 + +function Execute(){ + if [ ! -f $1 ]; then + echo -e " \e[91m`pwd`/`basename $1` cannot be found (did you forget to\ + compile it?)\e[39m" + exit 1 + fi + timeout 30 $@ & process_ids="$process_ids $!" +} + +: "${BSIM_OUT_PATH:?BSIM_OUT_PATH must be defined}" + +#Give a default value to BOARD if it does not have one yet: +BOARD="${BOARD:-nrf52_bsim}" + +cd ${BSIM_OUT_PATH}/bin + +Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_advx_prj_conf \ + -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=advx + +Execute ./bs_${BOARD}_tests_bluetooth_bsim_bt_bsim_test_advx_prj_conf\ + -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=scanx + +Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ + -D=2 -sim_length=10e6 $@ + +for process_id in $process_ids; do + wait $process_id || let "exit_code=$?" +done +exit $exit_code #the last exit code != 0 diff --git a/tests/bluetooth/bsim_bt/compile.sh b/tests/bluetooth/bsim_bt/compile.sh index 15bd15a5df0..487b50bf50f 100755 --- a/tests/bluetooth/bsim_bt/compile.sh +++ b/tests/bluetooth/bsim_bt/compile.sh @@ -55,5 +55,6 @@ app=tests/bluetooth/bsim_bt/bsim_test_app conf_file=prj_split.conf \ compile app=tests/bluetooth/bsim_bt/bsim_test_app conf_file=prj_split_privacy.conf \ compile +app=tests/bluetooth/bsim_bt/bsim_test_advx compile app=tests/bluetooth/bsim_bt/edtt_ble_test_app/hci_test_app compile app=tests/bluetooth/bsim_bt/edtt_ble_test_app/gatt_test_app compile