From 54965790e085c3556c5f210d04f7b627d6089b9d Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Thu, 26 Oct 2023 16:28:25 +0200 Subject: [PATCH] CI bsim workflow: Also run some split BT stack tests 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 --- .github/workflows/bsim-tests.yaml | 22 ++++++++++++---- .../compile.nrf5340bsim_nrf5340_cpuapp.sh | 25 +++++++++++++++++++ .../compile.nrf5340bsim_nrf5340_cpunet.sh | 23 +++++++++++++++++ tests/bsim/bluetooth/tests.nrf52bsim.txt | 3 +++ .../tests.nrf5340bsim_nrf5340_cpuapp.txt | 4 +++ .../tests.nrf5340bsim_nrf5340_cpunet.txt | 4 +++ 6 files changed, 76 insertions(+), 5 deletions(-) create mode 100755 tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpuapp.sh create mode 100755 tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpunet.sh create mode 100644 tests/bsim/bluetooth/tests.nrf52bsim.txt create mode 100644 tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpuapp.txt create mode 100644 tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpunet.txt diff --git a/.github/workflows/bsim-tests.yaml b/.github/workflows/bsim-tests.yaml index a8a49be767080b3..f52a0439d20ba34 100644 --- a/.github/workflows/bsim-tests.yaml +++ b/.github/workflows/bsim-tests.yaml @@ -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 @@ -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' @@ -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 diff --git a/tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpuapp.sh b/tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpuapp.sh new file mode 100755 index 000000000000000..ddb8349ff53a7d5 --- /dev/null +++ b/tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpuapp.sh @@ -0,0 +1,25 @@ +#!/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/conn conf_file=prj_split_privacy.conf sysbuild=1 compile +app=tests/bsim/bluetooth/ll/bis sysbuild=1 compile + +wait_for_background_jobs diff --git a/tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpunet.sh b/tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpunet.sh new file mode 100755 index 000000000000000..e8d78683b2e13e4 --- /dev/null +++ b/tests/bsim/bluetooth/compile.nrf5340bsim_nrf5340_cpunet.sh @@ -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 diff --git a/tests/bsim/bluetooth/tests.nrf52bsim.txt b/tests/bsim/bluetooth/tests.nrf52bsim.txt new file mode 100644 index 000000000000000..9b76be4ec7500a5 --- /dev/null +++ b/tests/bsim/bluetooth/tests.nrf52bsim.txt @@ -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/ diff --git a/tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpuapp.txt b/tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpuapp.txt new file mode 100644 index 000000000000000..147b55103fc5d7f --- /dev/null +++ b/tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpuapp.txt @@ -0,0 +1,4 @@ +# 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/conn/tests_scripts/basic_conn_encrypted_split_privacy.sh +tests/bsim/bluetooth/ll/bis/tests_scripts/broadcast_iso.sh diff --git a/tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpunet.txt b/tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpunet.txt new file mode 100644 index 000000000000000..1d9d73630db5c9c --- /dev/null +++ b/tests/bsim/bluetooth/tests.nrf5340bsim_nrf5340_cpunet.txt @@ -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/