Skip to content

Commit

Permalink
CI bsim workflow: Also run some split BT stack tests
Browse files Browse the repository at this point in the history
Also run some split BT stack tests on the nrf5340 platform
to test this configuration.

Move the selection of which BT tests are built and run
in each platform to files in the tests/bsim/ folder.

Signed-off-by: Alberto Escolar Piedras <[email protected]>
  • Loading branch information
aescolar committed Oct 26, 2023
1 parent d61ec0f commit a803450
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/bsim-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
EDTT_PATH: ../tools/edtt
bsim_bt_52_test_results_file: ./bsim_bt/52_bsim_results.xml
bsim_bt_53_test_results_file: ./bsim_bt/53_bsim_results.xml
bsim_bt_53split_test_results_file: ./bsim_bt/53_bsim_split_results.xml
bsim_net_52_test_results_file: ./bsim_net/52_bsim_results.xml
steps:
- name: Apply container owner mismatch workaround
Expand Down Expand Up @@ -134,15 +135,25 @@ jobs:
if: steps.check-bluetooth-files.outputs.any_changed == 'true' || steps.check-common-files.outputs.any_changed == 'true'
run: |
export ZEPHYR_BASE=${PWD}
WORK_DIR=${ZEPHYR_BASE}/bsim_bt nice tests/bsim/bluetooth/compile.sh
export WORK_DIR=${ZEPHYR_BASE}/bsim_bt
# Build and run the BT tests for nrf52_bsim:
nice tests/bsim/bluetooth/compile.sh
RESULTS_FILE=${ZEPHYR_BASE}/${bsim_bt_52_test_results_file} \
SEARCH_PATH=tests/bsim/bluetooth/ tests/bsim/run_parallel.sh
# Run the BT controller tests also for the nrf5340
TESTS_FILE=tests/bsim/bluetooth/tests.nrf52bsim.txt tests/bsim/run_parallel.sh
# Build and run the BT controller tests also for the nrf5340bsim_nrf5340_cpunet
BOARD=nrf5340bsim_nrf5340_cpunet \
WORK_DIR=${ZEPHYR_BASE}/bsim_bt nice tests/bsim/bluetooth/ll/compile.sh
nice tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpunet.sh
BOARD=nrf5340bsim_nrf5340_cpunet \
RESULTS_FILE=${ZEPHYR_BASE}/${bsim_bt_53_test_results_file} \
SEARCH_PATH=tests/bsim/bluetooth/ll/ tests/bsim/run_parallel.sh
TESTS_FILE=tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpunet.txt \
tests/bsim/run_parallel.sh
# Build and run the nrf5340 split stack tests set
BOARD=nrf5340bsim_nrf5340_cpuapp \
nice tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpuapp.sh
BOARD=nrf5340bsim_nrf5340_cpuapp \
RESULTS_FILE=${ZEPHYR_BASE}/${bsim_bt_53split_test_results_file} \
TESTS_FILE=tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpuapp.txt \
tests/bsim/run_parallel.sh
- name: Run Networking Tests with BSIM
if: steps.check-networking-files.outputs.any_changed == 'true' || steps.check-common-files.outputs.any_changed == 'true'
Expand All @@ -160,6 +171,7 @@ jobs:
path: |
./bsim_bt/52_bsim_results.xml
./bsim_bt/53_bsim_results.xml
./bsim_bt/53_bsim_split_results.xml
./bsim_net/52_bsim_results.xml
${{ github.event_path }}
if-no-files-found: warn
Expand Down
24 changes: 24 additions & 0 deletions tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpuapp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Copyright 2018 Oticon A/S
# SPDX-License-Identifier: Apache-2.0

# Compile all bluetooth applications needed for the split stack tests

#set -x #uncomment this line for debugging
set -ue
: "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}"
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root\
directory}"

WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}"

BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}"
BOARD="${BOARD:-nrf5340bsim_nrf5340_cpuapp}"

mkdir -p ${WORK_DIR}

source ${ZEPHYR_BASE}/tests/bsim/compile.source

app=tests/bsim/bluetooth/ll/bis sysbuild=1 compile

wait_for_background_jobs
23 changes: 23 additions & 0 deletions tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpunet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Copyright 2018 Oticon A/S
# SPDX-License-Identifier: Apache-2.0

# Compile all the applications needed by the Bluetooth bsim tests on the nrf5340_cpunet

#set -x #uncomment this line for debugging
set -ue
: "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}"
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root\
directory}"

WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}"

BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}"

mkdir -p ${WORK_DIR}

source ${ZEPHYR_BASE}/tests/bsim/sh_common.source

${ZEPHYR_BASE}/tests/bsim/bluetooth/ll/compile.sh

wait_for_background_jobs
3 changes: 3 additions & 0 deletions tests/bsim/bluetooth/tests.nrf52bsim.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Search paths(s) for tests which will be run in the nrf52bsim
# This file is used in CI to select which tests are run
tests/bsim/bluetooth/
3 changes: 3 additions & 0 deletions tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpuapp.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Search paths(s) for tests which will be run in the nrf5340 split stack configuration
# This file is used in CI to select which tests are run
tests/bsim/bluetooth/ll/bis/tests_scripts/broadcast_iso.sh
4 changes: 4 additions & 0 deletions tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpunet.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Search paths(s) for tests which will be run in the nrf5340 net core (both app, host and controller
# built in the net core)
# This file is used in CI to select which tests are run
tests/bsim/bluetooth/ll/

0 comments on commit a803450

Please sign in to comment.